;;; File: rather-than.lisp
;;; Last saved in emacs: Time-stamp: <97/01/22 23:01:55 jlitchfi>

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Add "rather than" alternatives.                                      ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(SYSTEM
 :NAME                   ACCOMPANIMENT-PROCESS-TYPE
 :INPUTS                 ACCOMPANIMENT-PROCESS
 :OUTPUTS                ((0.2 INCLUDING-COMITATIVE)
			  (0.2 EXCLUDING-COMITATIVE
			       (LEXIFY MINORPROCESS WITHOUT))
			  (0.2 CUMULATIVE-ADDITIVE
			       (LEXIFY MINORPROCESS ASWELLAS))
			  (0.2 ALTERNATIVE-ADDITIVE-replacing
			       (LEXIFY MINORPROCESS INSTEADOF))
			  (0.2 alternative-additive-nonreplacing
			       (lexify minorprocess ratherthan)))
 :CHOOSER                ACCOMPANIMENT-PROCESS-TYPE-CHOOSER
 :REGION                 PPOTHER
 :METAFUNCTION           IDEATIONAL
 )

(CHOOSER
 :NAME                   ACCOMPANIMENT-PROCESS-TYPE-CHOOSER
 :DEFINITION             ((ASK (PARTICIPATION-Q MINORPROCESS MINIRANGE)
			       (PARTICIPATION
				(CHOOSE INCLUDING-COMITATIVE))
			       (NONPARTICIPATION
				(ASK 
				 (ADDITION-Q MINORPROCESS MINIRANGE)
				 (ADDITION
				  (CHOOSE CUMULATIVE-ADDITIVE))
				 (NONADDITION
				  (ASK
				   (ALTERNATIVE-Q
				    MINORPROCESS
				    MINIRANGE)
				   (ALTERNATIVE
				    (ask 
				     (replacing-alternative-q 
				      minorprocess minirange)
				     (replacing 
				      (CHOOSE 
				       ALTERNATIVE-ADDITIVE-replacing))
				     (nonreplacing
				      (CHOOSE 
				       ALTERNATIVE-ADDITIVE-nonreplacing))))
				   (NONALTERNATIVE
				    (CHOOSE EXCLUDING-COMITATIVE)))))))
			  (* LP " 6-Nov-86 15:33:24"))
 :DATE                   "8-4-1992 15:55:25 at IPSI."
 )

(ASKOPERATOR
 :NAME                   replacing-alternative-q
 :DOMAIN                 TP
 :PARAMETERS             (OPERATOR OPERAND)
 :ENGLISH                ( " Does" OPERATOR
			   "  represent a relation of replacement by"
			   OPERAND "  ?")
 :OPERATORCODE           replacing-alternative-q-code
 :PARAMETERASSOCIATIONTYPES      (CONCEPT CONCEPT)
 :ANSWERSET              (replacing nonreplacing)
 :trivialdefault         replacing
 )

(defun replacing-alternative-q-code (reln range)
  "If RELN is of type alternative-nonreplacing."
  (declare (ignore range))
  (if (term-type-p reln 'alternative-nonreplacing) 'nonreplacing 'replacing))

(penman-kb::defreified-relation Alternative-Nonreplacing
  :is (:and penman-kb::Alternative :primitive))

(penman::annotate-concept ALTERNATIVE-NONREPLACING
  :doc-strings
  ("")
  :lex-items
  (RATHERTHAN))

(LEXICAL-ITEM
 :NAME                   RATHERTHAN
 :SPELLING               "rather than"
 :SAMPLE-SENTENCE        "I went home by plane rather than by train."
 :FEATURES             (NONE-OF-LOCATION-CONCESSION-MATTER-PURPOSE-ROLE-REASON 
			PREPOSITION)
 :EDITOR                 "JLL"
 :DATE                   "31/05/96"
 )