Today Grammar for first-order logic . . . aka predicate calculus - - PowerPoint PPT Presentation

today grammar for first order logic
SMART_READER_LITE
LIVE PREVIEW

Today Grammar for first-order logic . . . aka predicate calculus - - PowerPoint PPT Presentation

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


slide-1
SLIDE 1

1

Today

  • Predicate calculus as a representation language
  • Modal logic: beyond true and false

Alan Smaill KRI Jan 14 2008 2

Grammar for first-order logic

. . . aka predicate calculus Define terms by term ::= constant | var | fn symbol ( term list ) term list ::= term | term , term list

Alan Smaill KRI Jan 14 2008 3

Formulas (= making a statement)

form ::= pred ( term list ) | ¬ form | form ∨ form | form ∧ form | form → form | ∀ var form | ∃ var form Use precedence to disambiguate (or brackets).

Alan Smaill KRI Jan 14 2008 4

Semantics

We say what it is for a formula to be true under an interpretation in a structure. Write S for a structure together with an associated interpretation I. Given S, and a formula F , write S | = F for “F is true in S”. For details, see Russell and Norvig, chapter 8, section 2.

Alan Smaill KRI Jan 14 2008

slide-2
SLIDE 2

5

Quantifiers

Roughly, the idea is that for any statement Φ(v) which talks about variable v: S | = ∀vn (Φ(vn)) if and only if S | = Φ(vn) for all interpretations of vn S | = ∃vn (Φ(vn)) if and only if S | = Φ(vn) for some interpretation of vn

Alan Smaill KRI Jan 14 2008 6

Logical Consequence

Our semantics gives us a notion of logical consequence as before. We say that a formula G is a logical consequence of formulae F1, F2 . . . Fn (meaning that it follows logically) if and only if, for all structures with interpretation S, if S | = F1 and . . . and S | = Fn, then S | = G. When this is true, we write F1, F2 . . . Fn | = G.

Alan Smaill KRI Jan 14 2008 7

Infinite choice points

A full set of rules for sequent calculus has rules for the quantifiers. A rule for ∃ is: . . . = ⇒ F(t) . . . = ⇒ ∃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 8

Special case

Suppose that there are only finitely many constants, and no function symbols. The we need only look at finitely many possible terms t, so the branching is finite. (Why is this? — given that there are still infinitely many variables.)

Alan Smaill KRI Jan 14 2008

slide-3
SLIDE 3

9

Modal logic

Some arguments go easily from natural language to the predicate calculus. All men are mortal. Fred is a man. Therefore, Fred is mortal. This corresponds to a derivation in the predicate calculus of ∀x man(x) → mortal(x) man(fred) ⊢ mortal(fred) 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.

Alan Smaill KRI Jan 14 2008 10

An example

For example, may want to say that something is

  • possibly true
  • known to be true
  • believed to be true
  • . . .

A simple inference using this is Necessarily, Fred is mortal. Therefore, Fred is mortal. How can we express this in a logic? First we try a non-modal approach.

Alan Smaill KRI Jan 14 2008 11

Using FOL?

We could take first order logic, and add a new axiom ∀x nec(x) → x From this and modus ponens, it looks as though we can get from nec(mortal(fred)) to mortal(fred) BUT this clashes with our syntax: the two propositions have to be parsed as follows. pred

  • nec (

fn mortal( cst

  • fred))

mortal pred (fred

  • cst

)

Alan Smaill KRI Jan 14 2008 12

Semantics

Also, what about the meaning of the terms here? In mortal(fred)

  • bjects of discourse are people; in

nec(. . .)

  • bjects of discourse are propositions (maybe formulas?).

So, though it is possible to build an inference system, it’s not clear what the statements in the system mean.

Alan Smaill KRI Jan 14 2008

slide-4
SLIDE 4

13

A First-Order Formulation

Extend the syntax by adding for every formula F a new constant F. Now, for every formula G in the language add the axiom nec(G) → G For example, we get nec(rich(fred)) → rich(fred) 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 14

Properties of First-Order version

  • Add extra axioms to whatever we already have available.
  • Get a first-order theory, so we can use a standard inference engine.
  • The syntax is complicated!
  • Often we want to make use of the structure of a formula, even when it is

mentioned, and we cannot do this in the logic.

