(FILECREATED "10-Jul-85 19:33:14" {PHYLUM}<HILL>MAKEGRAPH>MAKEGRAPH.;2 20155  

      changes to:  (FNS MAKE.GRAPH.CONSTRUCT.BELOW MAKE.GRAPH.NODE.TYPE MAKE.GRAPH.STATE)
		   (VARS MAKEGRAPHCOMS)

      previous date: "19-May-84 09:27:46" {EROS}<LISPUSERS>MAKEGRAPH.;7)


(* Copyright (c) 1984, 1985 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT MAKEGRAPHCOMS)

(RPAQQ MAKEGRAPHCOMS ((FNS MAKE.GRAPH MAKE.GRAPH.ACCESS MAKE.GRAPH.ACCESS.NODES 
			   MAKE.GRAPH.ALREADY.SEENP MAKE.GRAPH.CONSTRUCT MAKE.GRAPH.CONSTRUCT.BELOW 
			   MAKE.GRAPH.DATUM MAKE.GRAPH.EXAMPLE.1 MAKE.GRAPH.EXAMPLE.2 
			   MAKE.GRAPH.FATHER MAKE.GRAPH.FIND.ROOTS MAKE.GRAPH.FIND.ROOTS.BELOW 
			   MAKE.GRAPH.INTERNAL.LEFTBUTTONFN MAKE.GRAPH.INTERNAL.MIDDLEBUTTONFN 
			   MAKE.GRAPH.INTERNAL.TITLE.FN MAKE.GRAPH.INTERNAL.TITLE.FN.MENU 
			   MAKE.GRAPH.LABEL MAKE.GRAPH.LEFTBUTTONFN MAKE.GRAPH.MAKE.SUBGRAPH 
			   MAKE.GRAPH.MIDDLEBUTTONFN MAKE.GRAPH.MIDDLEBUTTONFN.MENU 
			   MAKE.GRAPH.NODE.ALREADY.SEENP MAKE.GRAPH.NODE.SONS 
			   MAKE.GRAPH.NODE.SPECS.LABEL MAKE.GRAPH.NODE.SPECS.SONS 
			   MAKE.GRAPH.PROP.PAIRS MAKE.GRAPH.SHOW.LIST MAKE.GRAPH.SHOW.SPEC 
			   MAKE.GRAPH.NODE.TYPE MAKE.GRAPH.STATE MAKE.GRAPH.UPDATE.WINDOW)
	(FILES (FROM VALUEOF LISPUSERSDIRECTORIES)
	       GRAPHER)
	(VARS (MAKE.GRAPH.INTERNAL.TITLE.FN.MENU)
	      MAKE.GRAPH.LIST.SPEC
	      (MAKE.GRAPH.MIDDLEBUTTONFN.MENU)
	      MAKE.GRAPH.SPEC.SPEC)))
