Post on 06-Feb-2021
EDAA40EDAA40Discrete Structures in Computer ScienceDiscrete Structures in Computer Science
8: Quantificational logic8: Quantificational logic
Jörn W. Janneck, Dept. of Computer Science, Lund University
2
logic with quantifiers (informally)
Given a logical formula that depends on a variable x :
represents “forall x, “
represents “there exists an x, such that ”
alt. notations
Examples:
SLAM, p. 218
“Forall” is universal quantification, “exists” is existential.
3
the language of quantificational logic
also 1-place!
terms
formulae
SLAM, p. 219
also other relationsymbols
4
more examples...
Zermelo-Fraenkel Set Theory w/Choice (ZFC)
extensionality
regularity
specification
union
replacement
infinity
power set
choice
5
equivalences: quantifier interchange
The following equivalences hold for any formula :
Remember de Morgan's laws?
Explain.
6
finite transformsSuppose we quantify all variables over a finite set D, and we have constantsymbols for each of its elements.
A finite transform of a universally/existentially quantified formula removesthe quantifier, and instantiates the body for each element of D in a chainedconjunction/disjunction.
Example:
Do this for the following formula, until all quantifiers are gone.Assume a domain with two values, with constant names a and b.
7
equivalences: distribution
The following equivalences hold for any formula :
This should be easy to see if you think aboutwhat this would look like in a finite transform.
8
quantifier scopes
Y
x
x
z
quantifier scopes, and the variables bound in/by them
variable uses, and the quantifier they are bound by
9
free and bound variable occurrences
A variable occurrence is bound iff it occurs inside the scope of a quantifierthat binds that variable.
It is free otherwise.
A formula with no free variable occurrences is called closed.A closed formula is a sentence.
free occurrences
bound occurrences
10
equivalences: vacuity, relettering
Vacuity: If x does not occur free in , then
Relettering: If x does not occur at all in , and is the result of replacing every bound occurrence of some variable y in with x, then
Example:
Can you think of a case where this is not true?
11
interpretationsThe value of a formula depends on how you read the symbols in it.
A domain or universe D is the set of values that quantified variables rangeover.
An interpretation v is a function assigning mathematical objects to the symbols occurring in a formula. Specifically... - to each constant a - to each variable x - to each n-place function letter f - to each n-place relation letter P - to the identity symbol the identity over D
Also, we need to determine what values the quantified variables can assume.
12
evaluating terms and formulaeGiven a domain D and an interpretation v, the value of a term t is definedas follows (reusing the v):
With this, we can determine the truth value (0 or 1) of a formula as follows:
We are “overloading” the name of the interpretation, like wedid for assignments and valuations in propositional logic.
13
method 1: substitution
Given a formula , a variable x, and a term t,
is the formula resulting from substituting every free occurrence of x inwith t.
Now we make two assumptions: (1) There are enough constant letters so each value in D can have its own constant letter. (2) The interpretation from the constant letters is onto D, i.e. every value in D is represented by (at least) one constant letter under v.
14
method 1: substitution
With this we can evaluate quantified formulae as follows:
It sounds a bit circular, but it does give an “algorithm” forcomputing the truth value of a quantified formula.
Also, larger domains require more constant letters.
15
method 2: x-variant
Given an interpretation v and a variable x, an x-variant of v (with value c) is another interpretation v' that agrees with v on all constants, function and predicate letters, and variables other than x, and that assigns x the value c.
To avoid having to tinker with the constant symbols, we can instead tinkerwith the interpretation.
With this we can evaluate quantified formulae as follows:
16
logical implication
Given a set of formulae and a formula , we say that A logically implies iff there is no interpretation v such that all the formulae in A are true under v, but is false:
Also:
logical equivalence
logical truth
contradiction
A formula that is neither logically true nor a contradiction iscontingent.
17
some implications
Why isn't this an equivalence?
18
clean substitution
Given a formula , a variable x, and a term t, a substitution
is clean iff no free occurrence of x is in the scope of a quantifier binding afree variable in t.
y
19
instantiation & generalizationThe following are general rules regarding quantifiers:
universal instantiation (UI)
universal generalization (UG)
existential generalization (EG)
existential instantiation (EI)
if substitution is clean
if substitution is clean
if x not free in
if x not free in
Example:
not vacuity, as xcould be free in !
EG involves “reverse substitution”
Why does UG / EI work?
20
replacementGiven a formula , and a term t, a occurrence of t in is free iff it is notin a scope that binds a variable in t.
free occurrences
non-free occurrences
A replacement of a term t by t' in a formula is the result of replacingfree occurrences of t in by t'.
It is clean if the t' replaced for t are also free.
21
principle of replacement
Principle of Replacement:
If the replacement is clean.
Example: