eric kao cs 157 computational logic autumn...
Post on 29-Jun-2020
2 Views
Preview:
TRANSCRIPT
Inconsistency-tolerant logics
Eric Kao
CS 157 Computational LogicAutumn 2011
11/27/11 2
Inconsistent logical theories
● T1 = { p(a) , ¬p(a) }
● T 2 = { x(p(x)→q(x)) , p(a) , ¬q(a) }∀
● Definition: A theory T is inconsistent if T has no models (no interpretation satisfies T)
11/27/11 3
Causes of inconsistency● Errors
● Contradiction within software documentation● Uncertainty and approximation● Delay in update● Semantic disagreement
● Price of a PS3 in the US vs. Canada● Fundamental disagreements
● Birth year of Julius Caesar: 200 BC vs. 202 BC● Fundamental inconsistency of the world
11/27/11 4
Trivialization● Recall: T φ if and only if every model of T is a ⊨
model of φ. ● Upshot: if T has no models, then the condition
trivially holds for any sentence φ.● Classical logic does not distinguish between
inconsistent theories.● Exercise: prove q from the premises p,¬p, using the
Mendelson system.
11/27/11 5
Problems with inconsistency● Wikipedia Mike plays Jack Bauer in 24⊨
● Microsoft knowledge base Steve Ballmer hates ⊨Windows
● Wikipedia GDP of the US is greater than GDP of ⊨Canada
● We would like to distinguish between different “sorts” of consequences
11/27/11 6
Inconsistency-tolerant logics● How can we modify classical logic to avoid
trivialization?● Change the model theory
● e.g. many-valued logics● Change the proof theory
● Change the rules of inference● Change what constitutes a proof
– e.g. require that a proof must be self consistent
11/27/11 7
Resolution and trivialization● Resolution method:
Show: p, ¬p ⊨ q● {p}, {¬p}, {¬q} derives the empty clause
● The resolution step itself does not explode● {p},{¬p} does not derive {¬q}
(using resolution steps)
11/27/11 8
Quasi-classical logic● { p, ¬p } |~ q ?● { p, ¬p, q v r } |~ q ?● { p, ¬p, p v ¬p v q } |~ q ?● { p, ¬p, p v ¬p v q } |~ q v r ?● { p, ¬p, p v ¬p v q v r } |~ q v r ?● { p, ¬p, ¬p v q } |~ q ?
11/27/11 9
Existential Entailment (Logic)● { p, ¬p } |~ q ?● { p, ¬p, q v r } |~ q ?● { p, ¬p, p v ¬p v q } |~ q ?● { p, ¬p, p v ¬p v q } |~ q v r ?● { p, ¬p, p v ¬p v q v r } |~ q v r ?● { p, ¬p, ¬p v q } |~ q ?
11/27/11 10
QC using Set of Support● Using the Set of support strategy
● Choose {¬q} as the set of support● {p}, {¬p}, {¬q} does NOT derive the empty clause
Relational Calculus SyntaxEric Kao
Database, Queries● Database instance
A finite set of ground atoms● e.g., D = { p(a,a), p(b,c), q(a), r(a,d) }
● QueryA relational calculus formula● e.g., Q1 = p(a,b)
● e.g., Q2(x) = y p(x,y)∃
● e.g., Q3(x) = z y (¬p(x,y) r(y,z))∃ ∀ ∨
Eric Kao
Database semantics● D = { p(a,a), p(b,c), q(a), q(b) }● D p(a,a) ?⊨ yes● D ¬q(c) ?⊨ no● D x p(x,x) ?⊨ ∃ yes● D x (q(x)→ p(x,x))⊨ ∀ ? no● D x y (q(x)→ p(x,y)) ?⊨ ∀ ∃ yes
Database constraints● Constraint set
A finite, consistent set of relational calculus sentences
● e.g., C = { x (¬p(x,x) q(x)), ∀ ∨x q(x) } ∃
Eric Kao
Trivialization ● D = { p(a) , p(b) }
Constraints: { ¬p(a) ∨ ¬p(b) }● If D C has no models, then D C φ for any φ∪ ∪ ⊨
● But there is a very natural model to use: D● D p(a)⊨
● D p(c)⊭
● Some absurd conclusions remain● D p(a) p(b)⊨ ∧
● Julius Caesar was born in 200 BC and in 202 BC
Min-change Repairs● Given:
● D : database e.g.,{ p(a), p(b) }● Ω : set of constraints e.g.,{¬p(a) ∨ ¬p(b) }
● A repair is a database D* that is consistent with Ω.e.g., { p(a) }, { p(b) }, { }, { p(a), p(c) }, ...
● A minimal change repair is a repair that is minimally different from D.
minimal according to the relationship A ≤ B if and only if (A – D) (B – D) and (D – A) (D – B)⊆ ⊆
Eric Kao
Exercise ● Given:
● D : database e.g.,{ p(a), p(b) }● Ω : set of constraints e.g.,{¬p(a) ∨ ¬p(b) }
● Which are the minimal change repairs?● { p(a), p(b) }● { p(a) }● { p(b) }● { }● { p(a), p(c) }
Consistent query answers● CQA: answers that arise no matter how the
conflicts are resolved (in a minimal-change fashion) [ABC]
● D ⊨CQAΩ Q(t) iff
for all minimal-change repairs D* of D w.r.t. to Ω, D* Q(t)⊨
Eric Kao
CQA
● p(a)? NO {p(b)}● p(b)? NO {p(a)}● p(a) p(b)? ∧ NO {p(b)}● p(a) p(b)? ∨ YES {p(a)}, {p(b)}
p(a)
p(b)Conflict
Constraint:¬p(a) ∨ ¬p(b)
Eric Kao
More lenient semantics● In some situations, we would like to see
plausible though non-guaranteed answers● e.g., a student figuring out whom his office mates
might be● Possible answers from repairs: answers that
arise from some minimal-change repair
Eric Kao
Possible answers● Constraint: every person must be assigned a
desk● Data: Charles is missing a desk assignment● Minimal-change repairs:
{desk(Charles,desk1)}, {desk(Charles,desk2)}, {desk(Charles,desk3)}, …
● Possible answers:desk1, desk2, desk3, …
Eric Kao
Relax not repair● Instead of repairing a database to be
consistent with constraints, we can relax a database to be consistent with constraints.
Incomplete Database● An incomplete database is a theory K
– K consists of ground literals– Pos(K) ∩ Neg(K) = {}
● e.g., K = { p(a), q(a), ¬p(c), ¬q(b) }● Intuitively,
– Pos(K) gives the known true atoms– Neg(K) gives the known false atoms– The rest are unknown
● K ⊨d Q iff D⊨
dQ for all D Instances∈
d(K)
Eric Kao
Relaxations of a database● A relaxation of D w.r.t. Ω is an incomplete
database K, where ● Pos(K) ⊆ D ● Neg(K)∩D = ∅● K ⊭
d ¬Ω
● Let the set of relaxations of D w.r.t. to Ω be denoted Re
d(D,Ω)
Eric Kao
Example● D = {p(a),p(b)}● Ω = {¬p(a) ¬p(b)}∨
● d = {a,b,c}● Red(D,Ω) = {
{ p(a) , ¬p(c)}, {p(b) , ¬p(c)},{ p(a) }, {p(b)},{ p(c) }, { } }
Eric Kao
Answers with Consistent Support
● ACS: answers that are supported by a consistent relaxation of the database. [KG]
● D ⊨CSΩ Q(t) iff there exists
K ∈ Red(D,Ω) st K ⊨
d Q(t)
● Where d is the set of all objects mentioned in D,Q
Eric Kao
ACS
● p(a)? YES {p(a)}● p(b)? YES {p(b)}● p(a) p(b)? ∧ NO● p(a) p(b)? ∨ YES {p(a)}
p(a)
p(b)Conflict
Constraint:¬p(a) ∨ ¬p(b)
Eric Kao
More complex queries
● ∀x [q(x) → p(x,1)] ?● ACS: NO
pa 1b 1c 2d 3
qab
Constraint:∀xyz (¬p(x,z)∨¬p(y,z) x=y)∨
Eric Kao
Data Complexity● Both ACS and CQA are NP-Hard problems [KG]
[CM] ● Reduction from monotone 3-SAT
● ACS is tractable for * * queries∃ ∀ †. [KG]● CQA is tractable for
● ∀* queries† [KG]● Some subclasses of * queries∃ † [ABC, CM, FM]
† with suitable restrictions on the class of constraints
Eric Kao
Query rewriting● How can we use existing database
infrastructure to support these query semantics?
● Solution: Query rewriting● Algorithm ACS-Rewrite[Q,Ω]
Rewrite Q ( * *) into Q' so that evaluating Q' on a ∃ ∀standard DBMS gives ACS answers to Q. [KG]
● Similar rewriting algorithms have been devised for CQA [ABC, CM, FM, KG]
Eric Kao
ACS: Ground conjunctive queries● Q = p(a,1) p(a,2)∧
● C = { ¬p(a,1) ¬p(a,2) }∨
● Q contradicts C. ● Answer: NO● Rewrite:
Q' = False
Eric Kao
ACS: Ground conjunctive queries● Q = p(a,1) p(a,2)∧
● C = { x y z (¬p(x,y) ¬p(x,z) y = z) }∀ ∨ ∨
● Q contradicts C. ● Answer: NO● Rewrite:
Q' = False
Eric Kao
ACS: qf conjunctive queries● Q(x,y,z) = p(x,y) p(x,z)∧
● C = { x y z (¬p(x,y) ¬p(x,z) y = z) }∀ ∨ ∨
● Q(x,y,z) is consistent w.r.t. C if and only if y = z
● Rewrite: Q' = Q(x,y,z) (y = z)∧
Eric Kao
ACS: * queries∀
● Q = x,y (¬q(x,y) ¬r(x,y))∀ ∨
● C ={ q(a,b) }
● ¬q(x,y) ¬r(x,y)∨ q(a,b)
¬r(a,b)
● Rewrite:Q' = Q ¬r(a,b)∧
Eric Kao
ACS: * queries∀
● Q = x,y (¬q(x,y) ¬r(x,y))∀ ∨
● C ={ x q(x,x) }∀
● ¬q(x,y) ¬r(x,y)∨ q(x,x)
¬r(x,x)
● Rewrite:Q' = Q x ¬r(x,x)∧∀
Eric Kao
Summary● inconsistencies are unavoidable (In many
applications)● Classical logic is trivialized● Modify classical logic to tolerate inconsistencies● Two inconsistency-tolerance Logics in the
special case of databases● Answers that all min-change repairs agreed on● Answers supported by a consistent relaxation
General case● Ideas looked at in the database case also
useful in tolerating inconsistency in general deduction
● Anthony Hunter. “Paraconsistent Logics”Handbook of Defeasible Reasoning and Uncertainty Management Systems: Reasoning with actual and potential contradictions[link] (especially section 2.4 and 6)
Ongoing work● Identify other tractable classes● Recursive queries and aggregates● Other answer semantics
● preferentially-defeasible data?● coarser granularity?● Semantics that consider history?
Eric Kao
References
[ABC] M. Arenas, L. Bertossi, and J. Chomicki. Consistent query answers in inconsistent databases. Symposium on principles of database systems, Pages 68–79, 1999.[CM] J. Chomicki and J. Marcinkowski. Minimal-change integrity maintenance using tuple deletions. Inf. Comput.,197(1-2):90–121, 2005.[FM] A. Fuxman and R. J. Miller. First-order query rewriting for inconsistent databases. J. Comput. Syst. Sci., 73(4):610–635, 2007.[KG] E. Kao and M. Genesereth. Answers with consistent support – complexity and rewriting. Working paper, 2010.
Eric Kao
top related