;;;; created 3/17/2004 by clbecker ;;;; last modified 4/16/2004 by clbecker ;;;; ;;;; Construct Find-Lists ;;;; ;;;; The functions in this file serve to ;;;; Initiate a list of find statements that will be ;;;; used to pull out the required information from ;;;; a SNePS network. ;;;; ;;;; The main function in this file is constructFindList ;;;; this initiates the variable *Find-List* to be an ;;;; association list containing all the find statements to ;;;; be used by the definition algorithm. ;;;; ;;;; Currently, everything that the *Find-List* finds will be ;;;; automatically outputted. If you don't want certain data ;;;; from the SNePS network to be outputted, put the path in ;;;; *ProcessingDataToFind*. ;;;; ;;;; ;;;; ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; ;;;; ;;;; Modification History: ;;;; ;;;; 4/1/2004 ;;;; Added new cases to *MiscItemsToFind* for: ;;;; ;;;; actions_performed_by_agent ;;;; actions_performed_on_object ;;;; actions_performed_by_object ;;;; actions_performed_with_instr ;;;; ;;;; Added new case *ArgRelsToFind* for: ;;;; ;;;; superordinate ;;;; 4/2/2004 ;;;; Added equiv - equiv case frame to *MiscItemsToFind* ;;;; ;;;; ;;;; 4/14/2004 ;;;; Added path for antecedent: ;;;; ;;;; (lex- action- act- ant- cq act action lex) ;;;; ;;;; And consequent: ;;;; ;;;; '(consequence (lex- action- act- cq- ant act action lex)) ;;;; ;;;; ;;;; to *MiscItemsToFind* ;;;; ;;;; 4/15/2004 ;;;; Added the path: ;;;; ;;;; (lex- action- act- cause- effect act action lex) ;;;; ;;;; to *MiscItemsToFind*, defined as actions that cause the ;;;; unknown action. ;;;; ;;;; Also added: ;;;; (lex- action- act- effect- cause act action lex) ;;;; to *MiscItemsToFind*, defined as actions that are an effect ;;;; of the unknown action. ;;;; ;;;; 4/16/2004 ;;;; Added list *ProcessingDataToFind* ;;;; ;;;; This list will contain paths for items that will be used by ;;;; the processing modules, but will not be outputted. ;;;; ;;;; ;;;; 4/17/2004 ;;;; ;;;; Set up infrastructure for *EvalList* ;;;; Implement it in the future if needed. ;;;;;;;;;;;;; LIST *EvalList* ;;; ;;; ;;; This list will contain individual statements ;;; to evaluate. ;;; ;;; Note: I have not implemented this, but I have ;;; set up the infrastructure for it. ;;; this will be evaluated in the function ;;; evaluateEvalList in ConstructFoundLists.cl ;;; ;;; The function constructEvalIndexList ;;; ConstructFoundLists.cl creates a list of the keys ;;; from this association list. ;;;;;;;;;;;;; (setf *EvalList* (list ;;example of what this list will contain: '(example1 (first (list #3! ((find (act action lex) ~verb (act object) ~object (agent) ~agent ))))) '(example2 (first (list #3! (( find (act action lex) ~verb (agent) ~agent))))) )) ;;;;;;;;;;;;; LIST *ProcessingDataToFind* ;;; ;;; ;;; *ProcessingDataToFind* is an association list containing ;;; paths to items that you want the algorithm to find, but ;;; not output. ;;; If you want a function to act with respect to some item ;;; in the network, put the path for it here rather than in ;;; one of the other lists. ;;; ;;; New arguments may be added by following the same format. ;;;;;;;;;;;;; (setf *ProcessingDataToFind* (list ;; these are just some examples, ;; currently this list is not used by ;; any of the processing functions. '(actionNode (lex)) '(actNode (action lex)) ;; Add new items with the template here, replacing ;; with some sort of identifier and ;; with the corresponding SNePS path. ;; In the ConstructFoundLists file, the function ;; evaluateFindList will run "find" ;; on the path, followed by the verb ;; e.g (find verb) ;'( ()) )) ; end setf ;;;;;;;;;;;;; LIST *ArgsToFind* ;;; First create the list of find statements ;;; that will return the arguments of the unknown word ;;; ;;; *ArgsToFind* is set up as an association list ;;; with the element name as the first element of each ;;; list and the path for the find statement for that ;;; particular element as the cdr. ;;; ;;; This list may be used later on to quickly access the ;;; different arguments of the verb. ;;; ;;; New arguments may be added by following the same format. ;;;;;;;;;;;;; (setf *ArgsToFind* (list '(verb (lex)) '(act (action lex)) ;; arguments of the verb: '(agent (agent- act action lex)) ;; don't add anything before this in this list. '(object (object- action lex)) '(indobj (indobj- action lex)) '(from (from- action lex)) '(to (to- action lex)) '(instrument (instrument- act action lex)) '(with (with- action lex)) ;; Add new items with the template here, replacing ;; with some sort of identifier and ;; with the corresponding SNePS path. ;; In the ConstructFoundLists file, the function ;; evaluateFindList will run "find" ;; on the path, followed by the verb ;; e.g (find verb) ;; ;; will be printed as part of the output, ;; so make sure it is descriptive (and that it fits ;; grammatically into the output sentence) ;; ;; the output sentence will be of the form: ;; "A possible of is <...> ;'( ( lex)) )) ; end setf ;;;;;;;;;;;;; LIST *ArgRelsToFind* ;;; Information to gather about each argument. ;;; ;;; *ArgRelsToFind* is an association list containing ;;; all the relations that we are interested in finding ;;; for each of the verb's arguments (e.g. agent, object, indobj) ;;; ;;; New arguments may be added by following the same format. ;;;;;;;;;;;;; (setf *ArgRelsToFind* (list '(superclass (lex- superclass- subclass)) '(membership (lex- class- member)) '(superordinate (lex- superclass- subclass class- member)) '(property (lex- property- object)) ;; Add new items with the template here, replacing ;; with some sort of identifier and ;; with the corresponding SNePS path. ;; In the ConstructFoundLists file, the function ;; evaluateFindList will run "find" ;; on the path, followed by the verb ;; e.g (find verb) ;; ;; will be printed as part of the output, ;; so make sure it is descriptive (and that it fits ;; grammatically into the output sentence) ;; ;; the output sentence will be of the form: ;; "A possible of is <...> ;'( ()) )) ; end setf ;;;;;;;;;;;;; LIST *MiscItemsToFind* ;;; ;;; *MiscItemsToFind* contains additional find statements ;;; that don't correspond to every argument of the verb. ;;; ;;; the data gathered by executing find statements on these ;;; paths is not used by any processing function at this time. ;;; ;;; it is just outputted with the other information found. ;;;;;;;;;;;;; (setf *MiscItemsToFind* (list '(cause (lex- cause- effect act action lex)) '(effect (lex- effect- cause act action lex)) '(synonym (lex- synonym- synonym lex)) '(similar\ action (lex- similar- similar lex)) ;;------- added 4-2-04 -cb '(equivalent\ action (lex- equiv- equiv lex)) ;;------- new cases added 4-1-04 -cb '(actions\ performed\ by\ agent (lex- action- act- agent agent- act action lex)) '(actions\ performed\ on\ object (lex- action- object object- action lex)) '(actions\ performed\ by\ object (lex- action- act- agent object- action lex)) '(actions\ performed\ with\ instrument (lex- action- act- instrument instrument- act action lex)) ;;------- new cases added 4-14-04 -cb '(antecedent (lex- action- act- ant- cq act action lex)) '(consequence (lex- action- act- cq- ant act action lex)) ;;------- new cases added 4-15-04 -cb '(action\ that\ is\ the\ cause (lex- action- act- cause- effect act action lex)) '(action\ that\ is\ the\ effect (lex- action- act- effect- cause act action lex)) ;; Add new items with the template here, replacing ;; with some sort of identifier and ;; with the corresponding SNePS path. ;; In the ConstructFoundLists file, the function ;; evaluateFindList will run "find" ;; on the path, followed by the verb ;; e.g (find verb) ;; ;; will be printed as part of the output, ;; so make sure it is descriptive (and that it fits ;; grammatically into the output sentence) ;; ;; the output sentence will be of the form: ;; "A possible of is <...> ;'( ()) )) ;;;;;;;;;;;;; FUNCTION constructFindList ;;; ;;; This function combines the lists above into a single list ;;; called *Find-List* which contains association lists of ;;; all the find statements to be used by the algorithm ;;;;;;;;;;;;; (defun constructFindList () "This function will take the elements from the above lists and form a complete list of find statements in the following manner: for each element in *ArgRelsToFind*, a find statement will be contructed for each element in *ArgsToFind*. the elements in *MiscItemsToFind* will be appended without any change." (setf *Find-List* '()) ;;----------------------------------------------------- ;; This code loops through all paths in the *ArgsToFind* ;; list and combines each of them with each of the paths in ;; *ArgRelsToFind*. ;; ;; A double association list is created, with a structure that ;; follows this example: ;; ;;--------------------- ;; (agent ;; ((superclass ;; (lex- superclass- subclass agent- act action lex)) ;; (membership ;; (lex- class- member agent- act action lex)) ;; (property ;; (lex- property- object agent- act action lex)))) ;;----------------------------------------------------- (setf *Find-List* (mapcar #'(lambda (obj) (list (first obj) (mapcar #'(lambda (rel) (list (first rel) (append (second rel) (second obj)))) *ArgRelsToFind*))) *ArgsToFind*)) ;; Append the list *MiscItemsToFind* to the completed *Find-List* (setf *Find-List* (append *MiscItemsToFind* *Find-List*)) ); end function constructFindList