Logic and artificial intelligence Nils J. Nilsson
Logic and artificial intelligence Nils J. Nilsson
Logic and artificial intelligence Nils J. Nilsson
Transform your PDFs into Flipbooks and boost your revenue!
Leverage SEO-optimized Flipbooks, powerful backlinks, and multimedia content to professionally showcase your products and significantly increase your reach.
<strong>Logic</strong> <strong>and</strong> <strong>artificial</strong><br />
<strong>intelligence</strong><br />
<strong>Nils</strong> J. <strong>Nils</strong>son<br />
Presented by<br />
Ida Sofie Gebhardt Stenerud<br />
Ida Kokkersvold<br />
<strong>Logic</strong>al approach<br />
In the future: successful AI systems<br />
will be a combination of methods<br />
Important to underst<strong>and</strong> the different<br />
approaches<br />
This article: the logical approach to AI<br />
The article contains 4 main<br />
topics<br />
<strong>Logic</strong>al approach is based<br />
on three theses<br />
Relate to three theses about the role of<br />
knowledge in intelligent systems<br />
Theoretical foundation<br />
Important observations<br />
Challenging problems for AI <strong>and</strong> attempts to<br />
solve them<br />
<br />
<br />
<br />
Thesis 1 - Intelligent machines will have a knowledge<br />
of their environment<br />
Thesis 2 - The most versatile intelligent machines will<br />
represent much of their knowledge about their<br />
environment declaratively<br />
Thesis 3 - For the most versatile machines, the<br />
language in which declarative knowledge is<br />
represented must be at least as expressive as firstorder<br />
predicate calculus
Thesis 2<br />
Thesis 3<br />
<br />
<br />
<br />
Declarative knowledge: stored explicitly in form of<br />
sentences in some language<br />
The declarative knowledge <strong>and</strong> the component that<br />
perform reasoning process is separate<br />
Easier to modify<br />
Natural language too ambiguous: depends<br />
too much on the context<br />
Many languages has limited expressive<br />
power<br />
<br />
<br />
Can be true in wider context than specific programs<br />
The declarative knowledge must be context free<br />
First-order predicate does have these<br />
limitations <strong>and</strong> meet the minimal<br />
representational requirements<br />
With first-order predicate<br />
you are able to<br />
Meaning of sentences<br />
<br />
<br />
<br />
<br />
say that one of two facts are true: disjunction<br />
say that something is not true: negations<br />
say that all the members of a class has a property<br />
without explicitly listing them: universally quantifier<br />
say that some of the member of a class has a property<br />
without listing which one: existentially quantifier<br />
The designer have to say something<br />
about the meaning of the sentences<br />
for the machine to be able to believe<br />
something<br />
(∀x) Bird(x) Fly(x)<br />
(∀x) Fgkg(x) Dfk(x)
Model of how the machine<br />
interacts with the real world<br />
<strong>Logic</strong>al approach <strong>and</strong><br />
functions<br />
The state of the machines are sentences<br />
<br />
<br />
M’ <strong>and</strong> W’ is a set of states<br />
S’ is a set of inputs <strong>and</strong> A’ is a set of outputs<br />
See: maps W’ into S’<br />
Mem: maps S’ x M’ into M’<br />
Act: maps S’ x M’ into A’<br />
Effect: maps A’ x W’ into W’<br />
Mem transforms the sentences into another<br />
set of sentences<br />
Mem(previous machine state + machine<br />
input) = new machine state<br />
Act is a function of sentences that produces<br />
the machine’s actions<br />
Act(previous machine state + machine<br />
input) = machine actions<br />
<strong>Logic</strong>al approach <strong>and</strong><br />
functions<br />
Effect(actions of machine + old world<br />
state ) = new world state<br />
Conceptualization<br />
Suppose the designer think of the world a a<br />
finite-state machine consisting of objects,<br />
functions <strong>and</strong> relations<br />
The designer have to guess what the<br />
world’s objects, functions <strong>and</strong> relations are<br />
Conceptualization describes this guess
Conceptualization<br />
<strong>Logic</strong> <strong>and</strong> conceptualization<br />
The designer need only to invent a<br />
conceptualization that is good enough<br />
The world is invented: can invent any<br />
thing that makes the machine work<br />
<br />
<br />
<br />
<br />
Conceptualization described as a set of sentences<br />
World object: create an object constant<br />
World relation: create a relation constant<br />
World function: create a function constant<br />
Modify conceptualization when<br />
noticed deficient<br />
<br />
Uses the syntax of predicate calculus<br />
Example: (∀x) Bird(x) Fly(x)<br />
Interpretation<br />
Model<br />
Use interpretation of sentences to represent<br />
knowledge<br />
Assignment of relation, object <strong>and</strong> function<br />
to each relation, object <strong>and</strong> function<br />
constant<br />
Procedure for assigning values T <strong>and</strong> F to<br />
each closed formula<br />
Any interpretation for which all of the<br />
sentences is evaluates to T is called a<br />
model of the set of sentences<br />
Compose a set of sentences in the<br />
language such that the interpretation<br />
of those sentences is a model of the<br />
set of sentences.
Knowledge base<br />
The sentences of the machine ∆<br />
Initial state: ∆0<br />
Mem produces ∆1, ∆2… ∆i,….<br />
The designer must provide sufficient<br />
sentences in the knowledge base such that<br />
is model is limited<br />
Procedurally via<br />
declaratively<br />
Procedurally: act <strong>and</strong> mem are highly<br />
specified to the task the machine is<br />
expected to perform<br />
∆<br />
Declaratively: act <strong>and</strong> mem are<br />
general purpose <strong>and</strong> largely<br />
independent of the application.<br />
<strong>Logic</strong>ally entails<br />
If all the models of ∆ are also models<br />
of a sentence Φ, we say that ∆<br />
logically entails Φ <strong>and</strong> write ∆╞ Φ.<br />
Want mem to add sentences to ∆ that<br />
are logically entailed by ∆<br />
Rule of inference <strong>and</strong><br />
deduction<br />
Rule of inference: any computation on a set<br />
of sequences that produces new sentences.<br />
Ex: modus ponens. Given AB, A will give<br />
us B<br />
If Ψ can be derived from ∆ by a sequence<br />
of applications of rules of inference, we say<br />
that can be deduced from ∆ <strong>and</strong> write ∆╞ Ψ
Sound <strong>and</strong> complete<br />
A rule of inference is called sound if rules of<br />
inference have the property of that if ∆╞ Φ,<br />
then ∆╞ Φ.<br />
A set of inference rules that has the<br />
property that if ∆╞ Φ then the rules will<br />
eventually produce Φ, is called complete.<br />
An important component of mem is sound<br />
inference<br />
Comments on the logical<br />
approach<br />
How to model the physical world Objects,<br />
functions, relations<br />
How to model<br />
• My intentions<br />
• My plans<br />
• Change<br />
• Ect<br />
Comments on the logical<br />
approach<br />
Sound <strong>and</strong> unsound<br />
inference<br />
The hard problem is to express<br />
commonsense knowledge.<br />
Deciding the language is easier than<br />
deciding what to say!<br />
Example<br />
• A = ”It is raining outside”<br />
• B = ”I will become wet”<br />
<strong>Logic</strong> inference<br />
1) A<br />
2) A B<br />
3) B conclusion
Sound <strong>and</strong> unsound<br />
inference<br />
<strong>Nils</strong>sons argument:<br />
Human reasoning<br />
• It is raining..<br />
• So it seems like I will get wet<br />
• But what if I use my umbrella?<br />
• And what if i stay inside?<br />
How can a computer know infere this using<br />
logic??<br />
We can use more than one model<br />
• We can add a model that knows about<br />
umbrellas, staying inside…<br />
We can use circumscription<br />
• will be explained later..<br />
Generalization<br />
Generalization using logic –<br />
Sound inference!<br />
Cat(Cat_1) ^ Eyes(Cat_1 , yellow)<br />
Cat(Cat_2) ^ Eyes(Cat_2 , yellow)<br />
Cat(Cat_3) ^ Eyes(Cat_3 , yellow)<br />
Cat(Cat_4) ^ Eyes(Cat_4 , yellow)<br />
Human generalization:<br />
”All cats have yellow eyes”<br />
Add the following statements:<br />
(Ax)(Ey) (Cat(X) Eyes (x, y))<br />
• All cats have some color on their eyes<br />
(Ax)(Ay)(Az) (Eyes(x,y) ^ Eyes(x,z) (y=z))<br />
• All cats have the same color on their eyes
Generalization using logic –<br />
Sound inference!<br />
<strong>Logic</strong> <strong>and</strong> eficciency<br />
Critisism: <strong>Logic</strong> is to inefficient to use in AI<br />
Now we can soudly conclude that<br />
(Ax) (Cat(x) Eyes(x, yellow))<br />
<strong>Nils</strong>sons answer:<br />
1) Several programs do efficient theory<br />
proval<br />
2) For other purposes, convert to for<br />
example LISP<br />
<strong>Logic</strong> in LISP<br />
<strong>Logic</strong> in LISP<br />
Example: All cats has fur.<br />
<strong>Logic</strong><br />
• (Ax) ( Cat(x) Fur(x) )<br />
• Cat(myCat)<br />
In LISP:<br />
• (Cat myCat)<br />
• (or (not(Cat myCat)) (Fur myCat) )<br />
<br />
How to deduce Fur(myCat) in LISP?<br />
1) <strong>Logic</strong>al deduction rules<br />
2) Semantic attachment<br />
Remember: (a b) equivalent with (~a v b)
Meta-knowledge<br />
Exceptions in logic<br />
We can reason about knowledge, as<br />
well as reason with it<br />
• Can this be done in logic?<br />
Solution:<br />
• Use more than one model<br />
• Also done in science!<br />
• Use meta-theories to decide which<br />
model to use!<br />
” If the fuel tank is empty <strong>and</strong> I turn the<br />
key then my car will start“<br />
• What if the tank is full of water?<br />
• What if the battery is empty?<br />
We want a simple conceptualisation,<br />
even though we know that the world is<br />
detailed<br />
What to do about<br />
exceptions?<br />
Solution 1: Ignore them<br />
• A scientific model is never accurate<br />
Solution 2: Non-monotonic reasoning<br />
Solution 3: Curcumscription<br />
Non-monotonic reasoning<br />
Regular logic<br />
1. ~ Empty-tank(X) ^ Turn_key(X) Start(x)<br />
2. ~ Empty_tank(myCar)<br />
3. Turn_key(myCar)<br />
4. start(myCar) conclusion<br />
Non-monotonic reasoning:<br />
introduce Full_of_water(myCar) will give ~ Start(x)
Circumscription<br />
Challenges for logic<br />
Introduce the AB(X) predicate<br />
~ Empty_tank(x) ^ Turn_key(x) ^ ~AB(x) Start(x)<br />
(Ax) AB(x) = [Full_of_water(x), Battery_empty(x)]<br />
Change: transition between states<br />
• At (Person, Place, Time)<br />
• At (Ida, Home, 08.00) At (Ida, School, 10.00)<br />
• How does states change by action?<br />
• The frame problem: How to specify<br />
aspects of the world that does not<br />
change?<br />
Other challenges<br />
Fuzzy logic<br />
• At( Ida, School, 10.00, 97%)<br />
• How to use this in reasoning?<br />
Any questions?<br />
Embedded systems:<br />
• Reacting to stimuli<br />
• Reasoning<br />
• Responding to the world<br />
• Solution:<br />
• Action networks <strong>and</strong> different levels of<br />
reasoning