Old there-exists


;-------------------------------------------------------------------------------
;
;	function: there_exists
;	input:  a noun to be defined
;	output: a list of individuals of type <noun> together with any
;		possessions, functions, actions, relations, or other
;		properties attributed to those individuals.  If individuals
;		exist, and have such properties, but aren't named, list
; 		the properties anyway.
;                                                             modified: mkb 2002
;------------------------------------------------------------------------------- 
(defun there_exists (noun)
  (setq agent-act (ag-act-fn noun))
  (setq str (struct noun nil))
  (setq ac (acts noun))
  (setq fun (func noun))
  (cond ((setq thex1 #3! ((find (compose lex- proper-name- ! object object1- ! object2 lex)
				 ~noun)))
	  (if (and (null str) (null fun))
	      (if (and (null ac) agent-act)
		  (list 'a noun 'is 'something 'a (car agent-act)
			'can (cadr agent-act)
			'a noun 'is 'something
			thex1
			'is.
			'structure= 'nil
			'function= 'nil
			'actions= 'nil
			'ownership= (indiv_rand_rels noun)
			'possible 'properties= (indiv_rand_props noun))
		(list 'a noun 'is 'something
		      thex1
		      'is.
		      'structure= 'nil
		      'function= 'nil
		      'actions= ac 
		      'ownership= (indiv_rand_rels noun)
		      'possible 'properties= (indiv_rand_props noun)))
	    (list 'a noun 'is 'something
		  thex1
		  'is.
		  'structure= str
		  'function= fun
		  'actions= ac
		  'ownership= (indiv_rand_rels noun))))
         ((setq thex2 #3! ((find (compose lex-  proper-name- ! object member- ! class lex) 
				 ~noun)))
	  (if (and (null str) (null fun))
	      (if (and (null ac) agent-act)
		  (list 'a noun 'is 'something 'a (car agent-act)
			'can (cadr agent-act)
			'a noun 'is 'something
			thex2
			'is.
			'structure= 'nil
			'function= 'nil
			'actions= 'nil
			'ownership= (indiv_rand_rels noun)
			'possible 'properties= (indiv_rand_props noun))
		(list 'a noun 'is 'something
		      thex2
		      'is.
		      'structure= 'nil
		      'function= 'nil
		      'actions= ac 
		      'ownership= (indiv_rand_rels noun)
		      'possible 'properties= (indiv_rand_props noun)))
	    (list 'a noun 'is 'something
		  thex2
		  'is.
		  'structure= str 
		  'function= fun
		  'actions= ac
		  'ownership= (indiv_rand_rels noun))))
	 (#3! ((find (compose object1- ! object2 lex) ~noun))
	      (if (and (null str) (null fun) agent-act)
		  (list 'a noun 'is 'something 'a (car agent-act)
			'can (cadr agent-act)
			'structure= 'nil 
			'function= 'nil
			'actions= ac 
			'ownership= (indiv_rand_rels noun)
			'possible 'properties= (indiv_rand_props noun))
		(list 'structure= str 
		      'function= fun
		      'actions= ac 
		      'ownership= (indiv_rand_rels noun)
		      'possible 'properties= (indiv_rand_props noun))))
	 (#3! ((find (compose member- ! class lex) ~noun))
	      (if (and (null str) (null fun) agent-act)
		  (list 'a noun 'is 'something 'a (car agent-act)
			'can (cadr agent-act)
			'structure= 'nil 
			'function= 'nil
			'actions= ac
			'ownership= (indiv_rand_rels noun)
			'possible 'properties= (indiv_rand_props noun))
		(list 'structure= str 
		      'function= fun
		      'actions= ac
		      'ownership= (indiv_rand_rels noun)
		      'possible 'properties= (indiv_rand_props noun)))) ))

New there-exists


;-------------------------------------------------------------------------------
;       function: find_individuals
;       input:    a noun to be defined
;       output:   a list of individuals of type <noun>
;                                                          created: stn 2002
;-------------------------------------------------------------------------------
(defun find_individuals (noun)
  "Returns a list of things that are a <noun>."
  ; are the lex arcs needed in a object,proper-name case frame???
  (append #3! ((find (compose lex- proper-name- ! object object1- ! object2 lex) ~noun
		     (compose lex- proper-name- ! object object1- ! rel) "ISA"))
	  #3! ((find (compose lex- proper-name- ! object member- ! class lex) ~noun))
	  #3! ((find (compose lex- object1- ! object2 lex) ~noun
		     (compose lex- object1- ! rel) "ISA"))
	  #3! ((find (compose lex- member- ! class lex) ~noun))
   ))


;-------------------------------------------------------------------------------
;
;	function: there_exists
;	input:  a noun to be defined
;	output: a list of individuals of type <noun> together with any
;		possessions, functions, actions, relations, or other
;		properties attributed to those individuals.  If individuals
;		exist, and have such properties, but aren't named, list
; 		the properties anyway.
;                                                             modified: mkb 2002
;                                                             modified: stn 2002
;-------------------------------------------------------------------------------
(defun there_exists (noun)
  (setq agent-act (ag-act-fn noun))
  (setq str (struct noun nil))
  (setq ac (acts noun))
  (setq fun (func noun))
  (cond ((setq thex1 (find_individuals noun))
	 (if (and (null ac) agent-act)
	     (list agent-act
		   'a noun 'is 'something
		   thex1
		   'is.
		   'structure= str
		   'function= fun
		   'actions= 'nil
		   'ownership= (indiv_rand_rels noun)
		   'possible 'properties= (indiv_rand_props noun))
	   (list 'a noun 'is 'something
		 thex1
		 'is.
		 'structure= str
		 'function= fun
		 'actions= ac 
		 'ownership= (indiv_rand_rels noun)
		 'possible 'properties= (indiv_rand_props noun)))
	    )
	 ;; if there is some object1 but we don't know its name
	 (#3! ((find (compose object1- ! object2 lex) ~noun))
	      (if (and (null str) (null fun) agent-act)
		  (list agent-act
			'structure= 'nil 
			'function= 'nil
			'actions= ac 
			'ownership= (indiv_rand_rels noun)
			'possible 'properties= (indiv_rand_props noun))
		(list 'structure= str 
		      'function= fun
		      'actions= ac 
		      'ownership= (indiv_rand_rels noun)
		      'possible 'properties= (indiv_rand_props noun))))
	 ;; if there is some member of the class but we don't know its name
	 (#3! ((find (compose member- ! class lex) ~noun))
	      (if (and (null str) (null fun) agent-act)
		  (list agent-act
			'structure= 'nil 
			'function= 'nil
			'actions= ac
			'ownership= (indiv_rand_rels noun)
			'possible 'properties= (indiv_rand_props noun))
		(list 'structure= str 
		      'function= fun
		      'actions= ac
		      'ownership= (indiv_rand_rels noun)
		      'possible 'properties= (indiv_rand_props noun)))) 
	 ))