4 views

Uploaded by rafia

PROPOSITIONAL AND FIRST ORDER LOGIC

- Division of Propositions
- Neutrality and Many-Valued Logics, by Andrew Schumann, Florentin Smarandache
- (Teoría de Conjuntos _(Fernando Hernández Hernández_))
- gdel-kurt
- Def Inability 2
- Artificial intelligence propositional logic
- Logical Agents
- Standpoint Semantics
- HUM 112 Project Prompt
- intro logic
- AI - Two Marks
- Tabla de Verdad
- Chapter 3
- Handbook WCP5
- Katz - On the Stativity of the English Perfect
- Logic From a to Z REP Glossary of Logical and Mathematical Terms Routledge a Z
- Geometry Lesson 11 V2-Proofs Using Logic
- Knowladge Representation
- Set Theory & Truth Table
- Attitude&Kommu Florenz

You are on page 1of 36

Propositional logic

Logical constants: true, false

Propositional symbols: P, Q, S, ...

(atomic sentences)

Wrapping parentheses: ( )

Sentences are combined by

connectives:

...and [conjunction]

...or [disjunction]

...implies [implication / conditional]

..is equivalent [biconditional]

...not [negation]

Literal: atomic sentence or negated

atomic sentence

2

Syntax of FOL: Basic

elements

Constants KingJohn, 2, UCI,...

Variables x, y, a, b,...

Connectives , , , ,

Equality =

Quantifiers ,

Propositional logic (PL)

A simple language useful for showing key ideas and

definitions

User defines a set of propositional symbols, like P and Q.

User defines the semantics of each propositional symbol:

P means It is hot

Q means It is humid

R means It is raining

A sentence (well formed formula) is defined as follows:

A symbol is a sentence

If S is a sentence, then S is a sentence

If S is a sentence, then (S) is a sentence

If S and T are sentences, then (S T), (S T), (S T), and (S T)

are sentences

A sentence results from a finite number of applications of the

above rules

5

Some terms

sentence determines its interpretation.

Given the truth values of all symbols in a

sentence, it can be evaluated to

determine its truth value (True or

False).

A model for a KB is a possible world

(assignment of truth values to

propositional symbols) in which each

sentence in the KB is True. 6

More terms

A valid sentence or tautology is a sentence

that is True under all interpretations, no

matter what the world is actually like or what

the semantics is. Example: Its raining or its

not raining.

An inconsistent sentence or contradiction

is a sentence that is False under all

interpretations. The world is never like what it

describes, as in Its raining and its not

raining.

P entails Q, written P |= Q, means that

whenever P is True, so is Q. In other words, all

models of P are also models of Q.

7

Limitations of propositional logic

expressive power

unlike natural language

E.g., cannot say "pits cause

breezes in adjacent squares

except by writing one sentence

for each square

First-order logic

First-order logic (FOL) models the world in terms of

Objects, which are things with individual identities

Properties of objects that distinguish them from other

objects

Relations that hold among sets of objects

Functions, which are a subset of relations where there is

only one value for any given input

Examples:

Objects: Students, lectures, companies, cars ...

Relations: Brother-of, bigger-than, outside, part-of, has-

color, occurs-after, owns, visits, precedes, ...

Properties: blue, oval, even, large, ...

Functions: father-of, best-friend, second-half, one-more-

than ...

9

User provides

world

Mary

3

Green

Function symbols, which map individuals to individuals

father-of(Mary) = John

color-of(Sky) = Blue

Predicate symbols, which map individuals to truth

values

greater(5,3)

green(Grass)

color(Grass, Green)

10

FOL Provides

Variable symbols

E.g., x, y, foo

Connectives

Same as in PL: not (), and (), or (),

implies (), if and only if (biconditional )

Quantifiers

Universal x or (Ax)

Existential x or (Ex)

11

Logics in General

Ontological Commitment:

What exists in the world TRUTH

PL : facts hold or do not hold.

FOL : objects with relations between

them that hold or do not hold

Epistemological Commitment:

What an agent believes about facts

BELIEF

Syntax of FOL: Basic

elements

Constant Symbols:

Stand for objects

e.g., KingJohn, 2, UCI,...

Predicate Symbols

Stand for relations

E.g., Brother(Richard, John), greater_than(3,2)...

Function Symbols

Stand for functions

E.g., Sqrt(3), LeftLegOf(John),...

Relations

Some relations are properties: they state

some fact about a single object:

Round(ball), Prime(7).

more objects: Married(John,Mary),

LargerThan(3,2).

is another object: Plus(2,3), Father(Dan).

Models for FOL: Graphical

Example

Tabular Representation

Historically, the relational data model comes from FOL.

Student Professor

Intellige Course Populari Teaching-

s-id nce Ranking c-id Rating Difficulty p-id ty a

