DOC PREVIEW
Stanford CS 157 - Lecture 17 - Logical Spreadsheet

This preview shows page 1-2-3-24-25-26 out of 26 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1Logical SpreadsheetsMichael GeneserethLogic GroupStanford Universityin collaboration withMike Kassoff and Eric Kao2/63Huge Success individual users companies conglomeratesGood Features Automatic computation of values Ease of specification using simple math formulasComputerized Spreadsheets23/63Functional formulasUnidirectional Update B1 B2 B3Limitations of Traditional Spreadsheets23B3 = B1 + B254/63Examples of Non-Functional ConstraintsScheduling–Start times must be before end times–Room 104 may not be scheduled after 5:00 pm–Only senior managers can reserve the third floorconference roomTravel Reservations–The number of lap infants in a group on a flightmust not exceed the number of adults.Academic Programs–Students must take at least 2 math courses35/63Logical SpreadsheetsExtension Relational constraints on the values of cellsGood Features Automatic computation of values Ease of set-up (using logical formulas)Challenges Automatic update Temporary inconsistencies User feedback6/63Spreadsheet/Websheet ApplicationsData management Design/ConfigurationSmart Forms Interactive Answers47/63Definitions8/63Logical SpreadsheetsA logical spreadsheet consists of a finite set ofcells, a set of possible values for those cells, and aset of constraints on cell values.Cells: p, q, r, sPossible Values: a, b, c, dConstraints: If p is assigned a, then q must be assigned b or c. If r is not a, then s must have the same value as q.59/63Value AssignmentsA value assignment is a function from cells tovalues. A value assignment is complete if thisfunction is total. Otherwise, it is partial.In what follows, we formalize value assignments assets of ground, atomic sentences in which therelation represents the cell and the argumentrepresents the value.{p(a), q(b), r(c)}10/63CompletenessA value assignment Λ for a logical spreadsheet iscomplete if and only if it assigns exactly one valueto each cell in the spreadsheet, i.e. for every cell ρthere is exactly one constant τ such that ρ(τ)∈Λ.Cells = {p, q, r}Values = {a, b, c, d}Ω = {p(x) ⇒ q(x), q(x) ⇒ r(x)}Λ = {p(a), q(a), r(a)}611/63Constraint LanguageA constraint is a boolean formula involving cellnames, object names, variables, and equality.Cell p must be a or both q and r must both be b.p(a) ∨ (q(b) ∧ r(b))If p is assigned a, then q must be assigned b or c.p(a) ⇒ q(b) ∨ q(c)If p and q are the same, then r must be different.p(x) ∧ q(x) ⇒ ¬r(x)12/63ConsistencyA value assignment Λ is consistent with a self-consistent set of constraints Ω if and only if they donot logically entail a contradiction, i.e. Ω ∪ Λ |≠ ⊥.Cells = {p, q, r}Values = {a, b, c, d}Ω = {p(x) ⇒ q(x), q(x) ⇒ r(x)}Λ = {p(a ), q(a), r(a)}NB: In managing logical spreadsheets, we mustsometimes deal with inconsistent valueassignments.713/63User’s Goal complete, consistent value assignment satisfying unwritten constraints as wellLimitation one cell at a time changingGoals and Limitations14/63Obedience - specified update made together with allother updates logically required by the updatePropagation - consequences shownFairness - no arbitrary choices made by the systemConservation - no unnecessary loss of informationGeneral Principles815/63UpdateOutcome:Obediencep qbarp qar16/63UpdateOutcome:Conservationp qba crp qa cr917/63Updatep(x) ⇔ r(x)Outcome:Categorical Entailmentp qarp qa ar18/63Updatep(x) ⇔ r(x)Outcome:Categorical Entailmentp qaerasearp q r1019/63Updatep(x) ⇔ r(x)Outcome:Categorical Entailmentp qa arp q rerase20/63Updatep(x) ⇔ r(x)Outcome:Categorical Entailmentp qa arp qb brb1121/63Ambiguityap q ra ap q raa ap q rap q ra ap q raaUpdate¬p(x) ∨ ¬q(x) ∨ ¬r(x)Possible Outcomes:22/63Explosion!Logical Entailment: Λ |= ϕ ifand only if every model of Λ is amodel of ϕ.If a set of sentences isinconsistent, then it logicallyentails everything.a,b,csa,b,cp q ra,b,ca,b,c1223/63Existential Ω-EntailmentA set of sentences Λ existentially entails a sentenceϕ relative to Ω (written Λ |≈Ω ϕ) if and only if thereis an Ω-consistent subset of Λ that, when added to Ω,logically entails ϕ.Λ’⊆ Λ and Ω∪Λ’ |≠ ⊥ and Ω∪Λ’ |= ϕExistential Ω-entailment is not explosive. Itgenerates only “justified” conclusions.24/63ExampleConstraints: ¬p(x) ∨ ¬q(x) ∨ ¬r(x) p(a) ∧ q(a) ⇒ s(c) q(a) ∧ r(a) ⇒ t(c)Data: Conclusions: p(a) s(c) q(a) t(c) r(a)1325/63Spreadsheet: 〈C,U,Ω〉 C - set of names for cells U - set of names for values Ω - set of constraintsState: Λ - base assignment Δ - deletion set - a set of cells Π - computed assignment - what the user seesSpreadsheet State26/63Spreadsheet: 〈C,U,Ω〉 C - set of names for cells U - set of names for values Ω - set of constraintsInitial state: Λ = {} Δ = {} Π = {ρ(τ) | Ω |= ρ(τ) and ρ∈C and τ∈U}Initial State1427/63Addition: γBase Assignment Λ’ = Λ - {ϕ∈Λ | Ω∪{γ} |=¬ϕ} ∪ {γ}Deletion Set Δ’ = Δ - {ρ | Ω∪{γ} |= ρ(τ) for some τ∈U}Addition Rule28/63Deletion: δBase Assignment Λ’ = Λ - {ϕ∈Λ | Ω∪{ϕ} |= δ }Deletion Set Δ’ = Δ ∪ {ρ} where δ = ρ(τ)}Deletion Rule1529/63A set Λ of ground atoms existentially entails ϕ withrespect to Ω (written Λ |=Ω ϕ) if and only ifthere is a subset Κ of Λ that meets the followingconditions.(1) Κ is consistent with Ω.Ω ∪ Κ |≠ ⊥(2) Κ and Ω logically entail ϕ.Ω ∪ Κ |= ϕExistential Entailment30/63Entailment Set: Π* = {ϕ | Λ’ |=Ω ϕ}Diminished Entailment Set Π** = Π*- {ρ(τ) ∈ Π* | ρ ∈ Δ}Unique Diminished Entailment Set Π*** = Π**- {ρ(τ1) ∈ Π** | ρ(τ2) ∈ Π** and τ1≠τ2}Computed Assignment: Π’ = Π*** ∪ ΛUpdate Rule1631/63Example32/63Example1733/63Example34/63Example1835/63Example36/63Example1937/63Example38/63Example2039/63Example40/63Example2141/63Conclusion42/63Dynamic ConstraintsStatic ConstraintsDynamic Constraintsclear(a)table(c)on(a,b)on(b,c)clear(a)table(c)on(a,b)on(b,a)Xclear(a)clear(b)clear(c)table(a)table(b)table(c)clear(a)clear(b)table(b)table(c)on(b,c)clear(a)table(c)on(b,c)on(a,b)X2243/63The naïve approach to computing existentialconclusions from Π is to take each subset of Π andderive logical consequences. While this works, it isexponential in the size of the dataset).Solution: Transform constraints and use deduction.Ω → Ω’Λ’ = {ϕ | Ω’∪ Π’ |= ϕ} = {ϕ | Π’ |=Ω ϕ}Advantage:


View Full Document

Stanford CS 157 - Lecture 17 - Logical Spreadsheet

Documents in this Course
Lecture 1

Lecture 1

15 pages

Equality

Equality

32 pages

Lecture 19

Lecture 19

100 pages

Epilog

Epilog

29 pages

Equality

Equality

34 pages

Load more
Download Lecture 17 - Logical Spreadsheet
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 17 - Logical Spreadsheet and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 17 - Logical Spreadsheet 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?