File psl-1983/glisp/gevdemo.sl artifact 61b0197c02 on branch master



% {DSK}GEVDEMO.PSL;1  5-FEB-83 15:41:04 





(GLISPOBJECTS


(PROJECT (ATOM (PROPLIST (TITLE STRING)
			 (ABBREVIATION ATOM)
			 (ADMINISTRATOR PERSON)
			 (CONTRACTS (LISTOF CONTRACT))
			 (EXECUTIVES (LISTOF PERSON))))
PROP    ((SHORTVALUE (ABBREVIATION))
	 (DISPLAYPROPS (T))
	 (BUDGET TOTAL-BUDGET)))


(CONTRACT (ATOM (PROPLIST (TITLE STRING)
			  (LEADER PERSON)
			  (SPONSOR AGENCY)
			  (BUDGET BUDGET)))
PROP    ((SHORTVALUE (TITLE))))


(AGENCY (ATOM (PROPLIST (NAME STRING)
			(ABBREVIATION ATOM)
			(ADDRESS ADDRESS)
			(PHONE PHONE-NUMBER)))
PROP    ((SHORTVALUE (ABBREVIATION))))


(PERSON (ATOM (PROPLIST (NAME STRING)
			(INITIALS ATOM)
			(TITLE ATOM)
			(PROJECT PROJECT)
			(SALARY REAL)
			(SSNO INTEGER)
			(BIRTHDATE DATE)
			(PHONE PHONE-NUMBER)
			(OFFICE CAMPUS-ADDRESS)
			(HOME-ADDRESS ADDRESS)
			(HOME-PHONE PHONE-NUMBER)
			(PICTURE PICTURE)))
PROP    ((SHORTVALUE (INITIALS))
	 (CONTRACTS ((THOSE CONTRACTS OF PROJECT WITH LEADER=self)))
	 (AGE ((THE YEAR OF (TODAYS-DATE))
	       - BIRTHDATE:YEAR))
	 (MONTHLY-SALARY (SALARY/12))
	 (DISPLAYPROPS (T)))
ADJ     ((FACULTY ((MEMB TITLE '(PROF ASSOC-PROF ASST-PROF))))))


(BUDGET (LIST (LABOR REAL)
	      (COMPUTER REAL))
PROP    ((OVERHEAD (LABOR * 0.59))
	 (TOTAL (LABOR+OVERHEAD+COMPUTER))
	 (SHORTVALUE (TOTAL))
	 (DISPLAYPROPS (T))))


(ADDRESS (LIST (STREET STRING)
	       (CITY STRING)
	       (STATE ATOM)
	       (ZIP INTEGER))
PROP    ((SHORTVALUE ((CONCAT CITY ", " STATE)))))


(PHONE-NUMBER (LIST (AREA INTEGER)
		    (NUMBER INTEGER))
PROP    ((SHORTVALUE ((CONCAT "(" AREA ") " (SUBSTRING NUMBER 1 3)
			      "-"
			      (SUBSTRING NUMBER 4 7)))))
ADJ     ((LOCAL (AREA=415 OR AREA=408))))


(DATE (LIST (MONTH INTEGER)
	    (DAY INTEGER)
	    (SHORTYEAR INTEGER))
PROP    ((MONTHNAME ((CAR (NTH '(January February March April May June July 
					 August September October November 
					 December)
			       MONTH))))
	 (YEAR (SHORTYEAR + 1900))
	 (SHORTVALUE ((CONCAT MONTHNAME " " DAY ", " YEAR)))))


(PICTURE ANYTHING
MSG     ((EDIT PAINTW)
	 (GEVDISPLAY PICTURE-GEVDISPLAY)))


(CAMPUS-ADDRESS (LIST (BUILDING BUILDING)
		      (ROOM ATOM))
PROP    ((SHORTVALUE ((CONCAT BUILDING:ABBREVIATION " " ROOM)))))


(BUILDING (ATOM (PROPLIST (ABBREVIATION ATOM)
			  (NAME STRING)
			  (NUMBER INTEGER)))
PROP    ((SHORTVALUE (NAME))))


(CIRCLE (LIST (START VECTOR)
	      (RADIUS REAL))
PROP    ((PI (3.141593))
	 (DIAMETER (RADIUS*2))
	 (CIRCUMFERENCE (PI*DIAMETER))
	 (AREA (PI*RADIUS^2))
	 (SQUARESIDE ((SQRT AREA)))
	 (DISPLAYPROPS ('(DIAMETER CIRCUMFERENCE AREA))))
MSG     ((GROW (AREA_+100))
	 (SHRINK (AREA_AREA/2))
	 (STANDARD (AREA_100.0)))
ADJ     ((BIG (AREA>100))
	 (SMALL (AREA<80))))


(VECTOR (LIST (X INTEGER)
	      (Y INTEGER))
PROP    ((MAGNITUDE ((SQRT X^2 + Y^2)))
	 (ANGLE ((ARCTAN2 Y X T))
		RESULT RADIANS)
	 (UNITVECTOR ((A RVECTOR WITH X = X/MAGNITUDE Y = Y/MAGNITUDE))))
ADJ     ((ZERO (X IS ZERO AND Y IS ZERO))
	 (NORMALIZED (MAGNITUDE = 1.0)))
MSG     ((PRIN1 ((PRIN1 "(")
		 (PRIN1 X)
		 (PRIN1 ",")
		 (PRIN1 Y)
		 (PRIN1 ")")))
	 (PRINT ((_ self PRIN1)
		 (TERPRI)))))


(RADIANS REAL
PROP    ((DEGREES (self* (180.0/3.1415926))
		  RESULT DEGREES)
	 (DISPLAYPROPS (T))))


(DEGREES REAL
PROP    ((RADIANS (self* (3.1415926/180.0))
		  RESULT RADIANS)
	 (DISPLAYPROPS (T))))


(RVECTOR (LIST (X REAL)
	       (Y REAL))
SUPERS  (VECTOR))

)



% edited:  6-NOV-82 14:41 
% Initialize data structures for GEV demo. 
(DG GEVDEMO-INIT NIL
(PROG NIL (HPP _ (A PROJECT WITH TITLE = "Heuristic Programming Project" 
		    ABBREVIATION = 'HPP))
      (MJH _ (A BUILDING WITH ABBREVIATION = 'MJH
		NAME = "Margaret Jacks Hall" NUMBER = 460))
      (ARPA _ (AN AGENCY WITH NAME = 
		  "Defense Advanced Research Projects Agency"
		  ABBREVIATION = 'ARPA
		  ADDRESS =
		  (AN ADDRESS WITH STREET = "1400 Wilson Blvd." CITY = 
		      "Arlington"
		      STATE = 'VA
		      ZIP = 22209)
		  PHONE = (A PHONE-NUMBER WITH AREA = 202 NUMBER = 6944349)))
      (NSF _ (AN AGENCY WITH NAME = "National Science Foundation" ABBREVIATION 
		 = 'NSF
		 ADDRESS =
		 (AN ADDRESS WITH STREET = "1800 G STREET N.W." CITY = 
		     "Washington"
		     STATE = 'DC
		     ZIP = 20550)
		 PHONE = (A PHONE-NUMBER WITH AREA = 202 NUMBER = 6327346)))
      (NIH _ (AN AGENCY WITH NAME = "National Institutes of Health" 
		 ABBREVIATION = 'NIH
		 ADDRESS =
		 (AN ADDRESS WITH STREET = "9000 Rockville Pike" CITY = 
		     "Bethesda"
		     STATE = 'MD
		     ZIP = 20001)
		 PHONE = (A PHONE-NUMBER WITH AREA = 301 NUMBER = 4964000)))
      (GSN _
	   (A PERSON WITH NAME = "Gordon S. Novak Jr." INITIALS =
	      'GSN
	      TITLE = 'VISITOR
	      PROJECT = HPP SALARY = 30000.0 SSNO = 455827977 BIRTHDATE =
	      (A DATE WITH DAY = 21 MONTH = 7 SHORTYEAR = 47)
	      PHONE = (A PHONE-NUMBER WITH AREA = 415 NUMBER = 4974532)
	      OFFICE = (A CAMPUS-ADDRESS WITH BUILDING = MJH ROOM = 244)
	      HOME-PHONE = (A PHONE-NUMBER WITH AREA = 415 NUMBER = 4935807)
	      HOME-ADDRESS =
	      (AN ADDRESS WITH STREET = "3857 Ross Road" CITY = "Palo Alto" 
		  STATE = 'CA
		  ZIP = 94303)))
      (TCR _
	   (A PERSON WITH NAME = "Tom C. Rindfleisch" INITIALS = 'TCR
	      TITLE = 'ADMINISTRATOR
	      PROJECT = HPP SALARY = 30000.0 SSNO = 452123477 BIRTHDATE =
	      (A DATE WITH DAY = 2 MONTH = 1 SHORTYEAR = 47)
	      PHONE = (A PHONE-NUMBER WITH AREA = 415 NUMBER = 4972780)
	      HOME-PHONE = (A PHONE-NUMBER WITH AREA = 415 NUMBER = 4324321)
	      OFFICE = (A CAMPUS-ADDRESS WITH BUILDING = MJH ROOM = 236)
	      HOME-ADDRESS = (AN ADDRESS)))
      (EAF _
	   (A PERSON WITH NAME = "Edward A. Feigenbaum" INITIALS =
	      'EAF
	      TITLE = 'PROF
	      PROJECT = HPP SALARY = 99999.0 SSNO = 123123477 BIRTHDATE =
	      (A DATE WITH DAY = 2 MONTH = 1 SHORTYEAR = 37)
	      PHONE = (A PHONE-NUMBER WITH AREA = 415 NUMBER = 4974878)
	      OFFICE = (A CAMPUS-ADDRESS WITH BUILDING = MJH ROOM = 226)
	      HOME-PHONE = (A PHONE-NUMBER WITH AREA = 415 NUMBER = 4931234)
	      HOME-ADDRESS =
	      (AN ADDRESS WITH STREET = " " CITY = "Stanford" STATE =
		  'CA
		  ZIP = 94305)))
      (MRG _
	   (A PERSON WITH NAME = "Michael R. Genesereth" INITIALS =
	      'MRG
	      TITLE = 'ASST-PROF
	      PROJECT = HPP SALARY = 31234.0 SSNO = 123123477 BIRTHDATE =
	      (A DATE WITH DAY = 2 MONTH = 1 SHORTYEAR = 50)
	      PHONE = (A PHONE-NUMBER WITH AREA = 415 NUMBER = 4970324)
	      OFFICE = (A CAMPUS-ADDRESS WITH BUILDING = MJH ROOM = 234)
	      HOME-PHONE = (A PHONE-NUMBER WITH AREA = 415 NUMBER = 4324321)
	      HOME-ADDRESS = (AN ADDRESS)))
      (J5 _
	  (A CONTRACT WITH TITLE = "Advanced A.I. Architectures" LEADER = EAF 
	     SPONSOR = ARPA BUDGET =
	     (A BUDGET WITH LABOR = 50000.0 COMPUTER = 10000.0)))
      (IA _
	  (A CONTRACT WITH TITLE = "Intelligent Agents" LEADER = MRG SPONSOR = 
	     ARPA BUDGET = (A BUDGET WITH LABOR = 70000.0 COMPUTER = 50000.0)))
      (DART _
	    (A CONTRACT WITH TITLE = "Diagnosis and Repair Techniques" LEADER 
	       = MRG SPONSOR = ARPA BUDGET =
	       (A BUDGET WITH LABOR = 100000.0 COMPUTER = 150000.0)))
      (GLISP _
	     (A CONTRACT WITH TITLE = "GLISP" LEADER = GSN SPONSOR = ARPA 
		BUDGET = (A BUDGET WITH LABOR = 50000.0 COMPUTER = 20000.0)))
      (CM _
	  (A PERSON WITH NAME = "Cookie Monster" INITIALS = 'CM
	     TITLE = 'MONSTER
	     PROJECT = HPP SALARY = 1.0 SSNO = 123456789 BIRTHDATE =
	     (A DATE WITH MONTH = 4 DAY = 1 SHORTYEAR = 65)
	     PHONE = (A PHONE-NUMBER WITH AREA = 415 NUMBER = 4971234)
	     OFFICE = (A CAMPUS-ADDRESS WITH BUILDING = MJH ROOM = 252)
	     HOME-PHONE = (A PHONE-NUMBER WITH AREA = 415 NUMBER = 4561234)
	     HOME-ADDRESS =
	     (AN ADDRESS WITH STREET = "123 Sesame Street" CITY = "Palo Alto" 
		 STATE = 'CA
		 ZIP = 94303)
                 ))
      (CARBM _
	     (A CONTRACT WITH TITLE = 
		"Carbohydrate Metabolism in Atypical Hominids"
		LEADER = CM SPONSOR = NIH BUDGET =
		(A BUDGET WITH LABOR = 1.39 COMPUTER = 5.0)))
      (HPP:ADMINISTRATOR _ TCR)
      (HPP:CONTRACTS _ (LIST J5 IA DART GLISP CARBM))
      (HPP:EXECUTIVES _ (LIST EAF MRG GSN TCR))
      (C _ (A CIRCLE WITH START =
	      (A VECTOR WITH X = 1 Y = 1)
	      RADIUS = 5.0))))


% edited: 22-OCT-82 16:54 
(DG TODAYS-DATE NIL
(A DATE WITH MONTH = 10 DAY = 15 SHORTYEAR = 82))


% edited: 22-OCT-82 17:13 
(DG TOTAL-BUDGET (P:PROJECT)
(PROG (SUM)
      (SUM_0.0)
      (FOR EACH CONTRACT SUM_+BUDGET:TOTAL)
      (RETURN SUM)))

 (PUT 'TODAYS-DATE
      'GLRESULTTYPE
      'DATE)

REDUCE Historical
REDUCE Sourceforge Project | Historical SVN Repository | GitHub Mirror | SourceHut Mirror | NotABug Mirror | Chisel Mirror | Chisel RSS ]