Weak Completion Semantics International Center for Computational Logic Technische Universität Dresden Germany Some Human Reasoning Tasks Logic Programs Non-Monotonicity Łukasiewicz Logic Least Models Weak Completion Semantics Abduction Weak Completion Semantics 1
Human Reasoning Two Examples Instructions on boarding card distributed at Amsterdam Schiphol Airport If it s thirty minutes before your flight departure, make your way to the gate As soon as the gate number is confirmed, make your way to the gate Notice in London Underground If there is an emergency then you press the alarm signal bottom The driver will stop if any part of the train is in a station Observations Intended meaning differs from literal meaning Rigid adherence to classical logic is no help in modeling the examples There seems to be a reasoning process towards more plausible meanings The driver will stop the train in a station if the driver is alerted to an emergency and any part of the train is in the station Kowalski: Computational Logic and Human Life: How to be Artificially Intelligent. Cambridge University Press 2011 Weak Completion Semantics 2
The Suppression Task Byrne: Suppressing Valid Inferences with Conditionals Cognition 31, 61-83: 1989 If she has an essay to write then she will study late in the library She has an essay to write Will she study late in the library? yes no I don t know 96% conlude that she will study late in the library; modus ponens If she has an essay to write then she will study late in the library She has an essay to write If she has a textbook to read she will study late in the library 96% conlude that she will study late in the library; alternative arguments If she has an essay to write then she will study late in the library She has an essay to write If the library stays open she will study late in the library 38% conlude that she will study late in the library. Additional arguments lead to suppression of earlier (correct) conclusions Weak Completion Semantics 3
Reasoning Towards an Appropriate Logical Form Context independent rules If she has an essay to write and the library is open then she will study late in the library If the library is open and she has a reason for studying in the library then she will study late in the library Context dependent rule plus exception If she has an essay to write then she will study late in the library However, if the library is not open, then she will not study late in the library The last sentence is the contrapositive of the converse of the original sentence! Weak Completion Semantics 4
The Suppression Task The Search for Models Can we find a logic which adequately models these human reasoning tasks? How about classical two-valued propositional logic? Let s consider a direct encoding of conditionals by implications {l e, e} {l e, e, l t} {l e, e, l o} Weak Completion Semantics 5
The Suppression Task A Classical Logic Approach Let F and P be a formula and a set of formulas, respectively A model for F is an assignment of truth values to the atoms occurring in F such that F is mapped to true; the notion extends to P P entails F (P = F ) iff each model for P is a model for F Recall the examples {l e, e} = l modus ponens {l e, e, l t} = l classical logic is monotonic {l e, e, l o} = l upps, only 38% of subjects did this Conclusion classical logic is inadequate Often mistakenly generalized to logic is inadequate Weak Completion Semantics 6
Human Reasoning A Computational Logic Approach Can we find a logic which adequately models human reasoning tasks? Approach Reasoning towards an appropriate logical form Logic programs Weak completion semantics Non-monotonicity Three-valued Łukasiewicz logic Least models An appropriate semantic operator Least fixed points are least models Least fixed points can be computed by iterating the operator Reasoning with respect to the least models Abduction Weak Completion Semantics 7
Logic Programs Preliminaries An atom is an atomic propositions A literal is either an atom or its negation and denote truth and falsehood, respectively A (logic) program is a finite set of rules A rule is of the form A, A, or A B 1 B n where n 1, A is an atom, and each B i, 1 i n, is a literal A is called head,, and B 1 B n are called bodies Rules of the form A are called positive facts Rules of the form A are called negative facts The language underlying a program P shall contain precisely the relation symbols occurring in P, and no others Weak Completion Semantics 8
Completion Let P be a program and consider the following transformation 1 All rules with the same head A Body 1, A Body 2,... are replaced by A Body 1 Body 2... 2 If an atom A is not the head of any rule in P then add A 3 All occurrences of are replaced by The resulting set is called completion of P or cp If step 2 is omitted then the resulting set is called weak completion of P or wcp Weak Completion Semantics 9
Completion Example 1 P = {l e, e } cp = wcp = {l e, e } The models of P, cp and wcp {e, l} {e} {l} Hence, P = l, cp = l, and wcp = l Weak Completion Semantics 10
Completion Example 2 P = {l e, e } wcp = cp = {l e, e } The models of cp and wcp {e, l} {e} {l} Hence, cp = l and wcp = l But, P = l Weak Completion Semantics 11
Completion Example 3 P = {l e, e, l t} cp = {l e t, e, t } wcp = {l e t, e } {e, l} is the only model of cp {e, l} and {e, l, t} are the models of wcp cp = t wcp = t wcp = t Weak Completion Semantics 12
Monotonicity Let P and P be sets of formulas and G a formula A logic is monotonic if the following holds If P = G then P P = G Classical logic is monotonic A logic based on completion semantics is non-monotonic Consider Then P = {l e, e, l t} P = P {t } cp = {l e t, e, t } = t cp = {l e t, e, t } = t Weak Completion Semantics 13
Łukasiewicz (Ł) Logic Łukasiewicz: O logice trójwartościowej. Ruch Filozoficzny 5, 169-171: 1920 English translation: On Three-Valued Logic. In: Jan Łukasiewicz Selected Works. (L. Borkowski, ed.), North Holland, 87-88, 1990 U U U U U U U U U U U U U U U U U U U U U U Weak Completion Semantics 14
Three-Valued Interpretations and Models A (three-valued) interpretation assigns to each formula a value from {,, U} It is represented by I, I where I contains all atoms which are mapped to I contains all atoms which are mapped to I I = All atoms which occur neither in I nor I are mapped to U An interpretation I = I, I is a model for a program P under Ł-logic (I = 3Ł P) if each rule occurring in P is mapped to by I under Ł-logic Let I = I, I and J = J, J be two interpretations Their intersection I J is defined as I J, I I Weak Completion Semantics 15
Three-Valued Interpretations and Models Examples P = {l e ab, ab, e } wcp = {l e ab, ab, e } {e, ab}, = 3Ł P {e, ab}, = 3Ł wcp {e, l}, {ab} = 3Ł wcp Weak Completion Semantics 16
Three-Valued Interpretations and Models Semi-lattices Fitting: A Kripke-Kleene Semantics for Logic Programs Journal of Logic Programming 2, 295-312: 1985 Let I denote the set of all three-valued interpretations (I, ) is a complete semi-lattice Example Consider {p q} {p, q}, {p}, {q} {q}, {p}, {p, q} {p}, {q},, {q}, {p}, Weak Completion Semantics 17
Programs under Ł-Logic H., Kencana Ramli: Logic Programs under Three-Valued Łukasiewicz s Semantics In: Logic Programming. Hill, Warren (eds), LNCS 5649, 464-478: 2009 Proposition 1 If I, I = 3Ł P then I, = 3Ł P Example Consider P = {p q r} {p, q}, {r} is a model for P and so is {p, q}, {p, r}, {q} is a model for P and so is {p, r}, {r}, {q} is a model for P and so is {r}, {p}, = {p, q}, {p, r}, is a model for P Proposition 2 If I1, = 3Ł P and I2, = 3Ł P then I1 I 2, = 3Ł P Theorem 3 The model intersection property holds for P i.e. {I I = 3Ł P} = 3Ł P Weak Completion Semantics 18
Least Models Example Example Consider {p q} {p, q}, {p}, {q} {q}, {p}, {p, q} {p}, {q},, {q}, {p}, Weak Completion Semantics 19
Weakly Completed Programs under Ł-Logic Theorem 4 Theorem 5 The model intersection property holds for wcp as well If I = 3Ł wcp then I = 3Ł P How can the least model of wcp be computed? Weak Completion Semantics 20
Computing the Least Models of Weakly Completed Programs Stenning, van Lambalgen: Human Reasoning and Cognititve Science MIT Press: 2008 Consider the following immediate consequence operator Φ P (I) = J, J, where J = {A there exists A Body P with I(Body) = } J = {A there exists A Body P and for all A Body P we find I(Body) = } Note Φ P without the red condition is the Fitting operator Theorem 6 (H., Kencana Ramli 2009) (1) Φ P is monotone on (I, ) (2) Φ P is continuous and, hence, admits a least fixed point denoted by lfp Φ P (3) lfp Φ P can be computed by iterating Φ P on, (4) lfp Φ P is the least model of wcp Weak Completion Semantics 21
Computing Least Fixed Points Examples P = {l e ab, ab, e } wcp = {l e ab, ab, e } Φ P (, ) = {e}, {ab} Φ P ( {e}, {ab} ) = {e, l}, {ab} = lfp Φ P P = {l e ab 1, ab 1 o, l o ab 2, ab 2 e, e } wcp = {l (e ab 1 ) (o ab 2 ), Φ P (, ) =, {e} ab 1 o, ab 2 e, e } Φ P (, {e} ) = {ab 2 }, {e} Φ P ( {ab 2 }, {e} ) = {ab 2 }, {e, l} = lfp Φ P Weak Completion Semantics 22
Weak Completion Semantics Let P be a logic program, F a formula, and A an atom Let M P denote the least Ł-model of wcp P = WCS F iff M P (F ) = def (A, P) = {A Body A Body P} Example Let P = {l e ab 1, ab 1, l t ab 2, ab 2 } def (l, P) = {l e ab 1, l t ab 2 } def (t, P) = = def (e, P) Weak Completion Semantics 23
Abduction Consider the abductive framework P, A P, IC, = WCS, where A P = {A def (A, P) = } {A def (A, P) = } is the set of abducibles IC is a finite set of integrity constraints, i.e., expressions of the form U B 1... B n An observation O is a set of ground literals O is explainable in P, A P, IC, = WCS iff there exists a minimal E A P called explanation such that M P E satisfies IC and P E = WCS L for each L O F follows creduluously from P and O iff there exists an explanantion E such that P E = WCS F F follows skeptically from P and O iff for all explanantions E we find P E = WCS F Weak Completion Semantics 24
Abduction Example Let P = {l e ab 1, ab 1, l t ab 2, ab 2 } A P = {e, e, t, t } Let O = {l} Two minimal explanations {e } and {t } Reasoning credulously we conclude e Reasoning skeptically we cannot conclude e H., Philipp, Wernhard: An Abductive Model for Human Reasoning In: Proceedings of the 10th International Symposium on Logical Formalizations of Commonsense Reasoning (CommonSense): 2011 Dietz, H., Ragni: A Computational Logic Approach to the Suppression Task In: Proceedings of the 34th Annual Conference of the Cognitive Science Society, Miyake et.al. (eds.), 1500-1505: 2012 Weak Completion Semantics 25