Skip to content

Commit

Permalink
Grounding: add TheKitchen construction
Browse files Browse the repository at this point in the history
5/25/2021: A new TheKitchen construction was added to help getting "the kitchen" to ground either to the world or to smem. This adds five rules and works very nicely without any other changes. Part of the trace of running this in Rosie shows the preference based on lexicals, demonstrating semantic precision, and looks like this:

Received word #1: go
Matched a SimpleAction construction. C952
Received word #2: to
Received word #3: the
Received word #4: kitchen
Prefer >span: TheKitchen(2) > BareNoun(1).
Prefer >span: SpecNoun(2) > BareNoun(1).
Prefer >lexicals: TheKitchen(2) > SpecNoun(0).
Matched a TheKitchen construction. C971
Matched a SimplePrepPhrase construction. C975
Snipping C952 to get to C951 .
Attach PrepPhrase C975 to DriveVerb C951 .
Matched a DriveVerbToTarget construction. C977
Sentence #2: "go to the kitchen"

This makes "the kitchen" work very similarly to "the main office", whose trace looks like this:

Received word #1: go
Matched a SimpleAction construction. C1101
Received word #2: to
Received word #3: the
Received word #4: main
Received word #5: office
Prefer >span: TheMainOffice(3) > BareNoun(1).
Prefer >span: PropertyNoun(2) > BareNoun(1).
Prefer >span: SpecPropNoun(3) > BareNoun(1).
Prefer >lexicals: TheMainOffice(3) > SpecPropNoun(0).
Prefer >span: SpecPropNoun(3) > PropertyNoun(2).
Prefer >span: TheMainOffice(3) > PropertyNoun(2).
Matched a TheMainOffice construction. C1125
Matched a SimplePrepPhrase construction. C1129
Snipping C1101 to get to C1100 .
Attach PrepPhrase C1129 to DriveVerb C1100 .
Matched a DriveVerbToTarget construction. C1131
Sentence #2: "go to the main office"
  • Loading branch information
PLindes committed May 25, 2021
1 parent 0e0cda6 commit 2cc55b0
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 0 deletions.
18 changes: 18 additions & 0 deletions agent/lucia/Grammar/Rosie/ecg/x-nouns.ecg
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,24 @@ construction OFFICE
self.f.orth <-- "office"
meaning: Office

// PL 5/24/2021
// Several constructions needed to make map locations
// semantically specific enogh to ground properly
// in both the world and smem. Otherwise the RefDesc
// does not have the necessary information at the top
// level because much of it is in the noun.
construction TheKitchen
subcase of SpecifierNP
constructional
constituents
spec : THE
noun : KITCHEN
meaning: Kitchen
constraints
self.m.name <--> noun.m.schema-name
self.m.category <--> noun.m
self.m.givenness <--> spec.m.givenness

// PL 12/21/2020 MAIN-OFFICE is being depricated.
// It is replaced by TheMainOffice
//construction MAIN-OFFICE
Expand Down
103 changes: 103 additions & 0 deletions agent/lucia/Grammar/Rosie/soar/x-nouns.soar
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,109 @@ sp {comprehend-word*apply*lexical-access*OFFICE-office
^target <meaning>)
}

# Propose an operator for the TheKitchen construction
sp {comprehend-word*propose*match-construction*TheKitchen
(state <s> ^problem-space comprehend-word
^lexical-access done)
# Look for the constituents
(<s> ^cxn <noun>)
(<noun> ^is.a KITCHEN
^previous <spec>)
(<spec> ^is.a THE
^previous <previous>)
-->
(<s> ^operator <o> +)
(<o> ^name match-construction
^type construction
^cxn-name TheKitchen
^span 2
^lexicals 2
^noun <noun>
^spec <spec>
^previous <previous>
^debug-info (concat |Match a TheKitchen construction, combination 0.|))
}

# Apply the operator for the TheKitchen construction
sp {comprehend-word*apply*match-construction*TheKitchen
(state <s> ^problem-space comprehend-word
^operator <o>)
(<o> ^name match-construction
^cxn-name TheKitchen
^spec <spec>
^noun <noun>
^previous <previous>)
-->
(<s> ^cxn-new <cxn-new>)
(<cxn-new> ^cxn-name TheKitchen
^is <a>
^f <form>
^m <meaning>
^subcase-of SpecifierNP
^constituents <constituents>
^spec <spec>
^noun <noun>
^evokes <e-meaning>
^previous <previous>)
(<a> ^a TheKitchen)
(<constituents> ^spec <spec>
^noun <noun>)
(<e-meaning> ^schema Kitchen
^target <meaning>)
# Write a message for the construction that matched.
(write (crlf) (concat |Matched a TheKitchen construction.|))
}

# TheKitchen self.m.name <--> noun.m.schema-name constraint
sp {comprehend-word*TheKitchen-constraint*self-m-name*UNIFY*noun-m-schema-name
(state <s> ^problem-space comprehend-word
^operator <o>
^cxn-new <cxn>)
(<o> ^type construction)
(<cxn> ^is.a TheKitchen
^m <l-slot1>
^noun <r-slot1>)
(<l-slot1> ^name { <target> <> <value> })
(<r-slot1> ^m <r-slot2>)
(<r-slot2> ^schema-name <value>)
-->
(<l-slot1> ^name <target> -
^name <value>)
}

# TheKitchen self.m.category <--> noun.m constraint
sp {comprehend-word*TheKitchen-constraint*self-m-category*UNIFY*noun-m
(state <s> ^problem-space comprehend-word
^operator <o>
^cxn-new <cxn>)
(<o> ^type construction)
(<cxn> ^is.a TheKitchen
^m <l-slot1>
^noun <r-slot1>)
(<l-slot1> ^category { <target> <> <value> })
(<r-slot1> ^m <value>)
-->
(<l-slot1> ^category <target> -
^category <value>)
}

# TheKitchen self.m.givenness <--> spec.m.givenness constraint
sp {comprehend-word*TheKitchen-constraint*self-m-givenness*UNIFY*spec-m-givenness
(state <s> ^problem-space comprehend-word
^operator <o>
^cxn-new <cxn>)
(<o> ^type construction)
(<cxn> ^is.a TheKitchen
^m <l-slot1>
^spec <r-slot1>)
(<l-slot1> ^givenness { <target> <> <value> })
(<r-slot1> ^m <r-slot2>)
(<r-slot2> ^givenness <value>)
-->
(<l-slot1> ^givenness <target> -
^givenness <value>)
}

# Propose an operator for the TheMainOffice construction
sp {comprehend-word*propose*match-construction*TheMainOffice
(state <s> ^problem-space comprehend-word
Expand Down

0 comments on commit 2cc55b0

Please sign in to comment.