;;; -*- Syntax: Common-Lisp; Package: PENMAN; Base: 10; Mode: LISP -*-
(in-package :penman)

#|

Some sample texts to generate
This is based on the on-line help for Microsoft word, applied to SIMPLE DRAW.
Based on what Nadine wrote.

Straightforward instructional text (ideally):

On the EDIT menu, click CHOICE and click on the LINE icon.
Dans le menu Edition, cliquez sur CHOISIR et cliquez sur l'icone LIGNE

==> thematisation of spatial locating **** OK

==> scope of spatial locating encompasses  BOTH actions ???? -- NOT OK
currently,  at least using RST-sequence   as  the means to obtain  the
AND. NEED  TO LOOK AT  THE CONJUNCTIONS SYSTEMS,  FOR BOTH CLAUSES AND
NPS.

==>  scope of the spatial  locating may depend  on the representation;
where will that be represented, and how easy it would be to attach the
spatial locating to one action, both actions and ellide, etc.


Note: Lots of conjoined constituents in the manual
Apply embossed or shadow formatting == conjoining 2 qualities.

Appliquez un relief ou une ombre (conjoining 2 objects)

Change the color of text and numbers
Changez la couleur du texte et de nombres

Change the size of circles and rectangles
Changez la taille des cercles et des rectangles

To make it easier to identify and find your document, click PROPERTIES on the FILE menu.
Pour faciliter et accelerer l'identification et la recherche de votre document, cliquez dans le menu FICHIER

Click to indicate the beginning of the line and click again to indicate the end (of the line).
Click once to indicate the beginning of the line and click again to indicate the end (of the line).
Cliquez pour indiquer le debut de la ligne et encore pour en indiquer la fin.
Cliquez une fois pour indiquer le debut de la ligne et cliquez une deuxieme fois  pour  indiquer la fin de la ligne.

Select the text you want to change
Selectionnez le texte a modifier
Selectionnez le texte que vous souhaitez modifier


Type information such as the document title, subject, author and keywords.
Tapez des informations telles que le titre du document, le sujet, l'auteur et les mots cles.

Click the folder that contains the document (that you want to open)
Cliquez sur le fichier qui contient le document que vous souhaitez ouvrir
OR: 
Click the folder containing the document (that you want to open)


=====
Instructional (but from the "elaboration genre")

You can use long names if you want 
Si vous le souhaitez, vous pouvez utiliser des noms de fichier longs

Hint: To make it easier to identify your document, click PROPERTIES on the FILE menu.
Pour faciliter et accelerer l'identification et la recherche de votre document, cliquez dans le menu FICHIER

