You are on page 1of 18

1

Lahore Garrison University


CSC363-Artificial Intelligence
Online Week-12 Lecture-24
2
Preamble

► Logical Agents Overview

► Knowledge representation issues of problem-solving agents

► Developing logic and knowledge-based agents

► Knowledge-based agents (Overall design)

► Knowledge-based Agent Program

► Knowledge-based Agent Functions and Operations

► Knowledge-based Agent Approaches

Lahore Garrison University


3
Propositional Logic

► A simple but powerful logic.


► It has a syntax and some semantics – the way in which the truth of sentences is determined.
► The process of entailment – the relation between a sentence and another sentence that follows from it.
► Syntax
The syntax of propositional logic defines the allowable sentences.
The atomic sentences consist of a single proposition model.
Each symbol stands for a proposition that can be true or false.
Symbols start with an Uppercase letter and may contain other letters or subscripts.
For example, P, Q, R, W1,3 and NORTH.
Symbol names are arbitrary and are often chosen to have some value – W1,3 stands for the proposition that the
agent is at location [1,3] in an environment.

Lahore Garrison University


4
Propositional Logic – Syntax

► There are two propositional symbols with fixed meanings:


True is the always-true proposition.
False is the always-false proposition.
► Complex sentences are constructed from simpler sentences and logical connectives.
There are five connectives in common use:

Negation ¬ (not) A sentence such as ¬W1,3 is called the negation of W1,3.


Literal (Positive/Negative) A literal is either an atomic sentence or a negated atomic sentence.

Conjunction ∧ (and) A sentence whose main connection is ∧, such as W1,3 ∧ P3,1.


Its parts are the conjuncts.

Disjunction ∨ (or) A sentence using ∨, such as (W1,3 ∧ P3,1) ∨ W2,2.


Its parts are the disjuncts, (W1,3 ∧ P3,1) and W2,2.
Lahore Garrison University
5
Propositional Logic – Syntax (Cont.)

► Implication ⇒ (implies) A sentence such as (W1,3 ∧ P3,1) ⇒ ¬W2,2, is called an implication


or conditional.

Premise Its premise or antecedent is (W1,3 ∧ P3,1).

Conclusion Its conclusion or consequent is ¬W2,2

Rules The implications are also known as rules or if-then statements.


The implication symbol is sometimes written in other books as ⊃ or →

Biconditional ⇔ (if and only if) The sentence W1,3 ⇔ ¬W2,2 is a biconditional.
Some books write this as ‘ ≡ ‘.

Lahore Garrison University


6
BNF (Backus-Naur Form) Grammar

► A BNF (Backus-Naur Form) grammar of sentences in propositional logic, along with operator precedencies, from
highest to lowest. See textbook page 1060 to get familiar with BNF.

Lahore Garrison University


7
Propositional Logic – Semantics

► Semantics define the rules for determining the truth of a sentence with respect to a particular model.
► 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 proposition symbols P1,2, P2,2, and P3,1, then one possible
model is

m1 = {P1,2 = false, P2,2 = false, P3,1 = true}


► With three proposition symbols, there are 23 = 8 possible models.

Lahore Garrison University


8
Propositional Logic – Semantics

Lahore Garrison University


9
Truth Tables for Connectives

Lahore Garrison University


10
Wumpus World Sentences

Lahore Garrison University


11
Wumpus World Sentences (Cont.)

Lahore Garrison University


12
Truth Tables for Inference

Lahore Garrison University


13

Inference by
Enumeration

Lahore Garrison University


14

Logical
Equivalence

Lahore Garrison University


15

Validity and
Satisfiability

Lahore Garrison University


16
Lesson Preview

► Propositional Logic: A very simple logic

► Syntax

► Symbols, sentences and logical connectives.

► Semantics

► Truth Value & Truth tables

► A simple knowledge-base

► A simple inference procedure

► Validity and Satisfiability


Lahore Garrison University
17
Next Lesson Preview

► Logical Agents: Forward Chaining


► Definition & Concept
► Forward chaining algorithm
► Examples
► Rules Database
► Weather Forecasting System
► First pass of Forward Chaining
► Second pass
► Third pass

Lahore Garrison University


18
References

► Artificial Intelligence: A Modern Approach by Stuart J. Russell and Peter Norvig, 3rd edition,

2010. Chapter # 7 – 7.4

Lahore Garrison University

You might also like