introduction to logic first lecture, Summaries of Digital Logic Design and Programming

this is a lecture about logic the first lecture introductionary lecture

Typology: Summaries

2022/2023

Uploaded on 11/11/2023

nermeen-elzaweli
nermeen-elzaweli 🇪🇬

5

(1)

5 documents

1 / 35

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Dr.Nermeen Kame
Cairo University
Fall 2022
Introduction to Logic
Propositional Logic
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23

Partial preview of the text

Download introduction to logic first lecture and more Summaries Digital Logic Design and Programming in PDF only on Docsity!

Dr.Nermeen Kame Cairo University Fall 2022

Introduction to Logic

Propositional Logic

Syntax of Propositional Logic Propositional Constants Logical Operators Semantics Truth Assignments for propositional constants Meaning of logical operators Evaluation Truth Assignments to values of compound sentences Satisfaction Values of compound sentences to truth assignments Truth Tables

Agenda

By convention (in this course), proposition constants are written as strings of alphanumeric characters beginning with a lower case letter. Examples: raining r 32 aining rAiNiNg rainingorsnowing Non-Examples: 324567 raining.or.snowing

Proposition Constants

Negations: ¬ raining The argument of a negation is called the target. Conjunctions: ( raining Ù snowing ) The arguments of a conjunction are called conjuncts. Disjunctions: ( raining Ú snowing ) The arguments of a disjunction are called disjuncts.

Compound Sentences (part I)

¬ raining ( raining Ù snowing ) ( raining Ú snowing ) ( raining Þ cloudy ) ( cloudy Û raining ) ¬( raining Ù snowing ) (( raining Ù snowing ) Þ cloudy ) ( cloudy Þ ( raining Ù snowing )) (( cloudy Ù wet ) Û ( raining Ú snowing )) (¬ raining Þ ( cloudy Þ snowing ))

Nested Compound Sentences

Dropping Parentheses is good: ( p Ù q ) ® p Ù q But it can lead to ambiguities: (( p Ú q ) Ù r ) ® p Ú q Ù r ( p Ú ( q Ù r )) ® p Ú q Ù r

Parentheses Removal

If surrounded by two occurrences of Ù or Ú, the operand associates with the operator to the left. p Ù q Ù r ® (( p Ù q ) Ù r ) p Ú q Ú r ® (( p Ú q ) Ú r ) If surrounded by two occurrences of Þ or Û, the operand associates with the operator to the right. p Þ q Þ r ® ( p Þ ( q Þ r )) p Û q Û r ® ( p Û ( q Û r ))

Precedence (continued)

(a) All purple mushrooms are poisonous.

(b) A mushroom is poisonous only if it is purple.

(c) A mushroom is not poisonous unless it is purple.

(d) No purple mushroom is poisonous.

Natural Language Examples

Consider a propositional language with three proposition

constants—mushroom, purple, and poisonous—each

indicating the property suggested by its spelling. Using

these proposition constants, encode the following

English sentences as Propositional Logic sentences.

Vocabulary: purple , mushroom , poisonous Purple mushrooms are poisonous. mushroom Ù purple Þ poisonous mushroom Þ ( purple Þ poisonous )

Natural Language Examples

Vocabulary: purple , mushroom , poisonous A mushroom is poisonous only if it is purple. mushroom Þ (¬ purple Þ ¬ poisonous ) mushroom Þ ( poisonous Þ purple ) mushroom Ù poisonous Þ purple

Natural Language Examples

Vocabulary: purple , mushroom , poisonous No purple mushroom is poisonous ¬( mushroom Ù poisonous Ù purple ) mushroom Ù poisonous Þ ¬ purple

Natural Language Examples

A propositional interpretation is an association between the propositional constants in a propositional language and the values T or F. (Later, written as 1 and 0.) We sometimes view an interpretation as a Boolean vector of values for the items in the signature of the language (when the signature is ordered). i = TFT

Propositional Interpretation

Negation: For example, if the interpretation of p is F, then the interpretation of ¬ p is T. For example, if the interpretation of ( p Ù q ) is T, then the interpretation of ¬( p Ù q ) is F.

Operator Semantics

Conjunction: Disjunction: NB: The type of disjunction here is called inclusive or , which says that a disjunction is true if and only if at least one of its disjuncts is true. This contrasts with exclusive or , which says that a disjunction is true if and only if an odd number of its disjuncts is true.

Operator Semantics (continued)