Logic for Computer Scientists/Predicate Logic/Semantics

From testwiki
Jump to navigation Jump to search

Semantics

Definition 4 (Semantics of predicate logic - Interpretation)

An interpretation is a pair =(U,A), where

  • U is an arbitrary nonempty set, called domain, or universe.
  • A is a mapping which associates to
    • a k-ary predicate symbol, a k-ary predicate over U,
    • a k-ary function symbol, a k-ary function over U, and
    • a variable an element from the domain.

Let F be a formula and =(U,A) be an interpretation. We call an interpretation for F, if 𝒜 is defined for every predicate and function symbol, and for every variable, that occurs free in F .


Example: Let F=xp(x,f(x))q(g(a,z)) and assume the varieties of the symbols as written down. In the following we give two interpretations for F:

  • 1=(N0,A1), such that
    • A1(p)={(m,n)m,nN0 and m<n}
    • A1(q)={nN0n is prime}
    • A1(f)(n)=n+1nN0
    • A1(g)(m,n)=m+nn,mN0
    • A1(a)=2
    • A1(z)=3
    Under this interpretation the formula F can be read as " Every natural number is smaller than its successor and the sum of 2 and 3 is a prime number."
  • 2=(U2,A2), such that
    • U2={a,f(a),g(a,a),f(g(a,a)),g(f(a),f(a)),}
    • A2(f)(t)=f(t) for tU2
    • A2(g)(t1,t2)=g(t1,t2), if t1,t2U2
    • A2(a)=a
    • A2(z)=f(f(a))
    • A2(p)={p(a,a),p(f(a),f(a)),p(f(f(a)),f(f(a)))}
    • A2(q)={g(t1,t2)t1,t2U2}


For a given interpretation =(U,A) we write in the following p instead of A(p); the same abbreviation will be used for the assignments for function symbols and variables.

Definition 5 (Semantics of predicate logic - Evaluation of Formulae)

Let F be a formula and an interpretation for F. For terms t which can be composed with symbols from F the value (t) is given by

  • (x)=x
  • (f(t1,,tk))=f((t1),,(tk)), if t1,,tk are terms and f a k-ary function symbol. (This holds for the case k=0 as well.)

The value (F) of a formula F is given by

  • (p(t1,,tk))={true if ((t1),,(tk))pfalseotherwise


  • (FG))={true if (F)=trueand(G)=truefalseotherwise
  • ((FG))={true if (F)=trueor(G)=truefalseotherwise
  • (¬F)={true if (F)=falsefalseotherwise
  • (G)={true if for every dU:[x/d](G)=truefalseotherwise
  • (G)={true if there is a dU:[x/d](G)=truefalseotherwise

where, f[x/d](y)={f(y) if xydotherwise


The notions of satisfiable, valid, and are defined according to the propositional case (Semantic (Propositional logic)).


Note that, predicate calculus is an extension of propositional calculus: Assume only 0-ary predicate symbols and a formula which contains no variable, i.e. there can be no terms and no quantifier in a well-formed formula.

On the other hand, predicate calculus can be extended: If one allows for quantifications over predicate and function symbols, we arrive at a second order predicate calculus. E.g.

pfp(f(x))

Another example for a second order formula of is the induction principle from Induction.

Problems

Problem 1 (Predicate)

The interpretation = is given (U,A) as follows:

U=
p=(m,n)m<n
f(m,n)=m+n
x=5;y=7

Determine the value of following terms and formulae:

  1. (f(f(x,x),y))
  2. (xy(p(x,y)p(y,x))
  3. (p(x,x)p(y,x))
  4. (xp(y,x))

Problem 2 (Predicate)

The interpretation = is given (U,A) as follows:

U=

P=zz0
f(z)=z2
x=2
E=(x,y)x=y
g(x,y)=x+y

y=1

Determine the value of following terms and formulae:

1.(g(f(x),f(y)))
2.(xP(f(x)))
3.(zxyE(g(x,y),z))
4.(y(E(f(x),y)P(g(x,y))))


Problem 3 (Predicate)

The following formula is given:

F=xyzR(h(h(x,y),z),h(x,h(y,z)))  xy¬R(h(x,y),h(y,x))

Indicate a structure 𝒜, which is a model for F and a structure which is no model for F!

Template:BookCat