Dialog 001: rules

Utterances
----------

Utterance Common Knowledge
--------------------------

  (subtype declarative-sentence utterance)
  (subtype command utterance)
  (subtype exclamation utterance)
  (subtype question utterance)
  (subtype compound-sentence utterance)

  (subtype question-where-is question)
  (member geography where-is-loc) 
  (member on-his-body where-is-loc)
  (member on-issue where-is-loc)

Utterance Rules
---------------

These rules operate on utterances.  They are domain independent
but assume that domain dependent information is available.

They are expressed using beliefs and expectations.
There is no reification here.

It is my opinion that this is incorrect and
it is unclear how operationally they might be applied.

(focus ?A1 (characterize-conversation ?C ?U ?W ?WL ?PS)
  (belief ?A1 (isA ?C conversation))
  (belief ?A1 (isA ?U utterance))
  (belief ?A1 (1st ?C ?U))
  (belief ?A1 (vocabulary-includes ?U ?W))
  (belief 'A1 (member ?W ?PL))
    (belief ?A1 (isA ?PL problem-list))
  (belief 'A1 (subject ?PL ?SUBJUCT))
    (belief ?A1 (isA ?SUBJECT subject))
  (expectation ?A1 (subject ?C ?SUBJECT))
)

(focus ?A1 (utterance-start-request-for-help
    ?C ?U ?A2 ?A3 ?PROBLEM ?W ?PL ?SUBJECT)
  (belief ?A1 (isA ?C conversation))
  (belief ?A1 (isA ?U utterance))
  (belief ?A1 (1st ?C ?U))
  (belief ?A1 (said-by ?U ?A2))
  (belief ?A1 (said-to ?U ?A3))
  (belief ?A1 (vocabulary-includes ?U ?W))
  (belief 'A1 (member ?W ?PL))
    (belief ?A1 (isA ?PL problem-list))
  (belief 'A1 (subject ?PL ?SUBJUCT))
    (belief ?A1 (isA ?SUBJECT subject))
  (belief ?A1 (can-help ?A3 ?PROBLEM))
  (belief ?A1 (subject ?C ?SUBJECT))
  (expectation ?A2 (isA ?SA request-for-help))
  (expectation ?A2 (from ?SA ?U))
  (expectation ?A2 (subject ?SA ?PROBLEM)
)

;; in addition to stating one case where
;;   we can interpret a sentence as an inform
;; this incudes an explaination of how we go
;;   from the statement "a person whose is injured"
;;   to the relation (injured P1) 
;; in a domain neutral way
(focus ?A1 (utterance-have-to-sa-inform 
    ?U ?A2 ?DS ?REL1 ?SUBJ ?PERSON ?PROBLEM ?SUBJECT ?PL ?RELSYM ?SA ?REL2)
  (belief ?A1 (isA ?U utterance))
  (belief ?A1 (isA ?A2 agent))
  (belief ?A1 (said-by ?A2))
  (belief ?A1 (content-of ?U ?DS))
  (belief ?A1 (isA ?DS declarative-sentence)
  (belief ?A1 (statement ?DS ?REL)
  (belief ?A1 (isA ?REL relation)
  (belief ?A1 (nlp-verb ?REL have)
  (belief ?A1 (nlp-subject ?REL ?SUBJ)
  (belief ?A1   (isA ?SUBJ pronoun)
  (belief ?A1   (pronomial-referent ?SUBJ ?A2)
  (belief ?A1 (nlp-direct-object ?REL ?PERSON)
  (belief ?A1   (isA ?PERSON person)
  (belief ?A1   (problem-of ?PERSON ?PROBLEM)
  (belief ?A1     (isA ?PROBLEM problem)
  (belief ?A1 (subject C ?SUBJECT)
  (belief ?A1   (isA ?SUBJECT subject)
  (belief ?A1 (problem-list ?PL ?SUBJECT)
  (belief ?A1   (isA ?PL problem-list)
  (belief ?A1 (member ?PROBLEM ?PL)
  (belief ?A1 (relsym-of ?PROBLEM ?RELSYM)
  (expectation ?A1 (isA ?SA inform))
  (expectation ?A1 (from ?SA ?U))
  (expectation ?A1 (content ?SA ?REL2)
  (expectation ?A1 (isA ?REL2 relation)
  (expectation ?A1 (relsym ?REL2 ?RELSYM)
  (expectation ?A1 (arg1 ?RE2 ?PERSON)
)
  
(focus ?A1 (overhears ?C ?U ?A2 ?A3)
  (belief ?A1 (isA ?C conversation)) 
  (belief ?A1 (isA ?U utterance))
  (belief ?A1 (isA ?A2 agent))
  (belief ?A1 (isA ?A3 agent))
  (belief ?A1 (can-hear ?A3 ?A2))
  (expectation ?A1 (hears ?A3 ?U1))
)

(focus ?A1 (speaks-the-truth ?C ?U ?UC ?A2) 
  (belief ?A1 (isA ?C conversation)) 
  (belief ?A1 (isA ?U utterance))
  (belief ?A1 (isA ?REL relation)
  (belief ?A1 (isA ?A2 agent))
  (belief ?A1 (content U? ?UC)
  (belief ?A1 (trusts ?A2))
  (belief ?A1 (said ?A2 ?U))
  (expectation ?A1 ?REL)
)

Speech Acts
-----------

The idea of these rules are to describe the changes
to working memory given the existence of various
speech acts.  We interpret speech acts as the 'meanings'
of utterances not actions.

Again these rules do not contain any reifications. 

  General Knowledge
  -----------------
  (informed-by ?A ?REL) <== (isA ?SA inform) (content ?SA ?PEL) 

  (sybtype inform speech-act)
  (subtype request-for-action speech-act)
    (subtype request-for-help request-for-action)
  (subtype question speech-act)
    (subtype question-location question))
      (subtype where-is question-location)
        (subtype where-on-body where-is)
    (subtype question-which-is-larger question))
  (subtype answer speech-act)
    (subtype answer-location answer))
      (subtype answer-where-is answer-location)
        (subtype Answer-where-on-body answer-where-is)
  (subtype suggestion-to-act speech-act)

;; this rule states:   
;;  if (and
;;    ?U means ?SA which is a request-for-help with a ?PROBLEM
;;    everyony is cooperating )
;;  then (and
;;    everyone could expect a solution
;;    the helper has the goal to help      
;;         
(focus ?A1 (sa-request-for-help ?SA ?U ?PROBLEM ?REQUESTER ?HELPER)  
  (belief ?A1 (isA ?U utterance)) 
  (belief ?A1 (said-by ?U ?A2)) 
  (belief ?A1 (said-to ?U ?A3))
  (belief ?A1 (isA SA request-for-help))
  (belief ?A1 (from ?SA ?U))
  (belief ?A1 (subject ?SA ?PROBLEM)
  (belief ?A1 (mutual-trust ?A1 ?REQUESTER ?A3))   
  (belief ?A1 (all-can-hear ?U ?A1 ?REQUESTER ?A3))   
  (belief ?A1 (can-help ?HELPER ?PROBLEM)
  (expectation ?A (expectation ?A1 (solved ?REQUESTER ?PROBLEM))
  (expectation ?A (expectation ?REQUESTER (solved ?REQUESTER ?PROBLEM))
  (expectation ?A (expectation ?HELPER (solved ?REQUESTER ?PROBLEM))
  (expectation ?A (goal ?HELPER (help-solve ?REQUESTER ?PROBLEM))
)

(focus ?A1 (sa-inform  ?SA ?U ?REL ?A2 ?A3) 
  (belief ?A1 (isA ?SA inform)) 
  (belief ?A1 (isA ?U utterance)) 
  (belief ?A1 (from ?SA ?U))
  (belief ?A1 (content ?SA ?REL))
  (belief ?A1 (said-by ?U ?A2))
  (belief ?A1 (said-to ?U ?A3))
  (in-belief ?A1 (mutual-trust ?A1 ?A2 ?A3))   
  (in-belief ?A1 (all-can-hear ?U1 ?A1 ?A2 ?A3))   
  (expectation ?A1 ?REL)
  (expectation ?A1 (belief ?A2 ?REL)
  (expectation ?A1 (belief ?A3 ?REL)
  ) )

;; without reifification we cannot timestamp things explicitly
;; which would be reasonable here *as opposed to will-...
  (expectation ?A1 (belief ?ANSWERER (found-naswer ?ANSWERER ?Q))
  (expectation ?A1 (expectation ?ANSWERER (will-reply-to-question ?ANSWERER ?Q))
  (expectation ?A1 (expectation ?ASKER (will-reply-to-question ?ANSWERER ?Q))
)

=================================================================================

;; this amounts to 
;; if ?A1 believes that ?ANSWERER has found-answer to ?Q
;; then
;; ?ANSWERER will report that answer to ?ASKER  
(focus ?A1 (replyed-to-question (?U ?Q ?ASKER ?ANSWERER ?ANS) 
  (isA ?U utterance)
  (isA ?Q question)
  (isA ?ASKER agent)
  (isA ?ANSWERER agent)
  (content-od ?U ?Q)
  (said-by ?U ?ASKER) 
  (said-to ?U ?ANSWERER) 
  (belief ?A1 (belief ?ANSWERER (heard ?ANSWERER ?U))
  (belief ?A1 (Belief ?ANSWERER (isAnswer ?Q ?ANS)))
  (belief ?A1 (belief ?ANSWERER (isA ?ANS answer)))
  (expectation ?A1 (belief ?ANSWERER (found-answer ?ANSWERER ?Q)))
  (expectation ?A1 (belief ?ANSWERER (will-reply-to-question ?ASKER ?Q)))
  (expectation ?A1 (expectation ?ANSWERER (replyed-to-question ?ASKER ?Q)))  
  (expectation ?A1 (belief ?A1 (found-naswer ?ANSWERER ?Q))
)