Modeling Dialog in ICARUS using abductive reasoning
Beliefs intentions
goals actions
Pat proposed looking at the already used dialog (which I have
annotated
M - We have an injured person.
assertion + (indirect Speech act - ask-for-help)
M goal (goal M (stabalize :p)) <== (believes M (injured :p))
M (belief M (ask-for-help M C (*(injured :p)) <== (goal M (stabalize :p))
G ask-for-help (X Y S)
before (ask-for-help X Y S)
do (let ((ts (timestamp-make X (now))) )
(say X S ts)
(listen-for-responses X Y ts)
)
after ()
G action listen (X Y S ts)
before (hear X (say Y S ts))
do (let ((ts-now (timestamp-make X now))
(name belief-make-name('reqponse X ts)) )
(add-belief X Y
(belief-make(name,
S,name,assumption-source('heard Y ts)) )
(heard-by X ts-now) ) )
after (believes X S)
M intention (inform C (injured P1))
C - Where is the injury?
whereis-question
location-question (whereis - restricted to a persons body)
C goal (goal (provide-help C Y :issue) <== (hear C (say Y
M - He is bleeding from the left leg and torso
Assertion (of medic belief)
in medical terms - a problem and its locationa
Answer to where-is-question
C - How bad is the bleeding?
quantative-judgement question
C - Okay, use a tourniquet to stop the bleeding.
remark to oneself
Suggestion-to-act - made by C - addressed to M
M - Right, where shall I put it?
acknowledgement +
` request-for-action-parameter
C - Just below the joint above the wound. Keep turning until it stops bleeding.
answer (action paramwter) +
request-to act C ==> M
M - Okay, the bleeding has stopped.
acknowledgement +
assertion (of action success)
Preliminary amateur ananysis
My view is that we should imagine each 'believer' to be a seperate 'instance' of
the cognative articture (ICARUS) from that point of view there are th4ee 'agants':
1) are we the "computer" who also makes plans and instructs the "medic" or
2) are we the "medic" who is consultig with the "computer" to beter help his patient
3) are we simply "a third person" overhearing and trying to make sense
of o conversation lisr
I started out a as modeling 3) since my 'job' was to understand the content free parts
of the system and 3 doesn't need to know antthing about medicine!!! After reding the
docs and talking with Will I realized that the papers all have rules about medicine and
thus MUST be modeling the understanding of the "computer". So I have redone the
analysis from the point of view of the "computer".
This leads to the next collection of issues, namely
1) where is the agreement about what he computer calls the patient?
in the dislog the patient is refered to but not named
2) the dialog contains many pronouns. Who and where are these disambiguated?
Will imagines that there is a seperate module that does this an we get it already done
So somewhere we come to know there are two speakers, M and C, a paient, the injured one,
P1, and possibly an onlooker, O.
There are three 'instances' of CA: M C AND O
initial assumptions (in all)
Common Language of expressions
; ? is ICARUS case sensitive?
(declare-indvar "p" [person])
(declare-indvar "e" [expression])
(declare-indvar "b" [belief])
; For simplicity I have anthropomorphized the computer
(declare-indconst me C M P1 [person])
(declare-recognizer BELIEF?)
(declare-funsym belief-get-name ([belief-name],[belief])
(declare-funsym belief-get-expression ([expression],[belief])
(declare-funsym belief-get-assumption ([assumption],[belief])
(declare-funsym belief-get-reason ([reason],[belief])
(declare-funsym belief-get-timestamp ([timestamp],[belief])
(declare-funsym beliefs `(listOf[belief],[person]) )
(declare-relsym Trusts 1)
(declare-relsym Can-Hear Believes 2)
General Knowledge
(Trusts me)
(Can-Hear me me)
Definitions of relations
(def-rel (Believes p e)
(exists b (and (member b (beliefs p)) (= (belief-get-expr b) e)))
(def-goal deal-with-issue (
(def-action seek-advice (p1 p2)
(before
(believes p1 (has-issue :issue))
(believes p1 (adviser p2 p1 :issue))
)
(do
(say p1 (tell-me-about :issue) (remember ts (timestamp p1)) )
)
(after
(believes p1 (said (tell-me-about :issue) ts) )
(believes p1 (heard p2 (tell-me-about :issue) ts) )
(believes p1 (believes p2 (tell-me-about :issue) ts) )
(forall p
(if
(in-conversation me p)
then
(and
(can-hear me p)
(can-hear p me) ) ) )
(forall p1 p2)
(if
(overhears me p1 p2)
then
(and
(can-hear me p1)
(can-hear me p2) ) ) )
(forall p (= me P))
--In M---------------------------
(= me M)
(Trust C)
--In C------------------------
(= me C)
(Trust me)
(Trust M)
--In C---------------------------
(= me C)
--In M------------------------
(= me M)
(Trust me)
(Trust C)
--In O---------------------------
(= me O)
--In M------------------------
(= me M)
(Trust me)
(Trust C)
(within-hearing-distence me me)
(within-hearing-distence me C)
(within-hearing-distence C me)
--In C------------------------
(= me C)
(Trust me)
(Trust M)
--In C------------------------
(= me C)
(Trust me)
(Trust M)
(within-hearing-distence me me)
(within-hearing-distence me M)
(within-hearing-distence M me)
M - We have an injured person.
Assertion (of medic belief)
(hears C (say M '(injured P1)))
==>
((hears X (say Y S)) and (within-hearing-distence Z Y)) then (believes X (hears Y Z))
or as an skil
(in-believes me (in-beliefs C (hears C (say M '(injured P1)))))
==>
((hears X (say Y ,[statement]) and (trusts X Y)) then
(believes X (believes Y [statement]))
action
(before
(in-precepts X (hears Y (say Z S)))
(in-beliefs X '(trusts X Y))
(do
(add-belief X (in-beliefs Y S))
)
(after
(in-beliefs me in-beliefs Y S))
)
(believes X (believes M '(Injured P1)))
-->
action assume (X S)
(before)
(do
(add-belief X X
(after
(believes X (believes Y [statement]) then (assume Y [statement])
(believes X (knows Y [existential-statement])) then
(do (name existential])
(def-action
add-belief (person belief)
(believes X (believes Y S))
(add-belief X Y S)
(def-action name
(assume me (exists (p [person]) (injured p)))
(declare indconst P1 [person])
(add-belief me (Injured P1) EE)
(believes me (believes medic (injured Person)))
-In C--------------------------------------------
(Injured P1)
M beliefs
(Injured P1)
-In M--------------------------------------------
(injured P!)
C beliefs
(injured P1)
-In O--------------------------------------------
(injured P!)
C beliefs
(injured P1)
M beliefs
(injured P1)
`C - Where is the injury?
wh-question
Location-question (where is)
`
M - He is bleeding from the left leg and torso
Assertion (of medic belief)
Answer
C - How bad is the bleeding?
` quantity-question
How-bad question
quantative-judgement question
M - The leg is much worse
assertion (of medic belief)
answer
C - Okay, use a tourniquet to stop the bleeding.
Request/suggestion-to-act
by C
to M
M - Right, where shall I put it?
acknowledgement +
v location-question (where)
C - Just below the joint above the wound. Keep turning until it stops bleeding.
answer +
request-to act C ==> M
M - Okay, the bleeding has stopped.
acknowledgement +
assertion (of medic belief)
================================================================
as A second task I have 'taken notes' on
Modeling ICARUS and its abductive reasoning
Notation
(type ID
)
This allowes us to pass back and forth between the elementary
and non-elementary description o a type.
CA types
; define a cognative system
(type CS [CS]
(name :type [CSname])
(focus :type [CAname])
(types :type [TSys])
(comp-sys :type [Csys])
(CA :type [CA])
(type CS [Tsys]
(name [TsysName])
(named-types :type [typeSpec] :range [0-INF]
(typedefs :type [TypeDef] :range [0-INF])
)
(type CS [TypeSpec]
'(,[TypeName] ,[TypeDef])
)
(type CS [Csys]
(name LISP)
(programs :type [LispProgram] :range [0-INF]
)
(type CS [CA]
(name [CAname] :required)
(languade :type [lang])
(model :type [model])
(perceps :type [percept] :range [0-INF])
(beliefs Type [belief] :range [0-INF])
(actions :type [action] :range [0-INF])
(intensions :type [intension] [0-INF])
)
(deftype CA [CAname] subtype [symbol]
(lambda (s [symbol])
(string-split (symbol-name s) "CA" (string-lc-ascii (substring s 2))) )
)
(deftype CA [lang-model]
(individual-contant
:type `(let (tn ,[TypeName]) ,[IndConst] ,tn ,(example-of tn)) :range [0-INF])
(individual-var
:type `(,[Indvar] ,[TypeName])) :range [0-INF])
(function-symbol
:type `(lambda (a [ArgValSpec]} (,[Funsym] ,a ,program[a])) :range [0-INF])
(predicate-symbols
:type `(let (a .arity) (,[Relsym] ,a ,recognizer[a])) :range [0-inf])
(perception-symbol :type ,[Persym] :range [0-INF])
(action-name
:type `(let (an ,[actionName]) (,an ,action-with-name[an]) :range [0-INF])
(deftype CA [model]
(individual-contant :type example-of[[sexp] :range [0-INF] :split [lang].[INdconst])
(function-symbol :type [program][Funsym] ,[ArgSpec]) :range [0-INF])
(predicate-symbols :type `(,[Relsym] ,[arity]) :range [0-inf])
(perception-symbol :type ,[perceptsym]
(action-name :type ,[actionName] :range [0-INF])
;; belief are annotates sentenses
(deftype CA [belief]
(sentence [sentence])
(assumption ListOf[ID])
(reason [Reason])
(timestamp [Timestamp])
)
(deftype [reason]
(union [perception] ... )
)
(deftype [Perception]
'(hear ,[CA] ,[sentence])
`(say ,[CA] ,[sentence])
)
(deftype CA [lang]
(individual-contant :type `(,[IndConst] ,[TypeName]) :range [0-INF])
(individual-var :type `(,[Indvar] ,[TypeName]) :range [0-INF])
(function-symbol :type `(,[Funsym] ,[ArgSpec]) :range [0-INF])
(predicate-symbols :type `(,[Relsym] ,[arity]) :range [0-inf])
(perception-symbol :type ,[perceptsym]
(action-name :type ,[actionName] :range [0-INF])
(deftype CA [Indvar]
(deftype CA [Indconst]
(deftype CA [CAterm]
Or[ [Indvar]
[Indconst]
(lambda (f [funsym])
`(,f @,listn[arity(f),[term]) ) )
]
(deftype CA [CAawff]
(lambda (r [relsym])
`(,[Relsym] @,listn[arity(r),[term]) ) ) )
(deftype [CAwff]
Or[ [CAawff] ,
`(not ,[CAwff]) ,
`(and ,[CAwff] ,[CAwff]) ,
`(or ,[CAwff] ,[CAwff]) ,
`(iff ,[CAwff] ,[CAwff]) ,
(if ,[CAwff] ,[CAwff])
]
(attach CA [sentence]
(lambda (s)
(or
(name top 'me)
(use-lisp-funs *BasicLispFuns*)
(add-type
(add-program
(add-lang-model
(add-precept [CA] [label] [ground-percept] {opt [source]})
(add-belief [CA] [label] [belief] {opt [assumptions]} {opt [reason]})
CA precepts
(hear X S)
(say X S)
CA beliefs
core beliefs
(speakink C M)
CA skills
skill in-dialog X Y)
(before
(in-beliefs (speaking X Y))
)
(do
(add-belief (CA X)
([person] M)
([person] C)
([person] me)
(within-hearing-distence me me)
(within-hearing-distence me M)
(within-hearing-distence me C)
(within-hearing-distence M me)
(within-hearing-distence M M)
(within-hearing-distence M C)
(within-hearing-distence C me)
(within-hearing-distence C M)
(within-hearing-distence C C)
skill hears-Y-Say (X Y Z S)
(before
(in-precepts X (hears X (say Y S)))
(in-beliefs X (within-hearing-distence Y Z))
)
(do
(add-percept Z (hears Z (say Y S))
)
(after
(in-precepts Z (hears Z (say Y S)))
)
=============================================================
notes on speech acts
Statement
backchannel/acknowledgement
opinion
abandoned/uninterpretable
agreement/accept
appreciation
yes-no question
non-verbal
yes answer
conventional closing
wh-question
no answer
response acknowledgement
hedge
declarative yes-no question
other
backchannel question
quotation
summarize/reformulate
affirmative non-yes answer
action-directive
collaborative completion
repeat phrase
open question
rhetorical question
hold before answer/agreement
reject
negative non-no answer
signal-non-understanding
other answer
convential opening
or clause
dispreferred answer
3rd party talk
offers, options and commits
self talk
downplayer
maybe/accept part
tag question
declarative wh-question
apology
thanking
Representation
(believes [agent] [statement])
(intention [agent] [goal]
(relations
,@ListOf[Or[[goal],[belief],[intention]]])
)
[action]
(inform speaker listener belief)
(before
(believes speaker belief))
(action
(tell speaker listener (belief speaker belief) )
(tell listener speaker (heard (believes speaker belief)) )
(then
(believes listener belief)
(believes listener (believes speaker belief)) )
(inform .[agent] ,[agent] .[belief]
(start
[statement]s
)
(action
[action]s
)
(effect
[statement]
)
(acknowledge-request ,[agent] ,[agent] ,[goal]
,@[action-description] )
(believes ,[agent] ,[statemant]
(trusts ,[agent] ,[agent])
(believes ,[agent]1 (believes ,[agent]2 ,[statement]))
)
------------------------------------------------------------------------
Reasoning about timestamps