From 2cc55b0279c8b985526e5d8096d7dcfac8f24af5 Mon Sep 17 00:00:00 2001 From: Peter Lindes Date: Tue, 25 May 2021 10:10:02 -0600 Subject: [PATCH] Grounding: add TheKitchen construction 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" --- agent/lucia/Grammar/Rosie/ecg/x-nouns.ecg | 18 ++++ agent/lucia/Grammar/Rosie/soar/x-nouns.soar | 103 ++++++++++++++++++++ 2 files changed, 121 insertions(+) diff --git a/agent/lucia/Grammar/Rosie/ecg/x-nouns.ecg b/agent/lucia/Grammar/Rosie/ecg/x-nouns.ecg index 274063df4a..7dd8d03198 100644 --- a/agent/lucia/Grammar/Rosie/ecg/x-nouns.ecg +++ b/agent/lucia/Grammar/Rosie/ecg/x-nouns.ecg @@ -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 diff --git a/agent/lucia/Grammar/Rosie/soar/x-nouns.soar b/agent/lucia/Grammar/Rosie/soar/x-nouns.soar index 2e5986e3d1..12ac48678e 100644 --- a/agent/lucia/Grammar/Rosie/soar/x-nouns.soar +++ b/agent/lucia/Grammar/Rosie/soar/x-nouns.soar @@ -228,6 +228,109 @@ sp {comprehend-word*apply*lexical-access*OFFICE-office ^target ) } +# Propose an operator for the TheKitchen construction +sp {comprehend-word*propose*match-construction*TheKitchen + (state ^problem-space comprehend-word + ^lexical-access done) + # Look for the constituents + ( ^cxn ) + ( ^is.a KITCHEN + ^previous ) + ( ^is.a THE + ^previous ) +--> + ( ^operator +) + ( ^name match-construction + ^type construction + ^cxn-name TheKitchen + ^span 2 + ^lexicals 2 + ^noun + ^spec + ^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 ^problem-space comprehend-word + ^operator ) + ( ^name match-construction + ^cxn-name TheKitchen + ^spec + ^noun + ^previous ) +--> + ( ^cxn-new ) + ( ^cxn-name TheKitchen + ^is + ^f
+ ^m + ^subcase-of SpecifierNP + ^constituents + ^spec + ^noun + ^evokes + ^previous ) + ( ^a TheKitchen) + ( ^spec + ^noun ) + ( ^schema Kitchen + ^target ) + # 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 ^problem-space comprehend-word + ^operator + ^cxn-new ) + ( ^type construction) + ( ^is.a TheKitchen + ^m + ^noun ) + ( ^name { <> }) + ( ^m ) + ( ^schema-name ) +--> + ( ^name - + ^name ) +} + +# TheKitchen self.m.category <--> noun.m constraint +sp {comprehend-word*TheKitchen-constraint*self-m-category*UNIFY*noun-m + (state ^problem-space comprehend-word + ^operator + ^cxn-new ) + ( ^type construction) + ( ^is.a TheKitchen + ^m + ^noun ) + ( ^category { <> }) + ( ^m ) +--> + ( ^category - + ^category ) +} + +# TheKitchen self.m.givenness <--> spec.m.givenness constraint +sp {comprehend-word*TheKitchen-constraint*self-m-givenness*UNIFY*spec-m-givenness + (state ^problem-space comprehend-word + ^operator + ^cxn-new ) + ( ^type construction) + ( ^is.a TheKitchen + ^m + ^spec ) + ( ^givenness { <> }) + ( ^m ) + ( ^givenness ) +--> + ( ^givenness - + ^givenness ) +} + # Propose an operator for the TheMainOffice construction sp {comprehend-word*propose*match-construction*TheMainOffice (state ^problem-space comprehend-word