Tracing the Unifier
LISP> (trace-on)
LISP> (uni (get-test 'i1))
>========================================
>STARTING CAT CLAUSE AT LEVEL {}
>========================================
-->Entering alt GSIMPLE -- Jump indexed to branch #1: CLAUSE matches input CLAUSE
-->Updating (CAT NIL :E) with NP at level {AGENT CAT}
-->Updating (CAT NIL :E) with NP at level {AFFECTED CAT}
-->Updating (CAT NIL :E) with VERB-GROUP at level {ACTION CAT}
-->Enriching input with (NUMBER {AGENT NUMBER} NIL) at level {ACTION}
-->Enriching input with (CSET (ACTION AGENT AFFECTED) NIL) at level {}
-->Enriching input with (PATTERN (AGENT ACTION AFFECTED) NIL) at level {}
-->Success with branch #1 CLAUSE in alt GSIMPLE
>Expanding constituent {} into cset ({AFFECTED} {AGENT} {ACTION}).
>
>========================================
>STARTING CAT NP AT LEVEL {AFFECTED}
>========================================
-->Entering alt GSIMPLE -- Jump indexed to branch #2: NP matches input NP
-->Updating (CAT NIL :E) with NOUN at level {AFFECTED HEAD CAT}
-->Enriching input with (LEX {AFFECTED LEX} NIL) at level {AFFECTED HEAD}
---->Entering alt NP-NUMBER -- Branch #1
---->Updating (NUMBER NIL :E) with SINGULAR at level {AFFECTED NUMBER}
---->Success with branch 1 in alt NP-NUMBER
-->Updating (PROPER NIL :E) with YES at level {AFFECTED PROPER}
-->Enriching input with (PATTERN (HEAD) NIL) at level {AFFECTED}
-->Success with branch #2 NP in alt GSIMPLE
>Expanding constituent {AFFECTED} into cset ({AFFECTED HEAD}).
>
>========================================
>STARTING CAT NP AT LEVEL {AGENT}
>========================================
-->Entering alt GSIMPLE -- Jump indexed to branch #2: NP matches input NP
-->Updating (CAT NIL :E) with NOUN at level {AGENT HEAD CAT}
-->Enriching input with (LEX {AGENT LEX} NIL) at level {AGENT HEAD}
---->Entering alt NP-NUMBER -- Branch #1
---->Updating (NUMBER NIL :E) with SINGULAR at level {AGENT NUMBER}
---->Success with branch 1 in alt NP-NUMBER
-->Fail in trying NO with YES at level {AGENT PROPER}
-->Enriching input with (PATTERN (DET HEAD) NIL) at level {AGENT}
-->Updating (CAT NIL :E) with ARTICLE at level {AGENT DET CAT}
-->Updating (LEX NIL :E) with "the" at level {AGENT DET LEX}
-->Success with branch #2 NP in alt GSIMPLE
>Expanding constituent {AGENT} into cset ({AGENT HEAD} {AGENT DET}).
>
>========================================
>STARTING CAT VERB-GROUP AT LEVEL {ACTION}
>========================================
-->Entering alt GSIMPLE -- Jump indexed to branch #3: VERB-GROUP matches input VERB-GROUP
-->Enriching input with (PATTERN (V) NIL) at level {ACTION}
-->Updating (AUX NIL :E) with NONE at level {ACTION AUX}
-->Updating (CAT NIL :E) with VERB at level {ACTION V CAT}
-->Enriching input with (LEX {ACTION LEX} NIL) at level {ACTION V}
-->Success with branch #3 VERB-GROUP in alt GSIMPLE
>Expanding constituent {ACTION} into cset ({ACTION V}).
>Constituent {AFFECTED HEAD} is a leaf.
>Constituent {AGENT HEAD} is a leaf.
>
>========================================
>STARTING CAT ARTICLE AT LEVEL {AGENT DET}
>========================================
-->Entering alt GSIMPLE -- Jump indexed to branch #4: ARTICLE matches input ARTICLE
-->Success with branch #4 ARTICLE in alt GSIMPLE
>Constituent {AGENT DET} is a leaf.
>Constituent {ACTION V} is a leaf.
[Used 6 backtracking points - 1 wrong branches - 0 undos]
>Constituent {AFFECTED HEAD} is a leaf.
>Constituent {AGENT HEAD} is a leaf.
>Constituent {ACTION V} is a leaf.
[Used 6 backtracking points - 1 wrong branches - 0 undos]
The system advises John.
When unification fails:
FUG5(11): (def-test i2
""
((cat clause)
(agent ((lex "John") (number singular)))
(action ((lex "advise") (number plural)))
(goal ((lex "Mary")))))
FUG5(12): (test :item 'i2)
====================
I2 --> ""
>
>========================================
>STARTING CAT CLAUSE AT LEVEL {}
>========================================
-->Entering alt GSIMPLE -- Jump indexed to branch #1: CLAUSE matches input CLAUSE
-->Updating (CAT NIL :E) with NP at level {AGENT CAT}
-->Updating (CAT NIL :E) with NP at level {AFFECTED CAT}
-->Updating (CAT NIL :E) with VERB-GROUP at level {ACTION CAT}
-->Fail in trying PLURAL with SINGULAR at level {ACTION NUMBER}
OK
====================
Less verbose trace:
LISP> (trace-level 30) ;; This only indicates failures in alt branches
LISP> (test :item 'i1)
====================
I1 --> "The system advises John."
[Used 6 backtracking points - 1 wrong branches - 0 undos]
[Used 6 backtracking points - 1 wrong branches - 0 undos]
OK
====================
FUG5(15): (trace-level 20) ;; This shows progression of constituent structure
20
FUG5(16): (test :item 'i1)
====================
I1 --> "The system advises John."
>
>========================================
>STARTING CAT CLAUSE AT LEVEL {}
>========================================
>Expanding constituent {} into cset ({AFFECTED} {AGENT} {ACTION}).
>========================================
>STARTING CAT NP AT LEVEL {AFFECTED}
>========================================
>Expanding constituent {AFFECTED} into cset ({AFFECTED HEAD}).
>========================================
>STARTING CAT NP AT LEVEL {AGENT}
>========================================
>Expanding constituent {AGENT} into cset ({AGENT HEAD} {AGENT DET}).
>========================================
>STARTING CAT VERB-GROUP AT LEVEL {ACTION}
>========================================
>Expanding constituent {ACTION} into cset ({ACTION V}).
>Constituent {AFFECTED HEAD} is a leaf.
>Constituent {AGENT HEAD} is a leaf.
>========================================
>STARTING CAT ARTICLE AT LEVEL {AGENT DET}
>========================================
>Constituent {AGENT DET} is a leaf.
>Constituent {ACTION V} is a leaf.
[Used 6 backtracking points - 1 wrong branches - 0 undos]
>Constituent {AFFECTED HEAD} is a leaf.
>Constituent {AGENT HEAD} is a leaf.
>Constituent {ACTION V} is a leaf.
[Used 6 backtracking points - 1 wrong branches - 0 undos]
OK
====================
CAT VERB |
ENDING: | {ROOT, INFINITIVE, PAST-PARTICIPLE, PRESENT-PARTICIPLE} |
NUMBER: | {SINGULAR, PLURAL} |
PERSON: | {FIRST, SECOND, THIRD} |
TENSE : | {PRESENT, PAST} |
CAT NOUN |
NUMBER: | {SINGULAR, PLURAL} |
POSSESSIVE: | {YES, NO} |
A-AN: | {AN, CONSONANT} |
CAT PRONOUN |
PRONOUN-TYPE: | {PERSONAL, DEMONSTRATIVE, QUESTION,
QUANTIFIED} |
CASE: | {SUBJECTIVE, POSSESSIVE, OBJECTIVE, REFLEXIVE} |
GENDER: | {MASCULINE, FEMININE, NEUTER} |
PERSON: | {FIRST, SECOND, THIRD} |
NUMBER: | {SINGULAR, PLURAL} |
DISTANCE: | {NEAR, FAR} |
CAT ARTICLE |
NUMBER: | {SINGULAR, PLURAL} |
DEFINITE: | {YES, NO} |
A-AN: | of following word. |
PUNCTUATION |
BEFORE: | {";", ",", ":", "(", ")", ...} |
AFTER : | {";", ",", ":", "(", ")", ...} |
ORDINAL, CARDINAL |
VALUE: | a number |
DIGIT: | {YES, NO} |