(FILECREATED " 7-Dec-84 21:22:35" {ISI-VAXA}</USR4/LIPKIS>UTILISOPRS.;3 3868   

      changes to:  (VARS UTILISOPRSCOMS)
		   (I.S.OPRS MINIMIZE MAXIMIZE)

      previous date: "28-OCT-82 12:18:28" {ISI-VAXA}</USR4/LIPKIS>UTILISOPRS.;2)


(PRETTYCOMPRINT UTILISOPRSCOMS)

(RPAQQ UTILISOPRSCOMS [(I.S.OPRS ELSE COLLECTWHEN INTERSECT MAXIMIZE MINIMIZE REPEATEACHTIME THEN 
				 UNION UNIQUE YIELD FIRSTTIME fintersect funion)
		       (ADDVARS (LOCALVARS $$STATE $$TMP $$UIV $$UNQ $$FLTR)
				(SYSLOCALVARS $$STATE $$TMP $$UIV $$UNQ $$FLTR))
		       (* This package allows THEN and ELSE <and then and else> to PrettyPrint 
			  properly, in spite of the redefinition of them as i.s.operators. 
			  Implemented by Lee Erman, from an idea of Phil London's.)
		       (FNS FIntersection FUnion IF-PRETTYPRINTMACRO PRINT-THEN/ELSE-IN-IF)
		       (ADDVARS (PRETTYPRINTMACROS (IF . IF-PRETTYPRINTMACRO)
						   (if . IF-PRETTYPRINTMACRO)])
(DECLARE: EVAL@COMPILE 
[I.S.OPR (QUOTE ELSE)
	 NIL
	 (QUOTE (finally (OR $$VAL (RETURN BODY]
(I.S.OPR (QUOTE COLLECTWHEN)
	 NIL
	 (QUOTE (bind $$FLTR when (SETQ $$FLTR BODY)
		      collect $$FLTR)))
(I.S.OPR (QUOTE INTERSECT)
	 [QUOTE (PROGN (INTBOD ← BODY)
		       (OR ($$VAL ← (COND ($$VAL (INTERSECTION $$VAL INTBOD))
					  (T INTBOD)))
			   (GO $$OUT]
	 (QUOTE (BIND INTBOD)))
(I.S.OPR (QUOTE MAXIMIZE)
	 NIL
	 (QUOTE (largest BODY yield $$EXTREME)))
(I.S.OPR (QUOTE MINIMIZE)
	 NIL
	 (QUOTE (smallest BODY yield $$EXTREME)))
[I.S.OPR (QUOTE REPEATEACHTIME)
	 NIL
	 (QUOTE (repeatuntil (PROGN BODY NIL]
[I.S.OPR (QUOTE THEN)
	 NIL
	 (QUOTE (finally (AND $$VAL (RETURN BODY]
[I.S.OPR (QUOTE UNION)
	 (QUOTE ($$VAL ← (UNION $$VAL BODY]
[I.S.OPR (QUOTE UNIQUE)
	 (QUOTE (if $$VAL
		    then ($$VAL← NIL)
			 (GO $$OUT)
		  else $$VAL ← $$UNQ $$UIV ← I.V.))
	 (QUOTE (bind ($$UNQ $$UIV)
		      when $$UNQ ← BODY finally (I.V.← (AND $$VAL $$UIV]
[I.S.OPR (QUOTE YIELD)
	 NIL
	 (QUOTE (FINALLY (RETURN BODY]
[I.S.OPR (QUOTE FIRSTTIME)
	 NIL
	 (QUOTE (bind ($$MEMO ← T)
		      unless
		      (AND $$MEMO (PROGN BODY T)
			   (SETQ $$MEMO NIL]
(I.S.OPR (QUOTE fintersect)
	 [QUOTE (PROGN (INTBOD ← BODY)
		       (OR ($$VAL ← (COND ($$VAL (FIntersection $$VAL INTBOD))
					  (T INTBOD)))
			   (GO $$OUT]
	 (QUOTE (BIND INTBOD)))
[I.S.OPR (QUOTE funion)
	 (QUOTE ($$VAL ← (FUnion $$VAL BODY]
)

(ADDTOVAR LOCALVARS $$STATE $$TMP $$UIV $$UNQ $$FLTR)

(ADDTOVAR SYSLOCALVARS $$STATE $$TMP $$UIV $$UNQ $$FLTR)



(* This package allows THEN and ELSE <and then and else> to PrettyPrint properly, in spite of 
the redefinition of them as i.s.operators. Implemented by Lee Erman, from an idea of Phil 
London's.)

(DEFINEQ

(FIntersection
  [LAMBDA (X Y)                                              (* TAL "27-OCT-82 17:54")
    (for item in X when (FMEMB item Y) collect item])

(FUnion
  [LAMBDA (X Y)                                              (* TAL "28-OCT-82 12:00")
    (bind (tmp ← Y) for item in X unless (FMEMB item tmp) do (push tmp item) finally (RETURN tmp])

(IF-PRETTYPRINTMACRO
  [LAMBDA (EXPR)
    (COND
      ((EQ [CAR (DEFERREDCONSTANT (GETPROP (QUOTE THEN)
					   (QUOTE CLISPWORD]
	   (QUOTE IFWORD))
	EXPR)
      (T (RESETFORM (PRINT-THEN/ELSE-IN-IF (QUOTE IFWORD))
		    (PRINTDEF EXPR NIL T))
	 NIL])

(PRINT-THEN/ELSE-IN-IF
  [LAMBDA (WHATWORD)
    [MAPC [DEFERREDCONSTANT (LIST (GETPROP (QUOTE then)
					   (QUOTE CLISPWORD))
				  (GETPROP (QUOTE THEN)
					   (QUOTE CLISPWORD))
				  (GETPROP (QUOTE else)
					   (QUOTE CLISPWORD))
				  (GETPROP (QUOTE ELSE)
					   (QUOTE CLISPWORD]
	  (FUNCTION (LAMBDA (X)
	      (FRPLACA X WHATWORD]
    (QUOTE FORWORD])
)

(ADDTOVAR PRETTYPRINTMACROS (IF . IF-PRETTYPRINTMACRO)
			    (if . IF-PRETTYPRINTMACRO))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (2689 3743 (FIntersection 2699 . 2878) (FUnion 2880 . 3109) (IF-PRETTYPRINTMACRO 3111 . 
3371) (PRINT-THEN/ELSE-IN-IF 3373 . 3741)))))
STOP