(DEFINEQ

(MAKE.GRAPH
  [LAMBDA (WINDOW TITLE GRAPH.SPECIFICATION ROOTS CONTEXT LEFTBUTTONFN MIDDLEBUTTONFN TOPJUSTIFYFLG 
		  DEPTH)                                     (* DAHJr " 6-MAY-83 18:45")

          (* * CREATES A GRAPHER WINDOW STARTING FROM ROOTS ACCORDING TO GRAPH.SPECIFICATION)



          (* * GRAPH.SPECIFICATION: A PLIST OF STATES WHOSE VALUES ARE ACTIONS)



          (* * ACTION: A PLIST WITH PROPERTIES: (LABEL LABEL.SPEC) (FONT FONT.SPEC) (SONS (SONS.SPEC STATE.SPEC)) 
	  (ROOTS (ROOTS.SPEC STATE.SPEC)))



          (* * x.SPEC: FORM TO BE EVAL'D IN AN ENVIRONMENT WHERE DATUM AND CONTEXT ARE BOUND)



          (* * ROOTS: ((DATUM %. STATE) ... (DATUM %. STATE)))


    (PROG (TTL GRAPH NEW.WINDOW LBF MBF)
          (SETQ LBF (OR LEFTBUTTONFN (FUNCTION MAKE.GRAPH.LEFTBUTTONFN)))
          (SETQ MBF (OR MIDDLEBUTTONFN (FUNCTION MAKE.GRAPH.MIDDLEBUTTONFN)))
          (SETQ TTL (OR TITLE "A graph"))
          (SETQ GRAPH (MAKE.GRAPH.CONSTRUCT GRAPH.SPECIFICATION ROOTS CONTEXT DEPTH))
          (SETQ NEW.WINDOW (SHOWGRAPH GRAPH WINDOW (FUNCTION MAKE.GRAPH.INTERNAL.LEFTBUTTONFN)
				      (FUNCTION MAKE.GRAPH.INTERNAL.MIDDLEBUTTONFN)
				      TOPJUSTIFYFLG))
          (WINDOWPROP NEW.WINDOW (QUOTE TITLE)
		      TITLE)
          (WINDOWPROP NEW.WINDOW (QUOTE GRAPH.SPECIFICATION)
		      GRAPH.SPECIFICATION)
          (WINDOWPROP NEW.WINDOW (QUOTE ROOTS)
		      ROOTS)
          (WINDOWPROP NEW.WINDOW (QUOTE CONTEXT)
		      CONTEXT)
          (WINDOWPROP NEW.WINDOW (QUOTE LEFTBUTTONFN)
		      LBF)
          (WINDOWPROP NEW.WINDOW (QUOTE MIDDLEBUTTONFN)
		      MBF)
          (WINDOWPROP NEW.WINDOW (QUOTE TOPJUSTIFYFLG)
		      TOPJUSTIFYFLG)
          (WINDOWPROP NEW.WINDOW (QUOTE DEPTH)
		      DEPTH)
          (RETURN NEW.WINDOW])

(MAKE.GRAPH.ACCESS
  [LAMBDA (DATUM ACCESS.SPEC CONTEXT)                        (* edited: " 7-MAR-83 15:08")
    (EVAL ACCESS.SPEC])

(MAKE.GRAPH.ACCESS.NODES
  [LAMBDA (NODES.SPECS DATUM CONTEXT)                        (* DAHJr "10-MAR-83 09:50")
    (PROG (DATUM.SPEC STATE.SPEC NEW.NODES NEW.DATUM)
          (SETQ DATUM.SPEC (CAR NODES.SPECS))
          (SETQ STATE.SPEC (CADR NODES.SPECS))
          (RETURN (SELECTQ DATUM.SPEC
			   (EVAL (EVAL STATE.SPEC))
			   [LIST (for SUB.SPEC in (CDR NODES.SPECS)
				    collect (SETQ NEW.DATUM (MAKE.GRAPH.ACCESS DATUM (CAR SUB.SPEC)
									       CONTEXT))
					    (CONS NEW.DATUM (MAKE.GRAPH.ACCESS NEW.DATUM
									       (CADR SUB.SPEC)
									       CONTEXT]
			   (UNION (for SUB.SPEC in (CDR NODES.SPECS) join (MAKE.GRAPH.ACCESS.NODES
									    SUB.SPEC DATUM CONTEXT)))
			   (TRACE (SETQ NEW.NODES (MAKE.GRAPH.ACCESS.NODES (CADR NODES.SPECS)
									   DATUM CONTEXT))
				  (INSPECT NEW.NODES)
				  NEW.NODES)
			   (for NEW.DATUM in (MAKE.GRAPH.ACCESS DATUM DATUM.SPEC CONTEXT)
			      collect (CONS NEW.DATUM (MAKE.GRAPH.ACCESS NEW.DATUM STATE.SPEC CONTEXT]
)

(MAKE.GRAPH.ALREADY.SEENP
  [LAMBDA (NODE GRAPHNODES)                                  (* DAHJr " 7-MAR-83 14:03")
    (for GRAPHNODE in GRAPHNODES bind ID
       thereis (SETQ ID (fetch (GRAPHNODE NODEID) of GRAPHNODE))
	       (AND (EQ (CAR NODE)
			(CAR ID))
		    (EQ (CDR NODE)
			(CDR ID])

(MAKE.GRAPH.CONSTRUCT
  [LAMBDA (GRAPH.SPECIFICATION INITIAL.ROOTS CONTEXT DEPTH)
                                                             (* DAHJr " 6-MAY-83 18:16")
    (PROG ((GRAPHNODES (CONS))
	   (ROOTS (CONS))
	   IROOTS ROOT)
          (SETQ IROOTS (APPEND INITIAL.ROOTS))
          (until (NULL IROOTS)
	     do (SETQ ROOT (CAR IROOTS))
		(COND
		  ((NOT (MAKE.GRAPH.ALREADY.SEENP ROOT (CAR GRAPHNODES)))
		    (TCONC ROOTS ROOT)
		    (MAKE.GRAPH.CONSTRUCT.BELOW ROOT CONTEXT GRAPH.SPECIFICATION GRAPHNODES IROOTS 
						DEPTH)))
		(SETQ IROOTS (CDR IROOTS)))
          (RETURN (LAYOUTLATTICE (CAR GRAPHNODES)
				 (DREVERSE (CAR ROOTS])

(MAKE.GRAPH.CONSTRUCT.BELOW
  [LAMBDA (NODE CONTEXT GRAPH.SPECIFICATION GRAPHNODES ROOTS DEPTH)
                                                             (* rdh: "10-Jul-85 19:31")
    (PROG (ALREADY.SEEN DATUM NODE.TYPE NODE.TYPE.DESCRIPTION GRAPHNODE LABEL.SPEC LABEL FONT.SPEC 
			FONT REFERENCE SONS SONS.SPEC SON.REFERENCES ROOTS.SPEC)
          (SETQ DATUM (CAR NODE))
          (SETQ NODE.TYPE (CDR NODE))
          (SETQ NODE.TYPE.DESCRIPTION (LISTGET GRAPH.SPECIFICATION NODE.TYPE))
          (OR NODE.TYPE.DESCRIPTION (ERROR NODE.TYPE "unrecognized state"))
          (SETQ ALREADY.SEEN (MAKE.GRAPH.ALREADY.SEENP NODE (CAR GRAPHNODES)))
          (SETQ REFERENCE (COND
	      (ALREADY.SEEN (CONS (CAR NODE)
				  (CDR NODE)))
	      (T NODE)))
          (SETQ LABEL.SPEC (LISTGET NODE.TYPE.DESCRIPTION (QUOTE LABEL)))
          (SETQ LABEL (COND
	      (LABEL.SPEC (MAKE.GRAPH.ACCESS DATUM LABEL.SPEC CONTEXT))
	      (T "???")))
          (SETQ FONT.SPEC (LISTGET NODE.TYPE.DESCRIPTION (QUOTE FONT)))
          (SETQ FONT (COND
	      (FONT.SPEC (MAKE.GRAPH.ACCESS DATUM FONT.SPEC CONTEXT))
	      (T NIL)))
          (SETQ GRAPHNODE (create GRAPHNODE
				  NODEID ← REFERENCE
				  NODELABEL ← LABEL
				  NODEFONT ← FONT))
          (TCONC GRAPHNODES GRAPHNODE)
          [COND
	    (ALREADY.SEEN (replace (GRAPHNODE NODEBORDER) of GRAPHNODE with T))
	    ((ZEROP DEPTH))
	    (T (SETQ SONS.SPEC (LISTGET NODE.TYPE.DESCRIPTION (QUOTE SONS)))
	       [COND
		 (SONS.SPEC (SETQ SONS (MAKE.GRAPH.ACCESS.NODES SONS.SPEC DATUM CONTEXT))
			    [SETQ SON.REFERENCES (for SON in SONS
						    collect (MAKE.GRAPH.CONSTRUCT.BELOW
							      SON CONTEXT GRAPH.SPECIFICATION 
							      GRAPHNODES ROOTS (COND
								((NUMBERP DEPTH)
								  (SUB1 DEPTH]
			    (replace (GRAPHNODE TONODES) of GRAPHNODE with (DREVERSE SON.REFERENCES]
	       (SETQ ROOTS.SPEC (LISTGET NODE.TYPE.DESCRIPTION (QUOTE ROOTS)))
	       (COND
		 (ROOTS.SPEC (NCONC ROOTS (MAKE.GRAPH.ACCESS.NODES ROOTS.SPEC DATUM CONTEXT]
          (RETURN REFERENCE])

(MAKE.GRAPH.DATUM
  [LAMBDA (NODE)
    (CAR (fetch (GRAPHNODE NODEID) of NODE])

(MAKE.GRAPH.EXAMPLE.1
  [LAMBDA NIL                                                (* DAHJr " 6-MAY-83 18:50")
    (MAKE.GRAPH.SHOW.SPEC MAKE.GRAPH.SPEC.SPEC])

(MAKE.GRAPH.EXAMPLE.2
  [LAMBDA (DEPTH)                                            (* DAHJr " 6-MAY-83 18:51")
    (MAKE.GRAPH.SHOW.LIST MAKE.GRAPH.LIST.SPEC DEPTH])

(MAKE.GRAPH.FATHER
  [LAMBDA (NODE WINDOW)                                      (* DAHJr " 8-MAR-83 19:03")
    (PROG (GRAPH GRAPHNODES FATHERS ID)
          (SETQ GRAPH (WINDOWPROP WINDOW (QUOTE GRAPH)))
          (SETQ GRAPHNODES (fetch (GRAPH GRAPHNODES) of GRAPH))
          (SETQ FATHERS (fetch (GRAPHNODE FROMNODES) of NODE))
          (RETURN (COND
		    (FATHERS (SETQ ID (CAR FATHERS))
			     (for GRAPHNODE in GRAPHNODES thereis (EQ (fetch (GRAPHNODE NODEID)
									 of GRAPHNODE)
								      ID)))
		    (T NIL])

(MAKE.GRAPH.FIND.ROOTS
  [LAMBDA (GRAPH.SPECIFICATION INITIAL.ROOTS CONTEXT DEPTH)
                                                             (* DAHJr " 6-MAY-83 18:18")
    (PROG ((NODES (CONS))
	   (NON-ROOTS (CONS))
	   IROOTS ROOT)
          (SETQ IROOTS (APPEND INITIAL.ROOTS))
          (until (NULL IROOTS)
	     do (SETQ ROOT (CAR IROOTS))
		(MAKE.GRAPH.FIND.ROOTS.BELOW ROOT CONTEXT GRAPH.SPECIFICATION NODES IROOTS NON-ROOTS 
					     DEPTH)
		(SETQ IROOTS (CDR IROOTS)))
          (RETURN (LDIFFERENCE (CAR NODES)
			       (CAR NON-ROOTS])

(MAKE.GRAPH.FIND.ROOTS.BELOW
  [LAMBDA (NODE CONTEXT GRAPH.SPECIFICATION NODES ROOTS NON-ROOTS DEPTH)
                                                             (* DAHJr " 6-MAY-83 18:18")
    (PROG (DATUM STATE STATE.DESCRIPTION REFERENCE SONS SONS.SPEC SON.REFERENCES ROOTS.SPEC)
          (SETQ DATUM (CAR NODE))
          (SETQ STATE (CDR NODE))
          (SETQ STATE.DESCRIPTION (LISTGET GRAPH.SPECIFICATION STATE))
          (OR STATE.DESCRIPTION (ERROR STATE "unrecognized state"))
          [COND
	    ((MAKE.GRAPH.NODE.ALREADY.SEENP NODE (CAR NODES)))
	    ((ZEROP DEPTH))
	    (T (TCONC NODES NODE)
	       (SETQ SONS.SPEC (LISTGET STATE.DESCRIPTION (QUOTE SONS)))
	       [COND
		 (SONS.SPEC (SETQ SONS (MAKE.GRAPH.ACCESS.NODES SONS.SPEC DATUM CONTEXT))
			    (for SON in SONS
			       collect (TCONC NON-ROOTS SON)
				       (MAKE.GRAPH.FIND.ROOTS.BELOW SON CONTEXT GRAPH.SPECIFICATION 
								    NODES ROOTS NON-ROOTS
								    (COND
								      ((NUMBERP DEPTH)
									(SUB1 DEPTH]
	       (SETQ ROOTS.SPEC (LISTGET STATE.DESCRIPTION (QUOTE ROOTS)))
	       (COND
		 (ROOTS.SPEC (NCONC ROOTS (MAKE.GRAPH.ACCESS.NODES ROOTS.SPEC DATUM CONTEXT]
          (RETURN])

(MAKE.GRAPH.INTERNAL.LEFTBUTTONFN
  [LAMBDA (NODE WINDOW)                                      (* DAHJr " 9-MAR-83 12:02")
    (PROG (X Y REG FN)
          (SETQ X (LASTMOUSEX WINDOW))
          (SETQ Y (LASTMOUSEY WINDOW))
          [SETQ REG (DSPCLIPPINGREGION NIL (WINDOWPROP WINDOW (QUOTE DSP]
          (RETURN (COND
		    ((INSIDEP REG X Y)
		      (APPLY* (WINDOWPROP WINDOW (QUOTE LEFTBUTTONFN))
			      NODE WINDOW))
		    (T (SETQ FN (WINDOWPROP WINDOW (QUOTE TITLE.LEFTBUTTONFN)))
		       (COND
			 (FN (APPLY* FN WINDOW))
			 (T (MAKE.GRAPH.INTERNAL.TITLE.FN WINDOW])

(MAKE.GRAPH.INTERNAL.MIDDLEBUTTONFN
  [LAMBDA (NODE WINDOW)                                      (* DAHJr " 9-MAR-83 12:02")
    (PROG (X Y REG FN)
          (SETQ X (LASTMOUSEX WINDOW))
          (SETQ Y (LASTMOUSEY WINDOW))
          [SETQ REG (DSPCLIPPINGREGION NIL (WINDOWPROP WINDOW (QUOTE DSP]
          (RETURN (COND
		    ((INSIDEP REG X Y)
		      (APPLY* (WINDOWPROP WINDOW (QUOTE MIDDLEBUTTONFN))
			      NODE WINDOW))
		    (T (SETQ FN (WINDOWPROP WINDOW (QUOTE TITLE.MIDDLEBUTTONFN)))
		       (COND
			 (FN (APPLY* FN WINDOW))
			 (T (MAKE.GRAPH.INTERNAL.TITLE.FN WINDOW])

(MAKE.GRAPH.INTERNAL.TITLE.FN
  [LAMBDA (WINDOW)                                           (* DAHJr " 6-MAY-83 18:25")
    (PROG (COMMAND.MENU COMMAND)
          (SETQ COMMAND.MENU (MAKE.GRAPH.INTERNAL.TITLE.FN.MENU))
          (SETQ COMMAND (MENU COMMAND.MENU))
          (SELECTQ COMMAND
		   (NIL NIL)
		   (UPDATE (MAKE.GRAPH.UPDATE.WINDOW WINDOW))
		   [SHOW.GRAPH.SPEC (MAKE.GRAPH.SHOW.SPEC (WINDOWPROP WINDOW (QUOTE 
									      GRAPH.SPECIFICATION]
		   (ERROR])

(MAKE.GRAPH.INTERNAL.TITLE.FN.MENU
  [LAMBDA NIL                                                (* DAHJr " 6-MAY-83 18:24")
    (OR MAKE.GRAPH.INTERNAL.TITLE.FN.MENU (SETQ MAKE.GRAPH.INTERNAL.TITLE.FN.MENU
	  (create MENU
		  ITEMS ←(QUOTE (UPDATE SHOW.GRAPH.SPEC))
		  CENTERFLG ← T
		  CHANGEOFFSETFLG ← T])

(MAKE.GRAPH.LABEL
  [LAMBDA (GRAPHNODE)                                        (* DAHJr " 8-MAR-83 18:43")
    (fetch (GRAPHNODE NODELABEL) of GRAPHNODE])

(MAKE.GRAPH.LEFTBUTTONFN
  [LAMBDA (GRAPHNODE WINDOW)                                 (* DAHJr "29-MAR-83 18:03")
    (COND
      (GRAPHNODE (COND
		   ((KEYDOWNP (QUOTE LSHIFT))
		     (printout PROMPTWINDOW T "Left button selection:" T "   Node label: "
			       (MAKE.GRAPH.LABEL GRAPHNODE)
			       T "   Node state: " (MAKE.GRAPH.STATE GRAPHNODE)))
		   (T (PROG (POSITION CR CX CY DX DY)
			    (SETQ POSITION (fetch (GRAPHNODE NODEPOSITION) of GRAPHNODE))
			    [SETQ CR (DSPCLIPPINGREGION NIL (WINDOWPROP WINDOW (QUOTE DSP]
			    (SETQ CX (IPLUS (fetch (REGION LEFT) of CR)
					    (IQUOTIENT (fetch (REGION WIDTH) of CR)
						       2)))
			    (SETQ CY (IPLUS (fetch (REGION BOTTOM) of CR)
					    (IQUOTIENT (fetch (REGION HEIGHT) of CR)
						       2)))
			    (SETQ DX (IDIFFERENCE CX (fetch (POSITION XCOORD) of POSITION)))
			    (SETQ DY (IDIFFERENCE CY (fetch (POSITION YCOORD) of POSITION)))
			    (SCROLLBYREPAINTFN WINDOW DX DY])

(MAKE.GRAPH.MAKE.SUBGRAPH
  [LAMBDA (GRAPHNODE WINDOW)                                 (* DAHJr "25-JUN-83 16:26")
    (MAKE.GRAPH NIL (CONCAT (WINDOWPROP WINDOW (QUOTE TITLE))
			    " >")
		(WINDOWPROP WINDOW (QUOTE GRAPH.SPECIFICATION))
		(LIST (CONS (MAKE.GRAPH.DATUM GRAPHNODE)
			    (MAKE.GRAPH.STATE GRAPHNODE)))
		(WINDOWPROP WINDOW (QUOTE CONTEXT))
		(WINDOWPROP WINDOW (QUOTE LEFTBUTTONFN))
		(WINDOWPROP WINDOW (QUOTE MIDDLEBUTTONFN))
		(WINDOWPROP WINDOW (QUOTE TOPJUSTIFYFLG))
		(WINDOWPROP WINDOW (QUOTE DEPTH])

(MAKE.GRAPH.MIDDLEBUTTONFN
  [LAMBDA (GRAPHNODE WINDOW)                                 (* DAHJr "25-JUN-83 16:27")
    (COND
      (GRAPHNODE (COND
		   ((KEYDOWNP (QUOTE LSHIFT))
		     (INSPECT GRAPHNODE))
		   (T (PROG (COMMAND.MENU COMMAND)
			    (SETQ COMMAND.MENU (MAKE.GRAPH.MIDDLEBUTTONFN.MENU))
			    (SETQ COMMAND (MENU COMMAND.MENU))
			    (SELECTQ COMMAND
				     (NIL NIL)
				     (INSPECT (INSPECT (MAKE.GRAPH.DATUM GRAPHNODE)))
				     (MAKE.SUBGRAPH (MAKE.GRAPH.MAKE.SUBGRAPH GRAPHNODE WINDOW))
				     (ERROR])

(MAKE.GRAPH.MIDDLEBUTTONFN.MENU
  [LAMBDA NIL                                                (* DAHJr " 6-MAY-83 18:39")
    (OR MAKE.GRAPH.MIDDLEBUTTONFN.MENU (SETQ MAKE.GRAPH.MIDDLEBUTTONFN.MENU
	  (create MENU
		  ITEMS ←(QUOTE (INSPECT MAKE.SUBGRAPH))
		  CENTERFLG ← T
		  CHANGEOFFSETFLG ← T])

(MAKE.GRAPH.NODE.ALREADY.SEENP
  [LAMBDA (NODE NODES)                                       (* DAHJr "11-MAR-83 09:34")
    (for ND in NODES thereis (AND (EQ (CAR ND)
				      (CAR NODE))
				  (EQ (CDR ND)
				      (CDR NODE])

(MAKE.GRAPH.NODE.SONS
  [LAMBDA (DATUM)                                            (* DAHJr " 8-MAR-83 14:29")
    (COND
      [(FMEMB (CAR DATUM)
	      (QUOTE (SONS ROOTS)))
	(LIST (CONS (CADR DATUM)
		    (QUOTE NODE.SPECS]
      (T (LIST (CONS (CADR DATUM)
		     (QUOTE VALUE])

(MAKE.GRAPH.NODE.SPECS.LABEL
  [LAMBDA (DATUM)                                            (* DAHJr "10-MAR-83 09:55")
    (SELECTQ (CAR DATUM)
	     (EVAL (QUOTE EVAL))
	     (LIST (QUOTE LIST))
	     (UNION (QUOTE UNION))
	     (TRACE (QUOTE TRACE))
	     (QUOTE SPEC.PAIR])

(MAKE.GRAPH.NODE.SPECS.SONS
  [LAMBDA (DATUM)                                            (* DAHJr "10-MAR-83 09:53")
    (SELECTQ (CAR DATUM)
	     [EVAL (LIST (CONS (CADR DATUM)
			       (QUOTE VALUE]
	     [LIST (for ELEM in (CDR DATUM) collect (CONS ELEM (QUOTE NODE.SPEC]
	     [UNION (for ELEM in (CDR DATUM) collect (CONS ELEM (QUOTE NODE.SPECS]
	     [TRACE (LIST (CONS (CADR DATUM)
				(QUOTE NODE.SPECS]
	     (LIST (CONS (CAR DATUM)
			 (QUOTE NEW.DATUM.SPEC))
		   (CONS (CADR DATUM)
			 (QUOTE NEW.STATE.SPEC])

(MAKE.GRAPH.PROP.PAIRS
  [LAMBDA (PLIST)
    (for ELEMENT on PLIST by (CDDR ELEMENT) collect ELEMENT])

(MAKE.GRAPH.SHOW.LIST
  [LAMBDA (OBJECT DEPTH)                                     (* DAHJr " 6-MAY-83 18:20")
    (PROG (ROOTS SPEC.SPEC)
          [SETQ ROOTS (LIST (CONS OBJECT (QUOTE OBJECT]
          (RETURN (MAKE.GRAPH NIL "A list" MAKE.GRAPH.LIST.SPEC ROOTS NIL NIL NIL T DEPTH])

(MAKE.GRAPH.SHOW.SPEC
  [LAMBDA (SPEC)                                             (* DAHJr " 6-MAY-83 18:50")
    (PROG (ROOTS SPEC.SPEC)
          [SETQ ROOTS (LIST (CONS SPEC (QUOTE GRAPH.SPEC]
          (RETURN (MAKE.GRAPH NIL "A graph specification" MAKE.GRAPH.SPEC.SPEC ROOTS NIL NIL NIL T])

(MAKE.GRAPH.NODE.TYPE
  [LAMBDA (GRAPHNODE)                                        (* DAHJr " 8-MAR-83 18:43")
    (CDR (fetch (GRAPHNODE NODEID) of GRAPHNODE])

(MAKE.GRAPH.STATE
  [LAMBDA (GRAPHNODE)                                        (* rdh: "10-Jul-85 17:14")
    (MAKE.GRAPH.NODE.TYPE GRAPHNODE])

(MAKE.GRAPH.UPDATE.WINDOW
  [LAMBDA (WINDOW)                                           (* DAHJr " 6-MAY-83 18:44")
    (MAKE.GRAPH WINDOW (WINDOWPROP WINDOW (QUOTE TITLE))
		(WINDOWPROP WINDOW (QUOTE GRAPH.SPECIFICATION))
		(WINDOWPROP WINDOW (QUOTE ROOTS))
		(WINDOWPROP WINDOW (QUOTE CONTEXT))
		(WINDOWPROP WINDOW (QUOTE LEFTBUTTONFN))
		(WINDOWPROP WINDOW (QUOTE MIDDLEBUTTONFN))
		(WINDOWPROP WINDOW (QUOTE TOPJUSTIFYFLG))
		(WINDOWPROP WINDOW (QUOTE DEPTH])
)
(FILESLOAD (FROM VALUEOF LISPUSERSDIRECTORIES)
	   GRAPHER)

(RPAQQ MAKE.GRAPH.INTERNAL.TITLE.FN.MENU NIL)

(RPAQQ MAKE.GRAPH.LIST.SPEC [OBJECT (DOC (ANY LISP OBJECT)
					 LABEL
					 (COND ((LISTP DATUM)
						"( )")
					       (T DATUM))
					 SONS
					 ((COND ((LISTP DATUM)
						 DATUM)
						(T NIL))
					  (QUOTE OBJECT])

(RPAQQ MAKE.GRAPH.MIDDLEBUTTONFN.MENU NIL)

(RPAQQ MAKE.GRAPH.SPEC.SPEC (GRAPH.SPEC (DOC (A PLIST OF STATE.SPECS)
					     LABEL
					     (QUOTE GRAPH.SPEC)
					     SONS
					     ((MAKE.GRAPH.PROP.PAIRS DATUM)
					      (QUOTE STATE.SPEC)))
					STATE.SPEC
					(DOC (A PLIST OF PROPERTIES)
					     LABEL
					     (CAR DATUM)
					     SONS
					     ((MAKE.GRAPH.PROP.PAIRS (CADR DATUM))
					      (QUOTE PROPERTY)))
					PROPERTY
					(DOC (A PROPERTY, EG. DOC, LABEL, FONT, SONS, ROOTS)
					     LABEL
					     (CAR DATUM)
					     SONS
					     (EVAL (MAKE.GRAPH.NODE.SONS DATUM)))
					NODE.SPECS
					(DOC (A SPEC OF DATUM/STATE PAIRS)
					     LABEL
					     (MAKE.GRAPH.NODE.SPECS.LABEL DATUM)
					     SONS
					     (EVAL (MAKE.GRAPH.NODE.SPECS.SONS DATUM)))
					NODE.SPEC
					[DOC (A SPEC OF A SINGLE DATUM/STATE PAIR)
					     LABEL
					     (QUOTE NODE.SPEC)
					     SONS
					     (LIST ((CAR DATUM)
						    (QUOTE NEW.DATA.SPEC))
						   ((CADR DATUM)
						    (QUOTE NEW.STATE.SPEC]
					NEW.DATA.SPEC
					(DOC (THE NEW.DATUM.SPEC)
					     LABEL
					     (QUOTE DATA)
					     SONS
					     ((LIST DATUM)
					      (QUOTE VALUE)))
					NEW.DATUM.SPEC
					(DOC (THE NEW.DATUM.SPEC)
					     LABEL
					     (QUOTE DATUM)
					     SONS
					     ((LIST DATUM)
					      (QUOTE VALUE)))
					NEW.STATE.SPEC
					(DOC (THE NEW.STATE.SPEC)
					     LABEL
					     (QUOTE STATE)
					     SONS
					     ((LIST DATUM)
					      (QUOTE VALUE)))
					VALUE
					(DOC (A VALUE)
					     LABEL DATUM)))
(PUTPROPS MAKEGRAPH COPYRIGHT ("Xerox Corporation" 1984 1985))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (1435 18169 (MAKE.GRAPH 1445 . 3250) (MAKE.GRAPH.ACCESS 3252 . 3393) (
MAKE.GRAPH.ACCESS.NODES 3395 . 4462) (MAKE.GRAPH.ALREADY.SEENP 4464 . 4791) (MAKE.GRAPH.CONSTRUCT 4793
 . 5468) (MAKE.GRAPH.CONSTRUCT.BELOW 5470 . 7769) (MAKE.GRAPH.DATUM 7771 . 7862) (MAKE.GRAPH.EXAMPLE.1
 7864 . 8035) (MAKE.GRAPH.EXAMPLE.2 8037 . 8214) (MAKE.GRAPH.FATHER 8216 . 8788) (
MAKE.GRAPH.FIND.ROOTS 8790 . 9364) (MAKE.GRAPH.FIND.ROOTS.BELOW 9366 . 10591) (
MAKE.GRAPH.INTERNAL.LEFTBUTTONFN 10593 . 11186) (MAKE.GRAPH.INTERNAL.MIDDLEBUTTONFN 11188 . 11787) (
MAKE.GRAPH.INTERNAL.TITLE.FN 11789 . 12282) (MAKE.GRAPH.INTERNAL.TITLE.FN.MENU 12284 . 12605) (
MAKE.GRAPH.LABEL 12607 . 12777) (MAKE.GRAPH.LEFTBUTTONFN 12779 . 13813) (MAKE.GRAPH.MAKE.SUBGRAPH 
13815 . 14361) (MAKE.GRAPH.MIDDLEBUTTONFN 14363 . 14918) (MAKE.GRAPH.MIDDLEBUTTONFN.MENU 14920 . 15231
) (MAKE.GRAPH.NODE.ALREADY.SEENP 15233 . 15482) (MAKE.GRAPH.NODE.SONS 15484 . 15774) (
MAKE.GRAPH.NODE.SPECS.LABEL 15776 . 16059) (MAKE.GRAPH.NODE.SPECS.SONS 16061 . 16616) (
MAKE.GRAPH.PROP.PAIRS 16618 . 16740) (MAKE.GRAPH.SHOW.LIST 16742 . 17040) (MAKE.GRAPH.SHOW.SPEC 17042
 . 17351) (MAKE.GRAPH.NODE.TYPE 17353 . 17533) (MAKE.GRAPH.STATE 17535 . 17690) (
MAKE.GRAPH.UPDATE.WINDOW 17692 . 18167)))))
STOP