---- Overview of commands: (linguistically, look slike "elaboration genre"
summary description, introducing the command, followed by an index which lay out the hypertext links that 
will provide the steps to execute the command.

(not like Ready Ref in that it addresses the user directly: YOU can...;
     but it does use modals a lot.)

You can create text using X. You can also create text using Y.

=====


Index:
What do you want to do? 
- change the font
- change the drawing tool

Que voulez-vous faire?
- modifier la police


TO DO?? (IS IT WORTH IT?)
conjunctions systems
questions
want as a modal

|#


;;;----------------------------------------------------------------
;;; On the EDIT menu, click CHOICE and click on the LINE icon
;;;
(example
 :name simple-draw1
 :englishform "On the EDIT menu, click CHOICE"
 :logicalform (s2 / dispositive-material-action :lex click
                  :actor (hearer / reader)
                  ;; the following is the correct way to handle named objects in the SPL, we just need
                  ;; to figure out how to allow the author to enter the string.  
                  :actee (t / object
                            :name choice-button)
                  :speechact imperative
                  :spatial-locating (m1 / one-or-two-d-location  ; otherwise we get "Off the menu" which doesn't read well...
                              :lex menu
                              :determiner the
                              :property-ascription (f1 / object  :name EDIT))
                  :theme m1
                  ))


;;;----------------------------------------------------------------
;;; On the EDIT menu, click CHOICE and  then click on the LINE icon
;;; 
;;; we get:  On the EDIT menu click CHOICE,   then click on the LINE icon

(example
 :name simple-draw2
 :englishform "On the EDIT menu, click CHOICE and click on the LINE icon "
 :logicalform (rst1 / rst-sequence
                                :domain (s2 / dispositive-material-action :lex click
					    :actor (hearer / reader)
					    :actee (t / object
						      :name choice-button)
					    :speechact imperative 
					    :spatial-locating (m1 / one-or-two-d-location 
								  :lex menu
								  :determiner the
								  :property-ascription (f1 / object :name EDIT))
					    :theme m1)
	            :range (s3 / dispositive-material-action :lex click-on
                                                 :actor (hearer / reader)
                                                 :actee (sb1 / decomposable   :lex icon
					   :determiner the
					   :property-ascription   (dt1 / decomposable-object
								 :name LINE))
                                                 :speechact imperative)
	          

                  ))

;;;----------------------------------------------------------------
;;;
;;;  You want to do it
;;;
;;;

(example
 :name simple-draw3
 :englishform "What do you want to do"
 :logicalform (s2 / wanting
		  :speech-act-id (?sa / Question
				      :polarity positive)
		  :question-item-id (o1 /decomposable-object)
                                      :senser (hearer / reader)
		  :phenomenon (s3 / dispositive-material-action :lex do
				  :actor (hearer / reader)
				  :actee (o1 / decomposable-object
					     :question-variable-q variable)
				  )))

(example
 :name simple-draw4
 :englishform "What do you open?"
 :logicalform (s2 / dispositive-material-action :lex open
		  :member-set-qq notincluded
		  :actor  (hearer / reader
		;;		  :express-hearer-q expresshearer
				  )
		  :actee  (id / object
			      :empty-number-q empty)
 		  :speech-act-id (Q / Question
 				      :polarity positive)
		  :question-item-id id ))

(example 
  :name ex-set-44
  :englishform "Whom did he remember?"
  :logicalform    (remember / cognition 	    :lex remember
	    :tense past
	    :speech-act-id (Q / Question
			  :polarity positive)
	    :question-item-id id 
	    :senser (he / person :pronoun he)
	    :phenomenon (id / person    :empty-number-q empty)))

;;; Click on the Save icon on the toolbar.  
;;;
(example
 :name drafter2-4
 :englishform "Click on the Save icon on the toolbar."
 :logicalform (s2 / nondirected-action ; otherwise we must specify the SELECT button as the actee
                  :lex click
                  :actor (hearer / reader)
                  ;; This button is only valid on UNIX (not on the mac).
                  ;; Do we need a unix-click and and mac-click or what?
                  ;;:actee (sel / object
                  ;;            :name select-button)
                  :spatial-locating 
		  (t / one-or-two-d-location :lex icon 
		     :determiner the
		     ;; This should be standard way to generate named objects as modifiers
		     :property-ascription (save1 / object 	 :name save-button)
		     :spatial-locating (tool1 / one-or-two-d-location :lex toolbar 
					      :determiner the)
                                       )
                  :speechact imperative
                  ))


;;;----------------------------------------------------------------
;;; If you're saving the document, Word displays the
;;; Save As dialogue box.
;;;                                                                
(example
 :name drafter2-5
 :englishform "If you are saving the document."
 :logicalform (s0 / rst-logical-condition
		  :disjunctive-extension-q disjunctive
                  :domain (s2 / dispositive-material-action :lex open
                              :actor (word1 / decomposable-object
                                            :name ms-word)
                              :actee (box1 / decomposable-object :lex dialog-box
                                           :determiner the
                                           :property-ascription (sa1 / object
                                                                     :lex save-as))
                              )
                  :range (s1 / dispositive-material-action :lex save
                             :actor (hearer / reader)
                             :actee (t / decomposable-object :lex document
                                       :determiner the)
                             :tense present-continuous 
                             )
                  :theme s1))


;;;----------------------------------------------------------------
;;; Type the document name in the Save Current Document As field.
;;; Type the name of the document in the Save Current Document As field.
(example
 :name drafter2-6
 :englishform "Type the name of the document in the..."
 :logicalform (s2 / dispositive-material-action :lex type
                  :actor (hearer / reader)
                  :actee (t / decomposable-object :lex name 
                            :determiner the
                            :part-of (doc1 / decomposable-object :lex document
					   :determiner the)
                            )
                  :speechact imperative
                  :spatial-locating (m1 / three-d-location :lex text-field
                                        :determiner the
                                        :property-ascription (f1 / object
                                                                 :name save-current-document-as))
                  ))


;;;----------------------------------------------------------------
;;; Didn't spend much time here because we may not do this one (and it is harder)
;;;
;;; You can edit the name at any time, before choosing Save.
;;;
(example
 :name drafter2-7
 :englishform "You can edit the name at any time..."
 :logicalform (s2 / dispositive-material-action :lex edit
                  :actor (hearer / reader)
                  :actee (t / decomposable-object :lex name
                            :determiner the)
                  :modality can
                  :temporal-locating (m1 / zero-d-time
                                         :lex time
   	                       :determiner any)
	 :ELABORATION-Q distinct
	 :CONDITIONING-Q  conditioning
	 :TIME-CONDITION-Q TIMECONDITION
                  :temporal-ordering (ch1 / dispositive-material-action :lex choose ;; anterior
					  :actor hearer
					  :time-precedence-q precedence
                                 :actee (sb1 / object
                                             :lex save-button
                                             :determiner zero)
                                 )
                  ))


;;;----------------------------------------------------------------
;;; Open the folder in which you want to save the current document.
;;; 
(example
 :name drafter2-8
 :englishform "Open the folder in which you want to save..."
 :logicalform (s0 / dispositive-material-action :lex open
    ; this gives "display" rather than "open", how are they really different?
                  :actor (hearer / reader)
                  :actee (directory1 / decomposable-object :lex directory
                                     :determiner the
                                     :process (a1  / wanting
                                                   ;;:tense present ; Why do I need to do this?
						   :speaking-time-id (DEFAULT-ST / time
								       :time-in-relation-to-speaking-time-id DEFAULT-ET
								       :same-as-q (DEFAULT-ST DEFAULT-ET) same
								       :precede-q (DEFAULT-ST DEFAULT-ET) notprecedes)
						   :reference-time-id (DEFAULT-ET / time
									:precede-q (DEFAULT-ET DEFAULT-ST) notprecedes)
                                                   :senser (hearer / person)
                                                   :phenomenon (cl / dispositive-material-action :lex save
                                                                   :actor hearer
                                                                   :actee (cd1 / decomposable-object :lex document
                                                                               :determiner the
                                                                               :property-ascription (c2 / quality
                                                                                                        :lex current)))
                                                   :spatial-locating (directory1 / decomposable-object :lex directory
                                                                                 :empty-number-q empty
                                                                                 :relative-pronoun-selection-q which)
                                                   )
                                     )
                  :speechact imperative
                  ))

(example
 :name drafter2-8-simpler
 :englishform "Open the folder of the file."
 :logicalform (s0 / dispositive-material-action :lex open                ; this gives "display" rather than "open", how are they really different?
                  :actor (hearer / reader)
                  :actee (directory1 / decomposable-object :lex directory
                                     :determiner the
				     :part-of (f1 / decomposable-object :lex document
						  :determiner the)
				     )
                  :speechact imperative
                  ))



(example
 :name test-see
 :englishform "You see a dialog box"
 :logicalform (s367 / perception :lex see 
		    :senser (hearer / person) 
		    :phenomenon (A369 / decomposable-object :lex dialog-box) 
		    ))




(example
 :name test-in-which-to
 :englishform "Open the directory in which you  save the current document"
 :logicalform (s0 / dispositive-material-action :lex open             
		  :actor (hearer / reader)
                  :actee (directory1 / decomposable-object :lex directory
                                     :determiner the
                                     :process (cl / dispositive-material-action :lex save
						  ;:TEMPORAL-DEFINITENESS-SPECIFICATION-Q NOTSPECIFIED
						  :tense present
						  :actor hearer
						  :actee (cd1 / decomposable-object :lex document
							      :determiner the
							      :property-ascription (c2 / quality
										       :lex current))
						  :spatial-locating (directory1 / three-d-location :lex directory
										:empty-number-q empty
										:relative-pronoun-selection-q which)
						  ))
                  :speechact imperative
                  ))

(example
 :name test-in-which-you-want-to
 :englishform "Open the directory in which you  save the current document"
 :logicalform (s0 / dispositive-material-action :lex open             
		  :actor (hearer / reader)
                  :actee (directory1 / decomposable-object :lex directory
                                     :determiner the
                                     :process  (a1  / wanting
				:process-modification-q process
				:speaking-time-id (DEFAULT-ST / time
				:time-in-relation-to-speaking-time-id DEFAULT-ET
				:same-as-q (DEFAULT-ST DEFAULT-ET) same
				:precede-q (DEFAULT-ST DEFAULT-ET) notprecedes)
				:reference-time-id (DEFAULT-ET / time
						     :precede-q (DEFAULT-ET DEFAULT-ST) notprecedes)
				:spatial-locating (directory1 / three-d-location :lex directory
							      :empty-number-q empty
							      :relative-pronoun-selection-q which)

				:senser (hearer / person)
				:phenomenon (cl / dispositive-material-action :lex save		
						:actor hearer
						:actee (rp / decomposable-object :lex file
							   :process-modification-q noprocess
							   :owned-by hearer)))
			    )
                  :speechact imperative
                  ))


(example
 :name test-want
 :englishform "You want to save your file"
 :logicalform
       (a1  / wanting
            ;;:tense present
	    :speaking-time-id (DEFAULT-ST / time
				:time-in-relation-to-speaking-time-id DEFAULT-ET
				:same-as-q (DEFAULT-ST DEFAULT-ET) same
				:precede-q (DEFAULT-ST DEFAULT-ET) notprecedes)
	    :reference-time-id (DEFAULT-ET / time
				 :precede-q (DEFAULT-ET DEFAULT-ST) notprecedes)
	    :senser (hearer / person)
	    :phenomenon (cl / dispositive-material-action :lex save
			    :actor hearer
			    :actee (rp / decomposable-object :lex file
				       :process-modification-q noprocess
				       :owned-by hearer)
			    )))



;;;----------------------------------------------------------------
;;; To save the document on another disk, insert the disk into the drive.  
;;;
(example
 :name drafter2-9
 :englishform "To save the document on another disk,..."
 :logicalform (s1 / rst-purpose
                  :domain (insert1 / dispositive-material-action :lex insert
                                :actor (hearer / reader)
                                :actee (d1 / decomposable-object :lex floppy-disk
                                           :determiner the)
                                :destination (drive1 / three-d-location :lex disk-drive
                                                     :determiner the)
                                :speechact imperative)
		  :range (save1 / dispositive-material-action :lex save
                                :actor (hearer / reader)
                                :actee (d1 / decomposable-object :lex document
                                           :determiner the)
                                :spatial-locating (disk1 / one-or-two-d-location :lex floppy-disk
                                                         :determiner another)
                                )
                  :theme save1
                  ))


;;;----------------------------------------------------------------
;;; To switch to this disk, choose the Desktop button and then double-click 
;;; the disk.
;;;
(example
 :name drafter2-10
 :englishform "To switch to another drive, THIS CRASHES......"
 :logicalform (s1 / rst-purpose
                  :domain (rst1 / rst-sequence
                                :domain (choose1 / dispositive-material-action :lex choose
                                                 :actor (hearer / reader)
                                                 :actee (sb1 / decomposable-object 
							     :lex software-button
                                                            :determiner the
                                                            :property-ascription 
							    (dt1 / decomposable-object
								 :name desktop-button))
                                                 :speechact imperative)
                                :range (dc1 / dispositive-material-action :lex double-click
                                                 :actor (hearer / reader)
                                                 :actee (dd1 / software-button :lex floppy-disk
                                                            :determiner the)
                                                 :speechact imperative))
		  :range (switch1 / dispositive-material-action :lex switch
                                  :actor (hearer / reader)
                                  :destination (d1 / zero-d-location ; otherwise we get "into another disk"
                                                   :lex disk
                                                   :determiner this)
                                )
                  :theme switch1
                  ))


;;;----------------------------------------------------------------
;;; Finally, choose the Save button.
;;; 
(example
 :name drafter2-11
 :englishform "Finally, choose the Save button."
 :logicalform (s2 / dispositive-material-action :lex choose
		  	 :conjunctive-relation-q conjunctive
	
                  :conjunctive finally
                  :actor (hearer / reader)
                  :actee (t / decomposable-object :lex software-button
                            :determiner the
                            :property-ascription (sb1 / object
                                                      :name save-button))
                  :speechact imperative
                  ))


;;;----------------------------------------------------------------
;;; I hacked inquiry-implementations.lisp to get "there is" 
;;; existence to work.
;;;
;;; If there is an existing document with the same name in the current
;;; folder, Word asks if you want to replace this document.  
;;;
(example
 :name drafter2-12
 :englishform "If there is a document with the same name..."
 :logicalform (s0 / rst-logical-condition
		  :disjunctive-extension-q disjunctive
                  :domain (i / non-addressee-oriented-verbal-process  ; for some reason we cannot have an addressee...
                             :lex ask
                             :sayer (msw1 / decomposable-object
                                          :name ms-word)
                             :saying (s1 / wanting
                                         :conjunctive-extension-q nonconjunctive 
                                         :disjunctive-extension-q disjunctive
                                         :definite-truth-value-q indefinite
                                         :polarity-openness-q open
                                         :if-whether-q if ; not exactly a semantic/pragmatic feature...
                                         :senser (hearer / person)
                                         :phenomenon (rep1 / dispositive-material-action :lex replace
                                                           :actor hearer
                                                           :actee (doc1 / decomposable-object 
				:lex document
                                                                        :determiner this)))
                             )
		  :range (exist / existence
                                :tense present
				:participant (doc1 / decomposable-object 
						   :lex document
                                                   :determiner a ; Why do I have to do this?
                                                   :property-ascription (ex1 / quality
                                                                             :lex existing))
                                :spatial-locating (sf1 / decomposable-object 
						       :lex directory
                                                       :determiner the
                                                       :property-ascription (same1 / quality
                                                                                   :lex current))
                                :inclusive (sn1 / decomposable-object :lex name
                                                :determiner the
                                                :property-ascription (q1 / quality
                                                                         :lex same))
                                )
                  :theme exist
                  ))


;;;----------------------------------------------------------------
;;; To replace the existing document with the one on the screen, 
;;; choose No
;;; 
(example
 :name drafter2-14
 :englishform "To replace the existing document with ..."
 :logicalform (s1 / rst-purpose
                  :domain (choose1 / dispositive-material-action :lex choose
                                   :actor (hearer / reader)
                                   :actee (d1 / decomposable-object
                                              :name no-button)
                                   :speechact imperative)
		  :range (replace1 / dispositive-material-action :lex replace
                                   :actor (hearer / reader)
                                   :actee (doc1 / decomposable-object :lex document
                                                :determiner the
                                                :property-ascription (ex1 / quality
                                                                          :lex existing))
                                   ;; sorry about this one to...
                                   :inclusive (oo / object
                                                  :spatial-locating (o / one-or-two-d-location
			       :lex screen
			       :determiner the)
                                                  :determiner the
                                                  :minimal-attention-q minimal
                                                  :semantic-coverage-q covered)
                                   )
                  :theme replace1
                  ))


;;;----------------------------------------------------------------
;;; You can quit the Save As dialogue box by choosing Cancel instead of
;;; (choosing) Save.
;;; 
(example
 :name drafter2-15
 :englishform "You can quit the Save As dialogue by..."
 :logicalform (s2 / dispositive-material-action :lex quit
                  :modality can
                  :actor (hearer / reader)
                  :actee (db1 / decomposable-object :lex dialog-box
                              :determiner the
                              :property-ascription (q1 / quality
                                                       :lex save-as)
                              )
                  :enablement (choose1 / dispositive-material-action :lex choose
                                       :typical-participant-q nottypicalclass ; Can't this just be defaulted?
                                       :actor (hearer / person)
                                       :actee (t / decomposable-object :
                                                 :name cancel-button)
                                       ;; Think of the following as interesting rather that unprincipled,
                                       ;; I'm not even sure where to begin "fixing" it.
                                       :conditioning-q nonconditioning
                                       :contrastive-extension-q contrastive
                                       :replacement-q replacing
                                       ;; This condition must be a process, not an object.
                                       :condition (choose2 / dispositive-material-action 
							   :lex choose ; can we avoid restating the choose action?
                                                           :actor (hearer / person)
                                                           :actee (t / decomposable-object
                                                                     :name save-button)
                                                           )
                                       )
                  ))


;;;----------------------------------------------------------------
;;; The File menu
;;; 
(example
 :name drafter2-16
 :englishform "The File menu"
 :logicalform (s2 / decomposable-object :lex menu
                  :determiner the
                  :property-ascription (file1 / decomposable-object :lex file)
                  ))

;;;----------------------------------------------------------------
;;; Save
;;;
(example
 :name drafter2-17
 :englishform "Save"
 :logicalform (s2 / decomposable-object
                  :name save
                  ))


;;;----------------------------------------------------------------
;;; I've hacked the implementation of rst-nonvolitional-result to handle this (see the
;;; notes in dependency.systems).  The "replacing..." clause is really a generation 
;;; relationship, but KPML doesn't recognize this category (maybe it should...), so it
;;; is probably best treated for now as a result.  This is  partially because this is 
;;; *almost* right, and partially because the hack to the KPML grammar is very simple.
;;;
;;; This command saves a copy of the current document on the disk under
;;; the same name, replacing the old version.  
;;;
(example
 :name drafter2-18
 :englishform "This command saves a copy ..."
 :logicalform (s0 / rst-nonvolitional-result
                  :domain (s2 / dispositive-material-action  :lex save
                              :actor (com1 / decomposable-object :lex command
                                           :determiner this)
                              :actee (copy1 / dispositive-material-action  :lex copy
                                             :determiner a ; Why do I need to specify this?
                                            :part-of (doc1 / decomposable-object :lex document
                                                           :determiner the
                                                           :property-ascription (cur1 / quality
                                                                                      :lex current))
                                            )
                              :spatial-locating (disk1 / one-or-two-d-location :lex floppy-disk
                                                       :determiner the)
                              :instrumental (name1 / decomposable-object :lex name
                                                   :determiner the
                                                   :property-ascription (q2 / quality
                                                                            :lex same))
                              )
                  :range (s3 / dispositive-material-action  :lex replace
                             :actor (hearer / reader)
                             :actee (version1 / decomposable-object :lex version
                                              :determiner the
                                              :property-ascription (old1 / quality
                                                                         :lex old))
                             )
                  ))