Alan Smaill KRI Jan 14 2008 15

Modal Logic

Instead of adding extra axioms, we add new logical connectives. The standard connectives are

  • :

it is necessary that ♦ : it is possible that We enlarge the syntax definition so that if F is a formula, then so is F, ♦F. Many different logics of necessity have been proposed.

Alan Smaill KRI Jan 14 2008 16

An Inference System

We can give an axiom system by adding three axiom schemes: (A → B) → (A → B) Ax1 A → A Ax2 A → A Ax3 and a new rule of inference (nec) if ⊢ A then ⊢ A. We can also define ♦ in terms of by ♦A ↔ ¬¬A — so ♦A is just a shorhand way of writing ¬¬A.

Alan Smaill KRI Jan 14 2008

slide-5
SLIDE 5

17

Derivation

A derivation in modal logic is like one in the predicate calculus with appeal to the new axioms and inference rules.

1 p → (q → p) axiom 2 (p → (q → p)) necessitation 1 3 (p → (q → p)) → (p → (q → p)) axiomAx1 4 p → (q → p) modus ponens 2, 3

In the propositional case, this is decidable.

Alan Smaill KRI Jan 14 2008 18

Necessity

Necessity may be understood in several ways. For example, in a parallel or non-deterministic system, read F as saying that F is true in all branches/in all cases. Or in game playing, we can read F as saying that F is true, whatever move is made at this point in the game.

Alan Smaill KRI Jan 14 2008 19

Logic of Knowledge

Let’s take F to mean “F is known to be true”. How good is our original inference system for this reading? Are the axioms and inference rules

  • plausible? (sound)
  • complete?

In terms of being known, they say: known(a) → a known(a) → known(known(a)) known(a → b) → (known(a) → known(b)). Are these OK?

Alan Smaill KRI Jan 14 2008 20

Notice that we don’t have a → known(a) What about the necessitation rule: if ⊢ a then ⊢ known(a) This means that all logical truths are known! It’s hard to find a better formulation here, that allows use of logical inference from knowledge, without assuming that this must be exhaustive. Completeness? To suggest that the system is not complete, find an intuitively true statement that is not derivable.

Alan Smaill KRI Jan 14 2008

slide-6
SLIDE 6

21

Logics of Belief

Assume that knowledge is true, justified belief. We can build a logic by adding a two place modal connective bel such that is t is a term and F a formula, then bel(t, F) is a formula (intuitively, it expresses that “t believes that F”). Now we need appropriate axioms and inference rules.

Alan Smaill KRI Jan 14 2008 22

Possible axioms

bel(x, F) → bel(x, bel(x, F)) Note that we can model inconsistent beliefs in a consistent theory. bel(x, p → q) → bel(x, q → p) We can also express nested beliefs, eg bel(x, bel(y, ¬bel(x, F)))

Alan Smaill KRI Jan 14 2008 23

Introspection

Some rules that treat of reasoning about beliefs in a sequent calculus version are as follows.

introspect Forms = ⇒ bel(X, F) Forms = ⇒ bel(X, bel(X, F)) belMP Forms = ⇒ bel(X, F) Forms = ⇒ bel(X, F → G) Forms = ⇒ bel(X, G) belLogic = ⇒ G Forms = ⇒ bel(X, G)

Alan Smaill KRI Jan 14 2008 24

Temporal logic

For thinking about agents, we will make some use of temporal logic. One approach is to add connectives:

  • F

F is always true ♦ ♦ ♦F F is eventually true

  • F

F is true at the next time point F U G F is true until G We need some rules for reasoning with these modalities.

Alan Smaill KRI Jan 14 2008

slide-7
SLIDE 7

25

Temporal inference

Here is an inference system for temporal logic, using the connectives above. Possible Axioms (schemes for any matching formulas) p → ♦p What will always be, will be. (p → q) → (p → q) If p always implies q, then if p will always be the case, so will q. ♦p → ♦♦p If it will be the case that p, it will be the case that it will be. ¬♦p → ♦¬♦p If it will never be that p, then it will be that it will never be that p.

Alan Smaill KRI Jan 14 2008 26

Temporal Logic ctd

Inference Rules

  • Standard propositional inference
  • Necessitation:

If there is a proof of p (from no assumptions), then we can derive a proof of 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 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