Presentation is loading. Please wait.

Presentation is loading. Please wait.

Logical Spreadsheets Michael Kassoff August 1, 2006 Stanford Logic Group SRI AIC Seminar joint work with Michael Genesereth.

Similar presentations


Presentation on theme: "Logical Spreadsheets Michael Kassoff August 1, 2006 Stanford Logic Group SRI AIC Seminar joint work with Michael Genesereth."— Presentation transcript:

1 Logical Spreadsheets Michael Kassoff August 1, 2006 Stanford Logic Group SRI AIC Seminar joint work with Michael Genesereth

2 Electronic Spreadsheets Huge success Used by everyone from multinational conglomerates to individuals Uses –Financial planning –Scientific data analysis –Shopping lists

3 Why People Like Spreadsheets Saves you work –Automatic calculation –Automatic recalculation Allows “what if” analysis Programming is easy –You don’t have to be a programmer to program a spreadsheet –Mathematical notation is familiar to people (C1=A1+B1) –Unlike traditional programs, intermediate computation steps are all displayed for you –It’s like being in debug mode all the time

4 Limitations of Traditional Spreadsheets Unidirectional update Functional definitions, not many-to-many constraints

5 Applications of Many-to-Many, Multidirectional Constraints Correct-on-capture data entry (smart forms) –“Start times must be before end times” –“The number of lap infants traveling must not be greater than the number of adults” Enterprise Management policies –“Only senior managers can reserve the third floor conference room” Design / Configuration –“If the car’s exterior color is blue, the possible interior colors are tan and gray.” –“Students must take at least 2 math courses to graduate”

6 Logical Spreadsheets We choose to represent many-to-many relationships using logical formulae start-time(S) and end-time(E)  before(S,E) “The start time must be before the end time” event-owner(O) and  senior-manager(O)   event-room(room301) “Only senior managers can reserve the third floor conference room” Note that the arrows do not imply directionality. Relationships are omnidirectional.

7 From Functions to Constraints Example: Event creation smart form Demo Demo Constraints “Start Time < End Time” “Start Time + Duration = End Time”

8 Agenda -Formal Definitions -Update Mechanism -Inconsistency Handling -Demo -Logical Spreadsheets on the Web

9 Formal Definitions A logical spreadsheet consists of a finite set of cells, a set of possible values for those cells, and a set of constraints encoded as logical sentences. Cells: {p, q, r} Possible Values: {a, b, c, d} Constraints: {p(x)  q(x),  q(x) or r(x)}

10 Value Assignments We represent value assignments to cells with ground unary atoms {student(bob), major(math)} math majorstudent bob

11 Constraints Universal first-order constraints over cells are allowed View Definitions: r(X)  p(X)  q(X) Functional Dependencies: r(X)  r(Y)  X=Y Integrity Constraints: (  p(X)  q(X))   r(X)

12 N-ary Relations Through view definitions, can expand language to include n-ary relations without an increase in expressive power View Definitions: location(x,y)  e(x)  r(y) Functional Dependencies: location(x,y)  location(x,z)  y=z Integrity Constraints: needs-projector(x)  has-projector(y)   location(x,y) For the rest of the preso, we’ll just use unary relations

13 Logical Spreadsheet = Interactive CSP A constraint satisfaction problem consists of a set of variables, a set of possible values for those variables, and set of constraints “variable” = “single-valued cell” Note the focus on interactivity

14 Logical Spreadsheets as Databases A logical spreadsheet can be viewed as a deductive database (database with constraints) consisting of unary relations PQR acb bdc cd

15 Updating Logical Spreadsheets

16 User-specified Cells vs. Computed Cells Can assign a value to any cell User-specified cells are marked with a dark outline Computed cells contain logical consequences of user-specified cells User specified System generated b pq b a pq a p(X)  q(X)

17 Bilevel Update User specified System generated pq a pq a p(X)  q(X) Q: Why does a logical spreadsheet distinguish between user specified and system generated values? A: When values are removed from user-specified cells, their consequences go away

18 Direct Conflict What happens when a newly assigned value conflicts with a previously assigned one? a pq a p(X)  q(X) b Possible outcomes a pq a Reject b pq a Conflict b pq b Resolve

19 Information Loss vs. Inconsistency eng course1  course1(eng) or  course2(eng) or  course3(eng) course2course3 eng Possible outcomes eng course1course2course3 eng course1course2course3 eng course1course2course3 eng course1course2course3 eng “Students must take some course from outside the engineering school.”

20 Problem A set of sentences  logically entails a sentence  if and only if every model of  is a model of . An inconsistent theory has no models. Explosion! eng course1course2course3 eng art,cs, math,… major

21 Solution We use a new paraconsistent entailment relation called Existential  -Entailment instead of logical entailment Existential  -Entailment is not explosive

22 Existential  -Entailment A possible world W is a subset of the user-specified value assignments  of a spreadsheet that is consistent with the constraints  A fact  is true in a possible world W iff W   |=   |    when  is true in some possible world of the spreadsheet Formally,  |    when W   and  W |   and  W |  

23 Example  course1(pe) or  course2(pe) or  course3(pe) “Students must take some non-physical education class.” course1(X) and course2(X) and course3(X)  minor(X) “If a student takes three courses in the same subject, the student is awarded a minor in that subject.” course1(pe) or course2(pe) or course3(pe)  pe_requirement(yes) “Students can fulfill their physical education requirement by taking any physical education class.” Value assignments: { c1(pe), c2(pe), c3(pe)} Maximal consistent subsets (possible worlds): { c1(pe), c2(pe)} { c1(pe), c3(pe)} { c2(pe), c3(pe)}   |= {c1(pe), c2(pe), pe_req(yes)}   |= {c1(pe), c3(pe), pe_req(yes)}   |= {c2(pe), c3(pe), pe_req(yes)} Result: { c1(pe), c2(pe), c3(pe), pe_req(yes)}

24 Proof-Theoretic View  |    when there is some set of premises P from    that proves  such that P is consistent with . Note that the proof-theoretic view tells us that there is no need to take all (maximal) subsets of the data. Just modify your favorite proof procedure with a consistency check. Because theory is unary, consistency checking is decidable!

25 Example Constraints = {  c1(pe) or  c2(pe) or  c3(pe), c1(X) and c2(X) and c3(X)  minor(X)} Data = { c1(pe), c2(pe), c3(pe)} Query =  X. minor(X) 1. [Premise, constraint] 2. [Premise, constraint] 3. [Premise, data] 4. [Premise, data] 5. [Premise, data] 6. [Goal] 7. [6,1] 8. [7,3] 9. [8,4] 10. [9,5]

26 Consistent Query Answering In the database literature, a growing subfield is consistent query answering (CQA) Designed for querying inconsistent databases Similar to Existential  -Entailment, except an answer must be true in all possible worlds (intersection instead of union)

27 Linear Resolution Linear Resolution methods such as those used in Model Elimination and Prolog are also paraconsistent Given {p,  p, r  q} and a query r Prolog / ME will not return true However, Prolog / ME were not designed to handle paraconsistency - this is merely a side effect of their efficiency

28 Logical Spreadsheet Demo

29 Websheets Each field is a cell Cells can be related with logical formulae We built two prototypes: (1) AJAX-based (client/server) demodemo (2) Completely JavaScript based (client only)

30 Interlinked Spreadsheets

31 World Wide Websheet

32 Thanks!


Download ppt "Logical Spreadsheets Michael Kassoff August 1, 2006 Stanford Logic Group SRI AIC Seminar joint work with Michael Genesereth."

Similar presentations


Ads by Google