1 / 32

Logical Spreadsheets

Stanford Logic Group SRI AIC Seminar. Logical Spreadsheets. Michael Kassoff August 1, 2006. joint work with Michael Genesereth. Electronic Spreadsheets. Huge success Used by everyone from multinational conglomerates to individuals Uses

colby
Download Presentation

Logical Spreadsheets

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Stanford Logic Group SRI AIC Seminar Logical Spreadsheets Michael Kassoff August 1, 2006 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 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)} student major bob math

  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 a c b b d c c d

  15. Updating Logical Spreadsheets

  16. User-specified Cells vs. Computed Cells p(X)  q(X) 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 p q a a p q b b User specified System generated

  17. Bilevel Update 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 p q a a p q User specified System generated

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

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

  20. major course1 course2 course3 art,cs, math,… Explosion! eng eng eng 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.

  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 worldW 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)} Result: {c1(pe), c2(pe), c3(pe), pe_req(yes)} •  |= {c1(pe), c2(pe), pe_req(yes)} •  |= {c1(pe), c3(pe), pe_req(yes)} •  |= {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) <Clause, Assumptions> • <{c1(X), c2(X), c3(X),minor(X)}, {}> [Premise, constraint] • <{c1(pe), c2(pe), c3(pe)}, {}> [Premise, constraint] • <{c1(pe)}, {c1(pe)}> [Premise, data] • <{c2(pe)}, {c2(pe)}> [Premise, data] • <{c3(pe)}, {c3(pe)}> [Premise, data] • <{minor(X)}, {}> [Goal] • <{c1(X), c2(X), c3(X)}, {}> [6,1] • <{c2(pe), c3(pe)}, {c1(pe)}> [7,3] • <{c3(pe)}, {c1(pe), c2(pe)}> [8,4] • <{}, {c1(pe), c2(pe), c3(pe)}> [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) demo (2) Completely JavaScript based (client only)

  30. Interlinked Spreadsheets

  31. World Wide Websheet

  32. Thanks!

More Related