0% found this document useful (0 votes)
9 views17 pages

Logic and Propositional Logic

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views17 pages

Logic and Propositional Logic

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Logic &

Propositional Logic
Logic
• Knowledge bases consist of sentences.

• These sentences are expressed according to the syntax of the


representation language, which specifies all the sentences that are well
formed.

• The notion of syntax is clear enough in ordinary arithmetic:


“x + y =4” is a well-formed sentence, whereas “x4y+=” is not.
Logic
• A logic must also define the semantics or meaning of sentences.

• The semantics defines the truth of each sentence with respect to each
possible world.

• For example, the semantics for arithmetic specifies that the sentence
“x + y =4” is true in a world where x is 2 and y is 2, but false in a
world where x is 1 and y is 1.

• In standard logics, every sentence must be either true or false in each


possible world—there is no “in between”.
Propositional Logic: A Very Simple Logic

• Simple & powerful logic called propositional logic.

• Syntax of propositional logic and its semantics—the way in which


the truth of sentences is determined.

• Entailment — the relation between a sentence and another


sentence.
Syntax
• The syntax of propositional logic defines the allowable sentences.

• The atomic sentences consist of a single proposition symbol.

• Each such symbol stands for a proposition that can be true or false.

• We use symbols that start with an uppercase letter and may contain other
letters or subscripts,
for example: P, Q, R, W1,3 and North.
Syntax
• The names are arbitrary but are often chosen to have some mnemonic
value—we use W1,3 to stand for the proposition that the wumpus is in
[1,3].
(Remember that symbols such as W1,3 are atomic, i.e., W,1,and 3 are
not meaningful parts of the symbol.)

• There are two proposition symbols with fixed meanings: True is the
always-true proposition and False is the always-false proposition.

• Complex sentences are constructed from simpler sentences, using


parentheses and logical connectives.
There are five connectives in common use:
Syntax A BNF (Backus–Naur Form) grammar of sentences in
propositional logic, along with operator precedence's, from
highest to lowest.
Semantics
• The semantics defines the rules for determining the truth of a
sentence with respect to a particular model.

• In propositional logic, a model simply fixes the truth value — true


or false — for every proposition symbol.

• For example, if the sentences in the knowledge base make use of the
propositional symbol then one possible model is
Semantics
• The semantics for propositional logic must specify how to compute the
truth value of any sentence, given a model.

• This is done recursively.

• All sentences are constructed from atomic sentences and the five
connectives.

• Therefore, we need to specify how to compute the truth of atomic


sentences and how to compute the truth of sentences formed with each of
the five connectives.
Semantics
Atomic sentences are easy:
• True is true in every model and False is false in every model.
• The truth value of every other proposition symbol must be specified
directly in the model.
• For complex sentences, we have five rules, which hold for any
sub sentences P and Q in any model m,
Truth tables for the five logical connectives
A simple knowledge base
• we can construct a knowledge base for the wumpus world.
• we need the following symbols for each [x, y] location.
A simple knowledge base

• The sentences we write will suffice to derive ¬P1,2 (there is no pit in


[1,2]).

• We label each sentence Ri so that we can refer to them:


A simple knowledge base

• A square is breezy if and only if there is a pit in a neighboring


square. This has to be stated for each square; for now, we include just
the relevant squares:
A truth-table (TT) enumeration algorithm for
deciding propositional entailment.
Standard logical equivalences. The symbols α, β and γ stand
for arbitrary sentences of propositional logic.

You might also like