First we have Data
Then, we have Information - Refined and encapsulated form of data
Now, we have Knowledge - Refined and encapsulated form of Information
Knowledge Representation Methods
Production RulesSemantic nets
Inclusion Hierarchies
Mathematical Logic
Frames
Scripts
Semantic Networks
Constraints
Relational Databases
etc.
Consider the problem of a farmer who wants to cross a river in a boat. The farmer has a goat, some cabbage and a fox. The boat can carry, at a time, any two of the above three. How to cross the river?
Usually, the proper representation of the problem is more than half way to the solution.
Initial State
farmer goat cabbage fox |
Empty |
Final State
Empty |
farmer goat cabbage fox |
We can now create a bunch of tables, such as those above, each depicting the
various states in which we find ourselves and connect them with arrows
indicating state transitions. The resulting picture can be thought of as a
semantic net.
Mathematical Logic (ML)
Advantages of ML:
Ideas matured for centuries
Concise, Precise, and Universally Understood
Many proofs exist. So we know what can be done and what cannot be done
Disadvanatges
Dealing with the subject can force you to concentrate on the logic part, thus
deflecting attention from the problem.
ML based methods are OK to do
"low-level" representation, but are often inadequate to solve real life "high
level" problems.
What do we Learn Here?
1. More than one type of logic
- Propositional
logic
- Predicate logic
2. Notation used in logic
3. Rule of Inference
- Modus ponens
- Modus tolens
- Resolution
4. Proof techniques
- Proof by reputation
- Resolution theorem proving
5. Mind boggling terminology
A fact is something that is known to be true. Fact is always true.
An assertion is a statement that something is a fact. An assertion
can be false.
Rule: "if pattern(s) followed by "then pattern(s)"
Each if pattern is an antecedent. The then pattern is a consequent
In a deduction system, the if pattern and then pattern
are assertions.
In a reaction system, the then pattern is
normally an action(s)
Whenever all the antecedents are satisfied, the rule is triggered.
Propositional Logic
A proposition is a condition of the world about which we want to say something. For convenience, each proposition is given an atomic name.
Simple Sentences
"It is raining" becomes RAINING. Here, RAINING is a Simple Sentence.
Compound Sentences
~RAINING is "It is not raining"
RAINING|SNOWING is "It is either raining
or snowing"
RAINING => ~SUNNY menas "If it is raining then it is not
sunny"
Logical Connectives and their Precedence
NOT ~
CONJUNCTION &
DISJUNCTION |, V
IMPLICATION =>,
REVERSE <=, EQUIVALENCE <=>
Grammar:
You have to
be careful here. Each book may define and use its own rules of grammar. When you
are doing a homeworkassignment and such make sure that the rules of grammar you
are using are the sameas the rules the instructor is using. For example, the
rules listed here may not match with the rules listed in your text
book.
<upper> :: = A|...|Z
<lower> :: = a|...|z
<digit>
:: = 0|1|2|...|9
<logop> :: = ~|&| | | =>| <= | <=>
<punctuation> : : = ( | )
<logconnective> : : = & | |
<alphanum> : : = <lower> | <upper> | <digit>
<logconstant> : : = <lower><alphanum>
<sentence>
: : = <logconstant> | <logsent>
<logsent> : : =
<negation> |
<conjunction>|<disjunction>|<implication>|<reverse>|<equivalence>
<negation> : : = ~<sentence>
<conjunction> : : =
(<sentence> & ... & <sentence>)
etc.
Interpretation
A logical constatnt can assume two possible values, namely T and F
A
propositional language with n logical constants has 2**n
interpretations.
Truth Tables
Truth tables for negation, conjunction and disjunction are straightforward, and are not discussed here.
Truth Table for Implication is very important and you must thorougly understand this. We will use this relation very often.
A = > B
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
That is, A => B = ~AVB. This is very useful in proofs.
Satisfaction.
An interpretation i satisfies a sentence s (written |= i s) if and only if i(s) = True.
Example: Consider the interpretation i defined as follows.
i(p) = T
i(q) = F
i (r) = T
This interpretation satisfies the sentence
(p | q) & (~q | r)
because
(T | F) & (~F | T) = T
Validities
Double negation:
p < = > ~~p
deMorgan's Laws:
~(p & q) < = > (~p | ~q)
~(p | q) < = > (~p & ~q)
Implication Definition:
(p = > q) < = > (~p | q)
Implication
Distribution:
(p = > (q = >r) ) = > ( (p =
>q) = > (q = > r) )
Tautological Entailment
Predicate Logic
Consider
If the animal has feathers
then it is a bird
But how do you capture the idea that something has feathers or something is a bird?
We use predicates.
Predicates are functions that map object arguments into TRUE or FALSE
To say, "Albatross has feathers" we can use the predicate "Feathers" and write
Feathers (Albatross)
To say, an albatross is a bird, we say
Bird (Albatross)
That is,
Feathers(Albatross) and Bird (Albatross) are TRUE expressions.
That is, Albatross is something for which the predicate Feathers is satisfied.
Consider
~Feathers(suzie).
Suzie is something for which the predicate Feathers is NOT satisfied.
Similarly
Flies(squiggs) & Layseggs(squiggs)
Flies(squiggs) V Layseggs(squiggs)
Let us look at Implication.
Feathers(suzie) => Bird (suzie)
Suppose we say that the above expression is TRUE. By doing this we are constraining what Suzie can denote.
possibility 1. Both Feathers(suzie) and Bird (suzie) are TRUE
possibility 2. Both Feathers(suzie) and Bird (suzie) are FALSE
possibility 3. Feathers(suzie) is FALSE, yet Bird (suzie) is TRUE. In this case, the implication is TRUE
If Feathers(suzie) is TRUE and Bird (suzie) is FALSE, then the expression Feathers(suzie) => Bird (suzie) is FALSE
This is captured in the truth table below.
TRUTH Tables
The implication A = > is ....
B True | B False | |
A True | True | False |
A False | True | True |
Another way of looking at this is to write this as
A = > B is the same as ~A V B
The truth tables for conjunction, disjunction and negation are straightforward.
The logical connectives obey the commutative, distributive and associative
laws.
They also obey DeMogran's laws
~(A&B) <=> (~A) V (~B)
~(AVB) <=> (~A) & (~B)
Two negations annihilate each other.
~(~A) <=> A
Quantifiers
Upside down of A = universal quantifier
Backwards of E =
existential quantifier
Ax = for all x
Ex = there exists an x, that is there is at least one x
Read the expression
Ax[Feathers(x) => Bird(x)]
Any object which has feathers is a bird.
For all x, if x has feathers, it
implies x isa bird.
The [ ] defines the scope of the quantifier.
A logical expression can be true or false.For example, we can assert that
Ax[Feathers(x) => Bird(x)]
is TRUE.Then,
Feathers(squigs) => Bird (squigs) is also TRUE
Some Definitions
objects: This is what the world is comprised of.
Terms:
These objects are terms
Variables ranging over the objects are also terms
Functions are also terms. The arguments to functions are terms. Values returned are terms.
Terms are the only things that can appear as arguments to predicates.
Atomic Formulas are infividual predicates along with their arguments.
Literals are atomic formulas and negated atomic formulas
Well formed formulas:
Literals are wffs
wffs connectedby
~, V, &, and => are wffs.
wffs surrounded by
quantifiers are wffs.
Sentence: A wff in which all variables, if any, are inside the scope of the scope of the corresponding quantifiers is a sentence.
Bound: Variables which appear within the scope of a quantifier are said to be bound. Otherwise, they are free.
The following
Ax[Feathres(x) V ~Feathers(y)]
is not a sentence because the variable y is not bound.
The word expression and wff are often used interchangeably.
Variables can represent objects only; they cannot represent predicates in
first order predicate calculus.
Rules of Inference:
1. Modus ponens
A => B
A
--------------
Then B
logically follows
Suppose there is an axiom A => B and another axiom A, then B logically follows.
Example: Suppose we are told that both of the following expressions are true.
Feathers(Squigs)
Ax [Feathers(x) => Bird(x)]
are true. We are asked to show that all interpretations that make the axioms true also make the following expression true.
Bird(squigs)
Solution: The problem statement is not in the form suitable for Modus
Ponens. First convert this into that form.
Because we are dealing
with interpretations for which Feathers(x) => Bird (x) is true for all x, it
must be true for x=squigs.
Therefore,
Feathers(squigs)
=> Bird (squigs)
Feathers(squigs), given
________________________
Bird(squigs)
QED
2. Resolution.
Axiom 1. A V B
Axiom 2. ~B V C
Then A V C
logically follows. The expression A V C is called the resolvent.
How is this possible? Suppose B is true. Then ~B is false. Then, from the second expression, C must be true. Then A V C is true.
For this to work, you can have any number of disjuncts. The only demand is that one resolving expression must contain a disjunct that is a negation of a disjunct in the other expression.
Let us apply resolution to the squigs problem. Let us rewrite the
Feathers(squigs) => Bird (squigs) as ~Feathers(squigs) V Bird (squigs)
We also know
Feathers(squigs)
Put these twoi things together;
Feathers(squigs)
~Feathers(squigs) V Bird (squigs)
Dropping the two contradicting items, leaves us with Birds(squigs). QED
So any thing that can be concluded from Modus Ponens can aslo be concluded from Resolution.
3. Modus Tolens
A => B
~B
____________
~A
Resolution Proof Technique by Refutation
Step. 1. Assume that the negation of the theorem is true.
Step 2. Show that the given axioms and the assumed ne
gation
force an expression that cannot be true