Report Top Up a Node Prev Next Up a Map TOC Node Index File Index Page Bottom
PROXIMITY : Algorithm : Fixed ag-act-fn published Sun, Apr 21, 2002 - 13:19 EDT

Fixed ag-act-fn



In the ag-act-fn function, when no information could be found Ehrlich's algorithm would return the word "onto". Since this was not the desired behavior, I removed it. My new version returns nil when no information can be found in ag-act-fn.

In addition, I changed ag-act-fn so that when some information was found the list that is returned is more expressive. This was being done at each place that ag-act-fn was used, so I felt that it was better to put this code in one place rather than having identical functionality duplicated throughout the program.


Old version of ag-act-fn

;------------------------------------------------------------------------------

;

; function: ag-act-fn

; input : a noun to be defined

; returns : a list of the agent(s) and act(s) for which <noun>

; serves as object in an agent-act-object case frame.

;

;------------------------------------------------------------------------------

(defun ag-act-fn (noun)

(setq local-agent #3! ((find (compose lex- class- ! member agent- ! object

member- ! class lex) ~noun)))

(if (null local-agent)

(setq local-agent #3! ((find (compose lex- class- ! member

agent- ! object

object1- ! object2 lex) ~noun))))

(if (null local-agent)

(setq local-agent #3! ((find (compose lex- object2- object1

agent- ! object

member- ! class lex) ~noun))))

(if (null local-agent)

(setq local-agent #3! ((find (compose lex- object2- object1

agent- ! object

object1- ! object2 lex) ~noun))))

(if (null local-agent)

(setq local-agent #3! ((find (compose lex- object2- objects1

agent- ! object

member- ! class lex) ~noun))))

(if (null local-agent)

(setq local-agent #3! ((find (compose lex- object2- objects1

agent- ! object

object1- ! object2 lex) ~noun))))

(setq local-act #3! ((find (compose lex- act- ! object member- ! class lex)

~noun)))

(if (null local-act)

(setq local-act #3! ((find (compose lex- act- ! object

object1- ! object2 lex) ~noun))))

(if (null local-agent)

(setq local-agent #3! ((find (compose lex- class- ! member

agent- ! onto

object1- ! object2 lex) ~noun))))

(if (null local-agent)

(setq local-agent #3! ((find (compose lex- object2- ! object1

agent- ! onto

object1- ! object2 lex) ~noun))))

(if (null local-act)

(setq local-act (append #3! ((find (compose lex- act- ! onto

object1- ! object2 lex) ~noun))

"onto")))

(list local-agent local-act))


New Version of ag-act-fn

;------------------------------------------------------------------------------

;

; function: ag-act-fn

; input : a noun to be defined

; returns : a list of the agent(s) and act(s) for which <noun>

; serves as object in an agent-act-object case frame.

;

;------------------------------------------------------------------------------

(defun ag-act-fn (noun)

(setq local-agent #3! ((find (compose lex- class- ! member agent- ! object                         

member- ! class lex) ~noun)))

(if (null local-agent)

(setq local-agent #3! ((find (compose lex- class- ! member

agent- ! object

object1- ! object2 lex) ~noun))))

(if (null local-agent)

(setq local-agent #3! ((find (compose lex- object2- object1

agent- ! object

member- ! class lex) ~noun))))

(if (null local-agent)

(setq local-agent #3! ((find (compose lex- object2- object1

agent- ! object

object1- ! object2 lex) ~noun))))

(if (null local-agent)

(setq local-agent #3! ((find (compose lex- object2- objects1

agent- ! object

member- ! class lex) ~noun))))

(if (null local-agent)

(setq local-agent #3! ((find (compose lex- object2- objects1

agent- ! object

object1- ! object2 lex) ~noun))))

(setq local-act #3! ((find (compose lex- act- ! object member- ! class lex)

~noun)))

(if (null local-act)

(setq local-act #3! ((find (compose lex- act- ! object

object1- ! object2 lex) ~noun))))

(if (null local-agent)

(setq local-agent #3! ((find (compose lex- class- ! member

agent- ! onto

object1- ! object2 lex) ~noun))))

(if (null local-agent)

(setq local-agent #3! ((find (compose lex- object2- ! object1

agent- ! onto

object1- ! object2 lex) ~noun))))

(if (null local-act)

(setq local-act (append #3! ((find (compose lex- act- ! onto

object1- ! object2 lex) ~noun))

"onto")))

; if the last "find" didn't find anything local-act will be set to "onto"

; in that case, make local-act nil

(if (not (listp local-act))

(setq local-act nil))

(if (or local-agent local-act)

(list 'a noun 'is 'something 'a local-agent 'can local-act)

nil))


Node authored by Scott Napieralski

PROXIMITY : Algorithm : Fixed ag-act-fn published Sun, Apr 21, 2002 - 13:19 EDT
Report Top Up a Node Prev Next Up a Map TOC Node Index File Index Page Top