1 2 Today Grammar for first-order logic . . . aka predicate calculus • Predicate calculus as a representation language Define terms by • Modal logic: beyond true and false ::= term constant | var | fn symbol ( term list ) ::= term list term | term , term list Alan Smaill KRI Jan 14 2008 Alan Smaill KRI Jan 14 2008 3 4 Formulas (= making a statement) Semantics We say what it is for a formula to be true under an interpretation in a structure. form ::= pred ( term list ) Write S for a structure together with an associated interpretation I . | ¬ form Given S , and a formula F , write S | = F for “ F is true in S ”. | form ∨ form For details, see Russell and Norvig, chapter 8, section 2. | form ∧ form | form → form | ∀ var form | ∃ var form Use precedence to disambiguate (or brackets). Alan Smaill KRI Jan 14 2008 Alan Smaill KRI Jan 14 2008
5 6 Quantifiers Logical Consequence Roughly, the idea is that for any statement Φ( v ) which talks about variable v : Our semantics gives us a notion of logical consequence as before. We say that a formula G is a logical consequence of formulae F 1 , F 2 . . . F n S | = ∀ v n (Φ( v n )) if and only if S | = Φ( v n ) (meaning that it follows logically) if and only if, for all structures with for all interpretations of v n interpretation S , if S | = F 1 and . . . and S | = F n , S | = ∃ v n (Φ( v n )) if and only if S | = Φ( v n ) then S | = G . for some interpretation of v n When this is true, we write F 1 , F 2 . . . F n | = G . Alan Smaill KRI Jan 14 2008 Alan Smaill KRI Jan 14 2008 7 8 Infinite choice points Special case A full set of rules for sequent calculus has rules for the quantifiers. Suppose that there are only finitely many constants, and no function symbols. A rule for ∃ is: The we need only look at finitely many possible terms t , so the branching is finite. . . . = ⇒ F ( t ) (Why is this? — given that there are still infinitely many variables.) . . . = ⇒ ∃ x F ( x ) where t can be any term. So here the branching is infinite. Here resolution gives us a hint — the choice of candidate terms that are worth investigating comes from unification with terms that are already in the formula. Alan Smaill KRI Jan 14 2008 Alan Smaill KRI Jan 14 2008
9 10 Modal logic An example Some arguments go easily from natural language to the predicate calculus. For example, may want to say that something is • possibly true All men are mortal. Fred is a man. Therefore, Fred is mortal. • known to be true This corresponds to a derivation in the predicate calculus of • believed to be true ∀ x man ( x ) → mortal ( x ) • . . . man ( fred ) A simple inference using this is ⊢ mortal ( fred ) Necessarily, Fred is mortal. Therefore, Fred is mortal. Other notions are not so easily expressed in terms of truth. Modal logic allows formulas to express different modes of assertion, beyond just true and false. How can we express this in a logic? First we try a non-modal approach. Alan Smaill KRI Jan 14 2008 Alan Smaill KRI Jan 14 2008 11 12 Using FOL? Semantics We could take first order logic, and add a new axiom ∀ x nec ( x ) → x Also, what about the meaning of the terms here? From this and modus ponens, it looks as though we can get from In mortal ( fred ) nec ( mortal ( fred )) objects of discourse are people ; in to nec ( . . . ) mortal ( fred ) BUT this clashes with our syntax: the two propositions have to be parsed as objects of discourse are propositions (maybe formulas ?). follows. fn cst pred So, though it is possible to build an inference system, it’s not clear what the � �� � ���� ���� nec ( mortal ( fred )) statements in the system mean . ( fred ) mortal � �� � ���� pred cst Alan Smaill KRI Jan 14 2008 Alan Smaill KRI Jan 14 2008
13 14 A First-Order Formulation Properties of First-Order version Extend the syntax by adding for every formula F a new constant � F � . Now, for • Add extra axioms to whatever we already have available. every formula G in the language add the axiom • Get a first-order theory, so we can use a standard inference engine. nec ( � G � ) → G • The syntax is complicated! For example, we get • Often we want to make use of the structure of a formula, even when it is nec ( � rich ( fred ) � ) → rich ( fred ) mentioned, and we cannot do this in the logic. This is OK for both the syntax, and the semantics; there are distinct bits of syntax for the use and the mention of a formula. Alan Smaill KRI Jan 14 2008 Alan Smaill KRI Jan 14 2008 15 16 Modal Logic An Inference System Instead of adding extra axioms, we add new logical connectives . We can give an axiom system by adding three axiom schemes: � ( A → B ) → ( � A → � B ) Ax 1 The standard connectives are � A → A Ax 2 � A → �� A Ax 3 � : it is necessary that and a new rule of inference (nec) ♦ : it is possible that if ⊢ A then ⊢ � A . We enlarge the syntax definition so that if F is a formula, then so is � F, ♦ F . We can also define ♦ in terms of � by Many different logics of necessity have been proposed. ♦ A ↔ ¬ � ¬ A — so ♦ A is just a shorhand way of writing ¬ � ¬ A . Alan Smaill KRI Jan 14 2008 Alan Smaill KRI Jan 14 2008
17 18 Derivation Necessity A derivation in modal logic is like one in the predicate calculus with appeal to Necessity may be understood in several ways. the new axioms and inference rules. For example, in a parallel or non-deterministic system, read � F as saying that F 1 p → ( q → p ) axiom is true in all branches/in all cases. 2 � ( p → ( q → p )) necessitation 1 Or in game playing, we can read � F as saying that F is true, whatever move is 3 � ( p → ( q → p )) → ( � p → � ( q → p )) made at this point in the game. axiomAx 1 4 � p → � ( q → p ) modus ponens 2 , 3 In the propositional case, this is decidable. Alan Smaill KRI Jan 14 2008 Alan Smaill KRI Jan 14 2008 19 20 Logic of Knowledge Notice that we don’t have a → known ( a ) Let’s take � F to mean “ F is known to be true”. How good is our original What about the necessitation rule: inference system for this reading? Are the axioms and inference rules if ⊢ a then ⊢ known ( a ) • plausible ? (sound) This means that all logical truths are known! • complete ? It’s hard to find a better formulation here, that allows use of logical inference In terms of being known, they say: from knowledge, without assuming that this must be exhaustive. known ( a ) → a Completeness? known ( a ) → known ( known ( a )) To suggest that the system is not complete, find an intuitively true statement known ( a → b ) → ( known ( a ) → known ( b )) . that is not derivable. Are these OK? Alan Smaill KRI Jan 14 2008 Alan Smaill KRI Jan 14 2008
21 22 Logics of Belief Possible axioms Assume that knowledge is true, justified belief . bel ( x, F ) → bel ( x, bel ( x, F )) We can build a logic by adding a two place modal connective bel such that is t is Note that we can model inconsistent beliefs in a consistent theory. a term and F a formula, then bel ( t, F ) is a formula (intuitively, it expresses that “ t believes that F ”). bel ( x, p → q ) → bel ( x, q → p ) Now we need appropriate axioms and inference rules. We can also express nested beliefs, eg bel ( x, bel ( y, ¬ bel ( x, F ))) Alan Smaill KRI Jan 14 2008 Alan Smaill KRI Jan 14 2008 23 24 Introspection Temporal logic Some rules that treat of reasoning about beliefs in a sequent calculus version are For thinking about agents, we will make some use of temporal logic . One as follows. approach is to add connectives: Forms = ⇒ bel ( X , F ) introspect Forms = ⇒ bel ( X , bel ( X , F )) � F � � F is always true belMP Forms = ⇒ bel ( X , F ) Forms = ⇒ bel ( X , F → G ) ♦ F ♦ ♦ F is eventually true Forms = ⇒ bel ( X , G ) � � � F F is true at the next time point = ⇒ G F U G F is true until G belLogic Forms = ⇒ bel ( X , G ) We need some rules for reasoning with these modalities. Alan Smaill KRI Jan 14 2008 Alan Smaill KRI Jan 14 2008
25 26 Temporal inference Temporal Logic ctd Here is an inference system for temporal logic, using the connectives above. Inference Rules Possible Axioms (schemes for any matching formulas) • Standard propositional inference � p → ♦ p What will always be, will be. � ( p → q ) → ( � p → � q ) If p always implies q, • Necessitation: then if p will always be the case, so will q. ♦ p → ♦♦ p If it will be the case that p, If there is a proof of p (from no assumptions), it will be the case that it will be. then we can derive a proof of � p ¬ ♦ p → ♦ ¬ ♦ p If it will never be that p, then it will be that it will never be that p. This is the most basic temporal logic; other machinery is necessary to deal with the other connectives, and issues of discrete vs dense time. Alan Smaill KRI Jan 14 2008 Alan Smaill KRI Jan 14 2008 27 Summary For reasoning about • necessity • knowledge • belief • . . . use • First-order logic with extra constants, or • Modal logic with new connectives Alan Smaill KRI Jan 14 2008
Recommend
More recommend