Jack 3 1 101 3 1 Oliv

Kim 2 1 er 3 1

Paul 1 2 102 2 2 Jim 2 1

Registration

RA Grad Satisfacti

s-id p-id Salary Capability s-id c.id e on

Jack Oliver High 3 Jack 101 A 1

Jack 102 B 2

Kim Oliver Low 1 Kim 102 A 1

Paul Jim Med 2 Pau

l 101 B 1

16

Atomic Sentences

P(x,y) interpreted as x is P of y

Examples:

LargerThan(2,3) is false.

Brother_of(Mary,Pete) is false.

Married(Father(Richard), Mother(John)) could be true or false

Brother(Pete) refers to John (his brother) and is neither true nor false.

Brother_of(Pete,Brother(Pete)) is True.

Complex Sentences

We make complex sentences with

connectives (just like in propositional property

logic).

Brother (LeftLeg (Richard ), John ) (Democrat (Bush ))

binary function

relation

objects

connectives

More Examples

Brother(Richard, John) Brother(John, Richard)

King(Richard) King(John)

Variables

Person(John) is true or false because we

give it a single argument John

variables which can take on values in a

domain. e.g., all persons x, all integers i,

etc.

E.g., can state rules like Person(x) =>

HasHead(x)

or Integer(i) => Integer(plus(i,1)

Universal Quantification

means for all

Allows us to make statements about all objects that have certain properties

Note that

x King(x) Person(x) is not correct!

This would imply that all objects x are Kings and are People

Existential Quantification

Examples:

x King(x)

x Lives_in(John, Castle(x))

i Integer(i) GreaterThan(i,0)

(And => is the natural connective to use with )

More examples

For all real x, x>2 implies x>3.

x [(x 2 1)] x R (false )

Combining Quantifiers

x y Loves(x,y)

For everyone (all x) there is someone

(y) that they love.

y x Loves(x,y)

- there is someone (y) who is loved by everyone

Duality: Connections between

Quantifiers

Asserting that all x have property P is the same as

asserting that

there does not exist any x that doest have the

property P

In effect:

- is a conjunction over the universe of objects

- is a disjunction over the universe of objects

Thus, DeMorgans rules can be applied

De Morgans Law for Quantifiers

P Q (P Q ) x P x (P )

P Q (P Q ) x P x (P )

(P Q ) P Q x P x (P )

(P Q ) P Q x P x (P )

always switch between them (or and, and or).

Exercise

Formalize the sentence

Jack has reserved all red boats.

Apply De Morgans duality laws to

this sentence.

Using FOL

We want to TELL things to the KB, e.g.

x , King (x ) Person (x )

TELL(KB, )

TELL(KB, King(John) )

x , Person

We also want (x )things to the KB,

to ASK

ASK(KB, )

{x/John,x/Richard,...}

Knowledge engineering in

FOL

1. Identify the task

8. See text for full example: electric circuit knowledge base.

9.

10.

11.

12.

Example: A simple genealogy KB by FOL

FOL that

contains facts of immediate family relations (spouses, parents,

etc.)

contains definitions of more complex relations (ancestors,

relatives)

is able to answer queries about relationships between people

Predicates:

parent(x, y), child(x, y), father(x, y), daughter(x, y), etc.

spouse(x, y), husband(x, y), wife(x,y)

ancestor(x, y), descendant(x, y)

male(x), female(y)

relative(x, y)

Facts:

husband(Joe, Mary), son(Fred, Joe)

spouse(John, Nancy), male(John), son(Mark, Nancy)

father(Jack, Nancy), daughter(Linda, Jack)

daughter(Liz, Linda)

35

etc.

Rules for genealogical relations

(x,y) father(x, y) parent(x, y) male(x) (similarly for mother(x, y))

(x,y) daughter(x, y) child(x, y) female(x) (similarly for son(x, y))

(x,y) husband(x, y) spouse(x, y) male(x) (similarly for wife(x, y))

(x,y) spouse(x, y) spouse(y, x) (spouse relation is symmetric)

(x,y) parent(x, y) ancestor(x, y)

(x,y)(z) parent(x, z) ancestor(z, y) ancestor(x, y)

(x,y) descendant(x, y) ancestor(y, x)

(x,y)(z) ancestor(z, x) ancestor(z, y) relative(x, y)

(related by common ancestry)

(x,y) spouse(x, y) relative(x, y) (related by marriage)

(x,y)(z) relative(z, x) relative(z, y) relative(x, y) (transitive)

(x,y) relative(x, y) relative(y, x) (symmetric)

Queries

ancestor(Jack, Fred) /* the answer is yes */

relative(Liz, Joe) /* the answer is yes */

relative(Nancy, Matthew)

/* no answer in general, no if under closed world assumption */

(z) ancestor(z, Fred) ancestor(z, Liz)

36

Summary

First-order logic:

Much more expressive than propositional logic

Allows objects and relations as semantic primitives

Universal and existential quantifiers

syntax: constants, functions, predicates, equality,

quantifiers

Knowledge engineering using FOL

Capturing domain knowledge in logical form

Next lecture.

Undecidable, Turing-complete.

- Division of PropositionsUploaded bycarolina.omar
- Neutrality and Many-Valued Logics, by Andrew Schumann, Florentin SmarandacheUploaded bymarinescu
- (Teoría de Conjuntos _(Fernando Hernández Hernández_))Uploaded byCarlos Ruiz
- gdel-kurtUploaded byAldenilo Vieira
- Def Inability 2Uploaded byMind Reading
- Artificial intelligence propositional logicUploaded byKiran George Chennattucherry
- Logical AgentsUploaded byAye-Yan Millan Arellano Velasco
- Standpoint SemanticsUploaded byEdilson Rodrigues
- HUM 112 Project PromptUploaded byppppp
- intro logicUploaded byk112358
- AI - Two MarksUploaded byNikilesh
- Tabla de VerdadUploaded byFrandy Pimentel Queliz
- Chapter 3Uploaded byIshank Kumar
- Handbook WCP5Uploaded bynisargama
- Katz - On the Stativity of the English PerfectUploaded bydharmavid
- Logic From a to Z REP Glossary of Logical and Mathematical Terms Routledge a ZUploaded bye
- Geometry Lesson 11 V2-Proofs Using LogicUploaded byezmoreldo
- Knowladge RepresentationUploaded byKuldeep Singh
- Set Theory & Truth TableUploaded byAdekunle Afolabi
- Attitude&Kommu FlorenzUploaded byWolfgang Müller
- Dig.elect.fundamental (Present)-Muhammad Hafiz Bin Mat YaakubUploaded byabu
- prolog5Uploaded byprayag527
- A Normative Account of Defeasible and PrUploaded bydex12384
- Resolute: An Assurance Case Language for Architecture ModelsUploaded bylswjx

- AI 2 agentUploaded byrafia
- Idioms & ExpressionsUploaded byade prasetyo
- Web Engg Notes FinalUploaded byrafia
- AI 3 search spcUploaded byrafia
- Human Ear and Role of Hearing in HCI -Uploaded byrafia
- Parts of SpeechUploaded byrafia
- MvcUploaded byrafia
- JQuery SelectorsUploaded byrafia
- propasalUploaded byrafia
- History of HTMLUploaded byrafia
- EM Presentation.pptUploaded byrafia
- Web Cost EstimationUploaded byrafia

- Aniruddha Resume.pdfUploaded byPranay Radke
- Agile AccountingUploaded byJason Oz
- REGA Solutions CapabilitiesUploaded byRickKhosla
- JLR_27_05_2014.pdfUploaded bycorie132
- Unit 2 - Process & ThreadsUploaded byNihal Pathan
- Shortcut Keys ABCsUploaded byMohd Zakir Hussain
- F Engrave TutorialUploaded byAntonio Gonzalez-Haba Gil
- Alphanumeric App NotesUploaded byEnrique Aguilar
- REF542plus_om_755869_ENgUploaded bycharlnnmd
- Basic SortsUploaded byinboxashok
- Asgeir J Sørensen HIL Simulator TestingUploaded byShaban Satti
- Online Clinic BookingUploaded byodaiissa
- oraclUploaded byDineshkumarAparna
- Bott, Elizabeth. Urban Families - Conjugal Roles and Social NetworksUploaded byvladesko
- Mech-Intro 13.0 WS04.1 MeshingUploaded byMohamed Baakil
- Group 8_ SIA_AMS_RFPUploaded bySabyasachi Sahu
- Thesis Saket SakuniaUploaded bybharadwaj kotamarthi
- Tornado API Programmers Guide 2.2Uploaded byNitesh Singh
- 02. (Male) Data Collection & Monitoring Assistant DCMA.pdfUploaded byAdil Khan
- BS Computer Science.pdfUploaded bySheraz Ali
- USmart 3300 Brochure EnglishUploaded byJosé Daniel Hernández Sanchez
- DFA Minimization2Uploaded byAna-Maria Stoica
- [Cities Skylines] Broken & Incompatible Mods - Patch 1.11.0-f3Uploaded byRinda Amalia Aisyah
- O365 ResourcesUploaded byvintagevintage
- Rest APIUploaded byHavi Chavvakula
- FY2200S User's Manual_V2.0Uploaded byArief Kurniawan
- final project codeUploaded byapi-375199340
- New CCNA Exam Topics - NetworkelUploaded byrosalesjesus3
- AxelUploaded by521153
- ProductCatlog-2Uploaded byNishant Chandra