;;; File: in-which.lisp
;;; This file contains an addition to produce "clause1 in which clause2"
;;; Susan Williams, May 31, 1995
;;; Last modified in emacs: Time-stamp: <96/07/16 22:01:25 jlitchfi>

(in-package :penman)

(penman-kb::defreified-relation RST-in-which
  :is (:and penman-kb::asymmetric-rhetorical-relation
	    penman-kb::logical-condition
	    :primitive))


(system
   :name FINITE-ADDITIVE-EXTENDING
   :inputs (AND ADDITIVE-EXTENDING FINITE-EXTENDING)
   :outputs ((0.5 FINITE-ADDITIVE-EXTENDING
		  (LEXIFY SUBORDINATOR WHEREAS))
	     (0.5 in-which-extending
		  (lexify subordinator inwhich)))
   :chooser finite-additive-extending-chooser
   :selector CHOICE-MASTER
   :old-feature FINITE-ADDITIVE-EXTENDING
   :region DEPENDENCY
   :metafunction LOGICAL)

(chooser
 :name finite-additive-extending-chooser
 :definition ((ask (in-which-q subordinator)
		   (whereas (choose finite-additive-extending))
		   (in-which (choose in-which-extending))))
 :comments ""
 :editor "WW"
 :date "April 12, 1996, at LAPIG"
)

(askoperator 
 :name in-which-q
 :domain TP
 :mode IMPLEMENTED
 :parameters (RELATION1)
 :english ("Do you want whereas or in which with " relation1 "?")
 :operatorcode TRIVIALDEFAULTCODE
 :parameterassociationtypes (MODIFICATIONSET)
 :answerset (whereas in-which)
 :trivialdefault whereas)

;;; We still need a lexical item for inwhich

(LEXICAL-ITEM
 :NAME                   INWHICH
 :SPELLING               "in which"
 :SAMPLE-SENTENCE        "This is the room in which she was born."
 :FEATURES               (NOT-SENTENCECONJUNCTION
			  NONE-OF-CONJUNCT-CONJUNCTIVE NOT-PUNCTUATION
			  SUBORDINATOR LINKER)
 :EDITOR                 "CUMMING"
 :DATE                   "Monday the twenty-first of October, 1985; 3:57:49 pm"
 :SEMANTICS              (NIL NIL NIL)
 )

(reset-system-network)
(set-grammar-keyword-types)

;;; sample SPL using rst-in-which
(setq sample-in-which-spl
      '(rst / rst-in-which
	    :in-which-q in-which
	    :domain (a / class-ascription
		       :domain (s / object
				  :lex system
				  :ordinal eighth
				  :determiner the)
		       :range (q / quality
				 :lex reliable))
	    :range (need / liking
			 :lex need
			 :senser (s1 / object
				     :lex system
				     :ordinal fourth
				     :determiner the
				     :minimal-attention-q minimal
				     :semantic-coverage-q covered)
			 :phenomenon (i / substance
					:lex improvement
					:determiner some ; a-some
					:number plural))))