











Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!












-^ Important Concepts– English to logic -^ facts^ – e.g. Mary is a baseball fan.
➔^ baseball_fan(mary).
-^ predicate
: baseball_fan
-^ argument
: mary
➔^ likes(mary,john).
-^ multiple arguments
: express
relations
-^ inference rules^ – e.g. snoring presupposes sleeping
➔
sleeping(X) :- snoring(X).
-^ logic variable
: X
-^ if : :-– note:
basically expresses idea
... snoring(X)
⇒^ sleeping(X)
-^ Important Concepts–
Prolog database^ •^
the database represents a
scenario
or^ possible world
-^ initially, the world is empty•^ we can
assert
and^ retract
facts and rules
:
is not allowed
is not
allowed – e.g. ?- assert((baseball_fan(X) :- + hates(X,baseball)).
is^ allowed
-^ Important Concepts–
negated queries
are ok
-^ (though they return no answer other than Yes/No)– query^
?- + baseball_fan(X). is
true if
-^ subquery
?- baseball_fan(X).
is not true
-^ ?- baseball_fan(X). would be not true for all possible worlds wherethere are no baseball fans–^ i.e. no baseball_fan/1 facts–^ and
we have no rules that could be used to concludebaseball_fan/1 is true from
logical inference
-^ e.g. no world like•
baseball_fan(X) :- loves(X,baseball).• loves(john,baseball).• loves(john,football).
-^ Computer Lab homework– asks you to write Prolog facts, rules and queries
corresponding to a series of English sentencesand questions
-^ examples:– Mary is a student– Pete is a baseball fan– who is both a student and a baseball fan?– who is a baseball fan and not a student?
-^ Goal: Formalize language so this can be done stepby step Mary is astudentwho is astudent?
student(mary).?- student(X).
-^ In just a few more lectures, we’ll be able to dothis... •^ ...
-^ A formal grammar enables us to logically break downa sentence into its constituent parts
X-bar phrase structure constituent labelsC2 = CP = S-bar (clause)I2 = S (sentence)VP = Verb PhraseV = VerbNP = Noun PhraseDET = determinerN1 = Noun (bar level 1)
-^ A formal grammar enables us to logically break downa sentence into its constituent parts
X-bar phrase structure subject: [
[^ I2^ NP
john] I1 ]
VP:^ is a student copula:
is complement of VP:[^ [^ NP^ DET
a][^ N
student]] (predicate NP)
-^ A formal grammar enables us to logically break downa sentence into its constituent parts
X-bar phrase structure specifier of CP: [
[^ CP^ NP
who] C1 ]
head of CP: C: auxiliary verb
is
subject: [
[^ I2^ NP
trace] I1 ]
subject is coindexed [1] withspecifier of CPVP: [
trace]V
a student verb (trace) is coindexed [2] with is complement of VP:[^ [^ NP^ DET
a][^ N
student]]
-^ We could but don’t have to specifically use X-barphrase structure to diagram sentences–
idea that all phrases have regular internal structure – [^ XP^ specifier
[^ [^ X1^ X
head
]^ complement
]]
-^ Simple rules: •^ SBar
→^ is
-^ NP
→^ ProperNoun
-^ ProperNoun
→^ John
-^ DET
→^ a
-^ N
→^ student
subjectobject
student]pred^
likes] Marypred^
happy]pred^
-^ which is the
predicate
likes
)
is^ (copula carries (^) little meaning)
the^
student
-^ Rules
-^ SBar
→^ WhNoun Aux S
-^ WhNoun
→^ who
-^ Aux
→^ is
-^ S
→^ NPtrace VP
-^ NPtrace
→ε
-^ VP
→^ Vtrace NP
-^ Vtrace
→ε
-^ NP
→^ DET N
-^ DET
→^ a
-^ N
→^ student
subject^ empty
object
plus associations by coindexation betweentraces and contentful items
-^ for later this week– handout– Chapter 2:
Putting a Meaning Together from Pieces
http://en.wikipedia.org/wiki/Phrase_structure_rules
-^ Thursday– there will be a 15 minute quiz at the end of class