Propositional Logic
An intepretation is a function from the set of propositional symbols to
. Tautologies (valid formulae) are satisfied (i.e. evaluate to true) under all interpretations. A set of statements is consistent is some interpretation satisfies all its elements at the same time. Otherwise, it is inconsistent. Satisfiable means the same as consistent, and unsatisfiable means the same as inconsistent.
A set
of statements entails
if every interpretation that satisfies S also satisfies A. We write
.
A canonical form for formulae in the propositional logic is Ordered Binary Decision Diagrams.
Ordered Binary Decision Diagrams
Note: in exams always write OBDD not BDD. Also, expand primitive connectives too, e.g. write out P and Q and combine to make
Algorithm
- Start at a node in each tree. Traverse the tree.
- For identical nodes, map the require combining operator onto the subtrees.
- For non-identical nodes, stay on the later node and work down the earlier one, add it to the result.
- At leaf nodes, combine using the combining operator.
Official steps:
- Recursively convert A and A' into BDDs Z and Z'.
Check for trivial cases (equal, t, f).
- Let Z = x P y, Z' = x' P' y'
- If same variable, build BDD recursively for (x op x') P (y op y')
- If P less than P', build BDD recursively for (x op z') P (y op z')
- If P greater than P', build BDD recursively for (z op x') P (z op y')
Optimization
- We don't actually need subtree comparison -- leaf comparison will do. We can use pointer comparison.
- Use hash tables.
Use an equivalence symbol to denote re-writing of trees.
Construction
- Don't construct the entire tree.
- Don't eliminate
,
,
or other connectives. - Tree
as
or 
- Recursively convert operands.
- Combine with ordering and sharing.
- Remove redundant ones.
- Test in order.
- Each variable can over ever appear once.
Ordering
- A bad ordering can lead to exponential length diagram.
- If we have
, the Conjunctive Normal Form expression 
First order logic
Compared to Propositional Logic
Similar to propositional logic, but now instead of just
we have some 'things'. We have predicates which map from things to
and functions which map from 'things' to 'things'.
Definitions
Terms stand for individuals.
Formulae stand for truth values.
Variables
range over individuals.
A first-order language contains a set of
-place function symbols and
-place predicate symbols.
Constant symbols
are
-place function symbols. Intuitively, they are names for fixed elements of the universe. Two constants may have the same meaning. It is not required to have a constant for each element.
Predicate symbols are also called relation symbols.
The terms of a first-order language are defined recursively as follows:
- A variable is a term.
- A constant symbol is a term.
- If
are terms and
is an
-place function symbol then
is a term.
The formulae of a first-order language are defined recursively as follows:
- If
are terms and
is an
-place function symbol then
is a formula (called an atomic formula). - If
and
are formulae then
are also formulae. - If
is a variable and
is a formula then
and
are also formulae.
An interpretation of a language maps its function symbols to actual functions and its relation symbols to actual relations.
Let
be a first-order language. The interpretation
of
is a pair
,
being a non-empty set, the domain or universe.
- if
is a constant symbol (of
), then ![I[c] \in D](http://www.theonlineoasis.co.uk/../static/wikimath63.png)
- if
is an
-place function symbol then
. - if
is an
-place relation symbol then
.
A valuation
of
over
is a function from the variables of
into
. Write
for the value of
with respect to
and
, defined by:
is defined as
where
is a variable.
is defined as ![I[c]](http://www.theonlineoasis.co.uk/../static/wikimath72.png)
is defined as ](http://www.theonlineoasis.co.uk/../static/wikimath74.png)
Write
for the valuation that maps
to
and it otherwise the same as
.
Reducing first order logic to propositional logic
Prenex Normal Form
Assuming there are no
s in
, we have:
Skolemization
To reduce
(can have
):
Take the leftmost
, delete this and replace
in the expression with
.
Repeat until no more
remain.
Example:
Negated goal
NNF
Pull
out
Skolemize
Final clauses:
Herbrand seminatics
Terms
This represents the syntax of formulae. That is,
cannot be
.
Predicates
simply stands for the set of ground atoms
that we want to be true.
For example, the clauses
,
and
. For this, the Herbrand universe
.
.
We can only vary the meaning of predicates. Therefore we can make any system. For example, this system works for
stands for
, where we change the meaning of
.
If the universe of models has any model, it's a herbrand model.
Let
be the set of clauses.
unsatisfiable
no herbrand model satisfies
.