Formal Methods in Computer Science CS1502 Atomic Sentences - PowerPoint PPT Presentation

1 / 38
About This Presentation
Title:

Formal Methods in Computer Science CS1502 Atomic Sentences

Description:

Logic is the study of claims and reasoning about claims. ... 3 kinds of Objects: Cube, Tetrahedron, Dodecahedron. 3 sizes. Etc. Other restrictions ... – PowerPoint PPT presentation

Number of Views:33
Avg rating:3.0/5.0
Slides: 39
Provided by: patchrawat
Category:

less

Transcript and Presenter's Notes

Title: Formal Methods in Computer Science CS1502 Atomic Sentences


1
Formal Methods in Computer ScienceCS1502Atomic
Sentences
  • Patchrawat Uthaisombut
  • University of Pittsburgh

2
Goals
  • What logic is about.
  • To learn about basic notions in logic
  • Models, worlds, FOL, atomic sentences,
    predicates, names
  • To gain skills in creating logic models.

3
What logic is about
  • Logic is the study of claims and reasoning about
    claims.
  • Logic is the study of systematic and strategic
    reasoning to determine if a claim is true or
    false, given certain assumptions.

4
Example
  • Suppose the following.
  • Socrates is a man.
  • All men are mortal.
  • No mortal lives forever.
  • Everyone who will eventually die sometimes
    worries about it.
  • Can we conclude this?
  • Socrates sometimes worries about dying.

5
Too easy / Too hard
Hard to comprehend
Our ability with the help of formal logic
Our everyday ability to reason about the world
Easy to comprehend
6
What are the basic pieces we need?
  • A way to represent English sentences
  • Create a mathematical model that can be used to
    represent English sentences
  • Logic sentence, Predicates, Names, Terms
  • Functions, boolean connectives, quantifiers, etc
  • Formalize a procedure for reasoning
  • Truth tables
  • Inference rules
  • Proofs, etc.

7
Sentences
  • What kind of sentences are we interested in in
    logic?
  • Paris is the capital of France
  • 22 4
  • Toronto is in Asia
  • Is Philosophy 101 harder than Gen Chem 101?
  • Add sugar, then add salt.
  • Declarative Sentences

8
Sentences
  • Break each sentence into two parts
  • Objects that the sentence refer to.
  • Names
  • Properties/relationships that the sentence refer
    to.
  • Predicates
  • Form a sentence by combining names and a
    predicate.
  • AtSchool(abby)
  • AtLibrary(john)

9
Worlds and models
  • Do our predicate and names apply only to the real
    world?
  • AtSchool(abby)
  • AtLibrary(john)
  • Taller(john,jack)
  • It also works on a similar hypothetical world.
  • A set of similar worlds is called a model.

10
World and Model
  • A model describes what worlds are possible within
    the model.
  • Thus, a model is a set of worlds.
  • A world consists of a number of objects with
    various properties and relationships among them.
  • FOL is a family of languages having a similar
    grammar and sharing similar components.
  • Such a language used to describe, and make claims
    about worlds in a model.
  • Different models have different languages.
  • We use Taskis worlds model to study logic.

11
A Taskis World
12
Example Taskis Worlds Model
  • A world in the Taskis worlds model is an
    arrangement of objects in a 8x8 chess board.
  • 3 kinds of Objects Cube, Tetrahedron,
    Dodecahedron
  • 3 sizes
  • Etc.
  • Other restrictions
  • An object must locate in a square of the board
  • No 2 objects can be in the same position.
  • An object can have only 1 shape.
  • An object can have only 1 size.
  • Etc.

13
Taskis Model
  • We are not interested in
  • The precise position of the object.
  • The color of the objects.
  • (Cubes are always green, )
  • The density of the objects.

14
Example of Claims
  • English
  • Object b is a cube.
  • Object a is small.
  • Object c is to the left of object f.
  • Object d and object e have the same shape.(false
    claim)
  • FOL
  • Cube(b)
  • Small(b)
  • LeftOf(c,f)
  • SameShape(d,e)(false claim)

15
(No Transcript)
16
Names
  • Constants are used to name existing objects
  • a, b, c, d, e, f
  • max, claire, carl
  • No constant can name more than one object
  • An object can have more than one name or no name
    at all

17
(No Transcript)
18
Predicates
  • A property possessed by an object
  • Shape (e.g., Tet, Cube)
  • Size (e.g., Small, Large)
  • A relationship among objects
  • Shape relationship (e.g., SameShape)
  • Size relationship (e.g., Smaller)
  • Positional relationship (e.g., Between, LeftOf)
  • Equality

19
Predicates
  • Each predicate has a fixed number of arguments or
    arity. This is the number of constants the
    predicate needs to form a sentence.
  • In English, OK, but not in logic
  • Sam is taller than Jim
  • Sam is taller than Jim and John

20
Predicates
  • Predicates must be determinate
  • Suppose p is an n-ary predicate.
  • For every n-tuple lto1,o2,,oNgt of objects,
    p(o1,o2,,oN) is true or false (not kind of
    true).
  • Whats an n-tuple?
  • An n-tuple is a collection of n objects where
    order matters. Duplicates are allowed. In
    contrast, sets may not have duplicates, and the
    members of sets are not ordered.

