Download presentation
Presentation is loading. Please wait.
Published byArnold Hardy Modified over 6 years ago
1
Logic programming ( Handbook of Logic in Artificial Intelligence, Vol) by D. M. Gabbay, C. Hogger, J.A. Robinson .
2
PROLOG Program
3
Logic Logic Propositional Logic (PL)
is the study of the logic relationships between objects and forms the basis of all mathematical reasoning and all automated reasoning Propositional Logic (PL) In Propositional Logic, the objects are called propositions Definition: A proposition is a statement that is either true or false, but not both We usually denote a proposition by a letter: p, q, r, s, …
4
Propositions: Examples
The following are propositions Today is Monday M The grass is wet W It is raining R The following are not propositions C++ is the best language What is your name? Do your homework
5
Are these propositions?
2+2=5 Every integer is divisible by 12 Microsoft is an excellent company
6
Logical connectives Connectives are used to create a compound proposition from two or more propositions Negation (e.g., a or !a or ā) And or logical conjunction (denoted ) OR or logical disjunction (denoted ) XOR or exclusive or (denoted ) Implicaion (denoted or ) Biconditional (denoted or ) We define the meaning (semantics) of the logical connectives using truth tables
7
Logical Arguments Consider the following statements.
if you study then you succeed you study you succeed These three statements create a logical argument. Lines 1 and 2 are premises and line 3 is the conclusion. This logical argument is sound. Premises can be true or false. If the premises are true, the conclusion must be true. If one (or more than one) of the premises is false, the argument is still sound, but we don’t know whether the conclusion is true or false.
9
Rule of inference
10
Modus Ponens if you study then you succeed you study you succeed
(a rule of inference – one of the most important rules) if you study then you succeed you study you succeed Premises Conclusion Aristotle called this modus ponens: if P then Q P Q
11
Important! We are dealing with the validity of an argument, NOT with the validity of the result! In logic, it doesn’t matter if a logical statement makes sense or not. What does matter is that if the premises are correct, then so is the result.
12
Modus Ponens Examples if P then Q P Q P: I study hard Q: I get an A
P: cows give milk Q: doors open Makes sense Doesn’t make sense
13
Predicates and Arguments
if ‘Jill’ thinks then ‘Jill’ exists ‘Jill’ thinks ‘Jill’ exists if P(‘Jill’) then Q(‘Jill’) P(‘Jill’) Q(‘Jill’) if thinks(‘Jill’) then exists(‘Jill’) thinks(‘Jill’) exists(‘Jill’) if thinks(X) then exists(X) thinks(X) exists(X)
14
Predicates in arguments (continued…)
thinks(X) exists(X) thinks(X) exists(X) thinks(X) -: exists(X) if thinks(X) then exists(X) thinks(X) exists(X)
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.