This little story illustrates the use of Algernon to represent the meaning of a simple narrative. It creates frames to represent the individuals involved, asserts and deduces relationships among them.
An important feature is the use of definite descriptions to retrieve the individual about which an assertion should be made. In Algernon, a definite description is an access path that is believed to be adequate, in context, to specify a unique individual.
It is worth noting how easily the Algernon access paths could be derived from the English sentences they correspond to.
Since definite descriptions require context, we create a frame with true-name ja-story to represent the current story, and put it into the current slot of the global context frame, which is named *context*. When the frame bound to ?ja-story is first created, it belongs to no sets, but the domains associated with the relation current allow Algernon to infer that it belongs to the set contexts.
(tell '((:create ?ja-story ja-story) (:clear-slot *context* current) (current *context* ?ja-story)))
The effect of tell is a change to the structure of the Algernon knowledge-base. With appropriate trace switches set, Algernon will also print a trace message, a description of the set of bindings created by the assertion or query, and a list of newly created frames.
Once the frame representing the speaker has been found, facts such as name and age can be asserted to it.
(tell '((:the ?me (speaker (current *context*) ?me)) (name ?me "John Alden")) :comment "My name is John Alden.") (tell '((:the ?me (speaker (current *context*) ?me)) (age ?me 25 years)) :comment "I am 25 years old.")
Any mentioned frame, other than the speaker, is added to the recent slot of the current context, for later retrieval using third person pronouns. This serves as a place-holder for a more serious focus mechanism.
(tell '((:the ?me (speaker (current *context*) ?me)) (:the ?w (wife ?me ?w)) (age ?w 23 years) (recent (current *context*) ?w)) :comment "My wife is 23 years old.")
The following example of trace output was produced by this assertion. A single set of bindings resulted from asserting the given access path, and those bindings are shown. The variables ?$x13 and ?$x14 were automatically generated to represent the results of retrieving (current *context*). The variable ?me is bound to the frame frame1, which is the true name of the frame describing John Alden. The name slot of frame1 holds the string "John Alden", so that is shown. The variable ?w is bound to the frame frame1-wife, which was created without a public name, though we will learn it in the next sentence.
ASSERTING: My wife is 23 years old. Input preds: (:the ?me (speaker (current *context*) ?me)) (:the ?w (wife ?me ?w)) (age ?w 23 years) (recent (current *context*) ?w) Result: Bindings: ?$x14 --- ja-story ?w --- frame1-wife ?me --- frame1 "john alden" ?$x13 --- ja-story Created frame: frame1-wife => T
(tell '((:the ?her (recent (current *context*) ?her) (gender ?her female)) (name ?her "Priscilla")) :comment "Her name is Priscilla.")
(tell '((:the ?she (recent (current *context*) ?she) (gender ?she female)) (:forc ?ms (friend ?she ?ms) (name ?ms "Miles Standish") (gender ?ms male)) (recent (current *context*) ?ms)) :comment "She has a friend named Miles Standish.")
(tell '((:the ?he (recent (current *context*) ?he) (gender ?he male)) (age ?he 40 years)) :comment "He is 40 years old.")
(tell '((:forc ?cm (friend Priscilla ?cm) (name ?cm "Cotton Mather") (gender ?cm male)) (recent (current *context*) ?cm)) :comment "Priscilla also has a friend named Cotton Mather.")