21
Atomic Sentences (so far)
  • A sentence formed by a single predicate followed
    by one or more names
  • Max is tall Tall(max)
  • e is larger than b Larger(e,b)
  • e is identical to a e a
  • A sentence expresses a claim that is either true
    or false

22
Atomic Sentences (so far)
  • Predicate(arg1, arg2,, argn)
  • Predicates have names beginning with an uppercase
    letter or are represented by an operator symbol
  • The number of arguments is called the predicates
    arity
  • The order of the arguments is importantLarger(e,c
    ) e is larger than cLarger(c,e) c is larger
    than eBetween(a,b,e) a is between b and
    eBetween(b,a,e) b is between a and e
  • (a,b)
  • a and b are identical
  • Usually, written in infix form a b

23
Exercise Creating Models
  • Divide into small groups
  • Create your own model
  • Give a description of your model.
  • Create your own language
  • Predicates
  • Names
  • Give an example world of your model
  • Give a few sentences.
  • Indicate if the sentences are true in your world.
  • Words home, friend, program, fast, before,
    stone, letters, students, snow, basketball, team,
    logistic, heavy, book.

24
Function Symbols
  • A function is used to express complex names (a
    reference to an individual without using a name)
  • father(b) bs father
  • Used in a sentence Tall(father(b))
  • password(c) cs password
  • Used in a sentence Long(password(c))
  • A function may be nested
  • father(father(max))
  • Used in a sentence Short(father(father(max)))
  • Cant nest predicates
  • Tall(Tall(max)) not a legal sentence

25
Functional Expressions
  • Function(arg1, arg2,, argn)
  • Function names begin with a lowercase letter or
    are expressed with a symbol
  • father(max) Maxs father
  • father(mother(max)) Maxs mothers father
  • youngestChild(max,ann) Max and Anns youngest
    child
  • (5,(2,4)) 30
  • starship(son(dr_crusher)) Dr_Crushers sons
    starship

26
Atomic Sentences (so far)
  • A sentence formed by a single predicate followed
    by one or more terms
  • A term is either a constant or a functional
    expression

27
Predicates vs Functions
  • Syntax is similar
  • Predicate(arg1, arg2,, argn)
  • Function(arg1, arg2,, argn)
  • Difference
  • After applying a predicate to terms, we get a
    sentence
  • Cannot be nested
  • After applying a function to terms, we get
    another term.
  • Can be nested

28
Example Atomic Sentences (which are functions
and which are predicates?)
  • Predicate(term1,term2,,term_n)
  • Happy(bossof(sally))
  • Father(bill)
  • Tall(fatherOf(motherOf(sally)))
  • Happier(motherOf(bill),bossof(fatherOf(max)))
  • Fake(santa(rossParkMall)))
  • Real(santa(robinsonTownCenter)))

29
Functions in Taskis model
  • lm(x) Leftmost
  • Refer to the leftmost object in the same row as x
  • It could be x itself
  • rm(x) Rightmost
  • fm(x) Frontmost
  • bm(x) Backmost

30
Exercise Creating Models with Functions
  • Divide into small groups
  • Add some functions to your model created earlier.
  • Give an example world of your model
  • Give a few sentences with functions.
  • Indicate if the sentences are true in your world.
  • Words home, friend, program, fast, before,
    stone, letters, students, snow, basketball, team,
    logistic, heavy, book.

31
First Order Logic
  • Names
  • Predicates
  • Functions
  • Connectives

Are there more?
32
Example FOL
33
Translation
  • Brando is Nancys favorite actor.
  • brando favoriteActor(nancy)
  • BetterActor(favoriteActor(nancy),
    favoriteActor(max))
  • Nancys favorite actor is better than Maxs
    favorite actor.
  • sean favoriteActor(sean)
  • Sean is his own favorite actor.
  • Brando is someones favorite actor.
  • ?x(brando favoriteActor(x))

34
ConnectivesApply to sentences tocreate more
complex sentences.
  • Not ?
  • And, Or ?, ?
  • Material Conditional ?
  • Biconditional ?

35
Examples
  • ?Larger(e,c)
  • Cube(b) ? Large(b)
  • SameRow(e,c) ? BackOf(e,b)

e is not larger than c
b is a cube or b is large
e and c are in the same row and e is in back of b
36
Quantifiers and Variables
  • For every x ?x
  • ?x (man(x) ? mortal(x))
  • There exists y ?y
  • ?x(brando favoriteActor(x))

37
First Order Logic
  • Names
  • Predicates
  • Functions
  • Connectives
  • Quantifiers and variables

Revised List
38
Goals Have you archived the followings?
  • What logic is about.
  • To learn about basic notions in logic
  • Models, worlds, FOL, atomic sentences,
    predicates, names
  • To gain skills in creating logic models.
Write a Comment
User Comments (0)
About PowerShow.com