;;;----------------------------------------------------------------
;;; It is usable when a document is open on the desktop.
;;; 
(example
 :name drafter2-19
 :englishform "It is usable when a document..."
 ;;
 ;; One would think this was a condition of some sort, but that, of course,
 ;; will not lead to "when".  The definition of the concurrent relation in the 
 ;; MUM (i.e., that the time intervals of N and S overlap) is consistent with 
 ;; this use.
 ;;
 :logicalform (s0 / concurrent
                  :domain (s1 / property-ascription
                              :domain (o / object
                                         :pronoun it)
                              :range (q / quality
                                        :lex usable)
                              )
                  :range (s2 / property-ascription
                             :tense present
                             :domain (doc1 / decomposable-object :lex document)
                             :range (open1 / quality
                                           :lex open)
                             :spatial-locating (desk1 / one-or-two-d-location :lex desktop
                                                      :determiner the)
                             )
                  ))


;;;----------------------------------------------------------------
;;; Save As
;;;
(example
 :name drafter2-20
 :englishform "Save As"
 :logicalform (s2 / decomposable-object 
                  :name save-as
                  ))


;;;----------------------------------------------------------------
;;; This command saves a copy of the current document on the disk under a
;;; new name.  
;;;
(example
 :name drafter2-21
 :englishform "This command saves a copy ..."
 :logicalform (s2 / dispositive-material-action  :lex save
                  :actor (com1 / decomposable-object :lex command
                               :determiner this)
                  :actee (copy1 / dispositive-material-action  :lex copy
                                :determiner a ; Why do I need to specify this?
                                :part-of (doc1 / decomposable-object :lex document
                                               :determiner the
                                               :property-ascription (cur1 / quality
                                                                          :lex current))
                                )
                  :spatial-locating (disk1 / one-or-two-d-location :lex floppy-disk
                                           :determiner the)
                  ;; gives "with" rather than "under"
                  :instrumental (name1 / decomposable-object :lex name
                                       :property-ascription (q2 / quality
                                                                :lex new))
                  ))


;;;----------------------------------------------------------------
;;; It is usable when the document is open on the desktop.
;;;
;;; same as drafter2-19.