200 likes | 324 Views
Stanford Logic Group WOLS’05. Dealing with Inconsistency in PrediCalc. Michael Kassoff Michael Genesereth September 22, 2005. Electronic Spreadsheets. Huge success
E N D
Stanford Logic Group WOLS’05 Dealing with Inconsistency in PrediCalc Michael Kassoff Michael Genesereth September 22, 2005
Electronic Spreadsheets • Huge success • Used by everyone from multinational conglomerates to individuals • Limitations • Functional definitions • Unidirectional update
From Functions to Constraints Generalizing formulae to many-to-many constraints allows us to use spreadsheets for a wide variety of applications • 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 • “Students must take at least 2 math courses to graduate”
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”
Spreadsheet Representation We represent value assignments to cells with ground unary atoms {student(bob), major(math)} student major bob math
Constraints Arbitrary first-order constraints over cells are allowed View Definitions: r(X) p(X) q(X) Functional Dependencies: r(X) r(Y) X=Y Existential Constraints: X.r(X) Integrity Constraints: (p(X) q(X)) r(X)
Update 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
Bilevel Update p(X) q(X) When values are removed from user-specified cells, their consequences go away p q a a p q User specified System generated
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
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.”
course1 course2 course3 eng eng eng Explosion! Logical entailment if explosive: if a set of sentences is inconsistent, then it logically entails everything. major art,cs, math,…
Existential -Entailment A set of sentences existentially entails a sentence relative to (written | ) if and only if there is an -consistent subset of that, when added to , logically entails . ’ and ’ | and ’ | Existential -entailment is not explosive. It generates only “justified” conclusions.
“Possible Worlds” View A possible worldW is a subset of the 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 Note that using maximal consistent subsets as possible worlds gives the same result
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)}
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!
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]
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)
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