(FILECREATED "20-SEP-83 18:27:15" ("compiled on " {INDIGO}SOURCES>LOOPSRULES.;17) "14-SEP-83 19:33:36" recompiled exprs: ListRuleSets MakeEditMenu REObject ReinstallRuleSets Rule.Print RuleSet.CompileRules RuleSet.CopyRules RuleSet.EditRules RuleSet.Off RuleSet.On RuleSet.PPRules RuleSetMeta.New RuleSetSource.CompileRules RuleSetSource.EditRules RuleSetSource.GetSource RuleSetSource.PPRules SaveRules SearchStackForWorkSpace CloseREWindow CountRules GetRules MINUSMINUS PAUSE PLUSPLUS PutAuditRec PutClassAuditRec RE RE1 REAskWhy REFocusRuleSet RETraceSelectFn RSGetFn RSPutFn RuleSetStop RuleSetTransfer SetUpRE TraceLHS TraceRHS WRITETTY WhichRule? in WORK dated "14-SEP-83 19:46:38") (FILECREATED "20-SEP-83 18:26:38" {INDIGO}SOURCES>LOOPSRULES.;17 45812 changes to: (FNS DefRSM) previous date: "10-AUG-83 13:48:50" {INDIGO}SOURCES>LOOPSRULES.;16) ListRuleSets D1 (P 24Q rsn P 23Q num P 20Q method P 6 fileHandle P 5 ruleSet P 4 ruleSetName P 3 class P 2 numNames P 1 ruleSetNames P 0 listFile I 1 pressFileName I 0 ruleSetsSpec) VAµgÁ @d³m g @ »µ]@ [²S0K_g _¿OglO°&dKO g \d‘h_šOµO__¿µÛOŒ _O°ï@hYHg ^Kµ$I ZdIkO$µ>N A¨N ¿N h_g _¿ONlO¿gN ¿Nj ¿N ¿°¶_(¿O&O"ñ³»O( ]²cO( ¿k ¿N ¿N ¿oN ¿N ¿N ¿M_g _¿ONlO¿O&Jð³gN ¿Nj ¿N ¿N ¿N ¿O$_$¿O&kØ_&¿±ÿ>(503Q TERPRI 476Q TERPRI 471Q TERPRI 464Q POSITION 456Q PRIN3 424Q FetchMethodOrHelp 412Q TERPRI 405Q TERPRI 400Q PRIN1 367Q TERPRI 362Q TERPRI 355Q SPACES 350Q PRIN1 340Q GetObjectRec 315Q TERPRI 310Q POSITION 302Q PRIN3 256Q FetchMethodOrHelp 244Q DELFILE 237Q EMPRESS 231Q CLOSEF 210Q FLENGTH 200Q OPENFILE 156Q LAST 116Q GetMethod 60Q FetchMethodOrHelp 41Q GetClassRec 32Q GetClassRec 26Q FILECOMSLST 20Q U-CASE) (452Q % 421Q PPRules 276Q % 253Q PP 175Q OUTPUT 113Q RuleSet 70Q Methods 55Q List 23Q INSTANCES 5 {CORE}ListRules) (374Q "*********************************************") MakeEditMenu D1 NIL A`µ<`do¿do¿dg ¿dg¿jdnÿdhHdI ¿NIL (76Q reEditMenu 43Q DEFAULTMENUHELDFN 34Q CLRPROMPT 7 MENUTYPE# 2 reEditMenu) (25Q "Rule Edit Options" 15Q (OK EditRules Help EditAllDecls EditWS STOP Undo! UE EF Compile Save InspectRuleSet)) REObject D1 (I 0 ^ws) (2 RE) NIL NIL ReinstallRuleSets D1 (P 5 selector P 2 ruleSetName P 1 methods P 0 class I 0 className) :P@ Xd\g »LglK°dHMg Z–@MJ ¿µçh(60Q DefRSM 50Q GetMethod 17Q FetchMethodOrHelp 6 GetClassRec) (45Q RuleSet 24Q Methods 14Q List) NIL Rule.Print D1 (I 1 file I 0 self) ²A ¿`A ¿@g A ¿`A ¿A A ¿`A ¿lA ¿oA ¿@g A ¿oA ¿@g g A A ¿lA ¿oA ¿@g A ¿oA ¿@g A ¿`A ¿A ¿A i(256Q TERPRI 251Q TERPRI 244Q CHANGEFONT 234Q PRIN1 230Q GetValue 220Q PRIN1 207Q PRIN1 203Q GetValue 173Q PRIN1 162Q SPACES 153Q TERPRI 147Q PRIN1 143Q GetValue 135Q GetValue 125Q PRIN1 114Q PRIN1 110Q GetValue 100Q PRIN1 67Q SPACES 60Q CHANGEFONT 50Q TERPRI 44Q TERPRI 37Q CHANGEFONT 27Q PRIN1 23Q GetValue 13Q CHANGEFONT 3 TERPRI) (240Q DEFAULTFONT 225Q edited 200Q editor 140Q name 132Q ruleSet 105Q ruleNumber 54Q COMMENTFONT 33Q DEFAULTFONT 20Q source 7 BOLDFONT) (214Q " on " 167Q " edited by " 121Q " from " 74Q "... Rule ") RuleSet.CompileRules D1 (P 0 sourcePerspective I 1 compilerOptions I 0 self) )P@Zg ¹JglIXd\g »LAlK@(35Q FetchMethodOrHelp 12Q FetchMethodOrHelp) (32Q CompileRules 17Q Source 7 GetPersp) NIL RuleSet.CopyRules D1 (P 1 ruleSetSource P 0 newRS I 2 workSpace I 1 newName I 0 self) k   @[g ºKAlJXB˜dgB ¿@g @]g ¼MglLYd@I_g ¾OkN hH_g _¿OkOH(135Q FetchMethodOrHelp 120Q SaveRules 106Q FetchMethodOrHelp 60Q FetchMethodOrHelp 45Q GetValue 35Q PutValue 12Q FetchMethodOrHelp) (132Q CompileRules 124Q rsCompilerOptions 103Q GetSource 65Q Source 55Q GetPersp 50Q rsRuleClass 42Q ruleClass 31Q workSpace 7 Copy) NIL RuleSet.EditRules D1 (P 0 sourcePerspective I 1 coms I 0 self) )P@Zg ¹JglIXd\g »LAlK@(35Q FetchMethodOrHelp 12Q FetchMethodOrHelp) (32Q EditRules 17Q Source 7 GetPersp) NIL RuleSet.Off D1 (I 1 compilerOption I 0 self) UA@g ²&@gA@g @Hg ¹HkI`i Ai `i oi @i i (122Q TERPRI 116Q PRIN1 111Q PRIN1 101Q CHANGEFONT 72Q PRIN1 65Q CHANGEFONT 47Q FetchMethodOrHelp 34Q PutValue 31Q REMOVE 26Q GetValue 7 GetValue) (75Q DEFAULTFONT 61Q BOLDFONT 44Q CompileRules 23Q compilerOptions 16Q compilerOptions 4 compilerOptions) (105Q " not on for ") RuleSet.On D1 (I 1 compilerOption I 0 self) 4A@g ³(@g@g Ah @Hg ¹HkIh(51Q FetchMethodOrHelp 36Q PutValue 33Q \NCONC2 25Q GetValue 7 GetValue) (46Q CompileRules 22Q compilerOptions 16Q compilerOptions 4 compilerOptions) NIL RuleSet.PPRules D1 (I 1 file I 0 self) *@Hg ¹HglIHg ¹HAlI(37Q FetchMethodOrHelp 12Q FetchMethodOrHelp) (34Q PPRules 17Q Source 7 GetPersp) NIL RuleSetMeta.New D1 (P 1 sourcePersp P 0 newRuleSet I 2 name I 1 assocList I 0 self) ;`Bµohog b@[g ºKAlJXd]g ¼MBlLH(57Q FetchMethodOrHelp 36Q GetSuperMethod 24Q INTTY) (54Q SetName 33Q New 21Q noShiftFlg) (16Q "RuleSets need to have names. Please enter a name for the RuleSet." 11Q "RuleSet name: ") RuleSetSource.CompileRules D1 (P 4 ruleSetArgs P 3 ruleStr P 2 rulePos P 1 ruleSet P 0 codeBody I 2 sourceStr I 1 userCompilerOptions I 0 self) * @^g ½NglMYA˜dgA ¿Ig ` ¿o ¿` ¿o ¿` ¿h Bµ@_g _¿OkObA `’±±oB lÔZBJ [d `’±”B BI I@ Xg`\`³q`LHhh ¿Ig` ¿¿gA²L`³G` ¿o ¿` ¿o ¿` ¿h ¿h ¿o ¿o ¿` `(444Q COMPILE 435Q BKSYSBUF 425Q BKSYSBUF 415Q TERPRI 410Q TERPRI 403Q CHANGEFONT 374Q PRIN1 364Q PRIN1 355Q PRIN1 345Q CHANGEFONT 322Q TERPRI 316Q PutValue 303Q DEFINE 247Q CompileRuleList 237Q GetRules 227Q CountRules 214Q ParseTokens 207Q SUBSTRING 176Q STRPOS 157Q GetRuleSetDeclarations 137Q FetchMethodOrHelp 123Q TERPRI 116Q CHANGEFONT 107Q PRIN1 77Q PRIN1 70Q PRIN1 60Q CHANGEFONT 47Q GetValue 37Q PutValue 12Q FetchMethodOrHelp) (447Q rsName 441Q rsName 400Q DEFAULTFONT 361Q rsName 342Q BOLDFONT 335Q parseErrorFlg 326Q LC 313Q rsName 310Q compiledRules 270Q rsName 263Q parseErrorFlg 256Q rsArgs 253Q self 242Q rsRuleObjects 232Q rsNumRules 217Q parseErrorFlg 162Q parseErrorFlg 134Q GetSource 113Q DEFAULTFONT 74Q rsName 55Q BOLDFONT 52Q rsName 44Q name 33Q compilerOptions 17Q RuleSet 7 GetPersp) (432Q "N " 422Q "ST " 371Q " to ByteCodes." 352Q "Compiling " 172Q "********" 104Q " to Lisp." 65Q "Compiling ") RuleSetSource.EditRulesA1263 D1 (NAME ERRORSET L (2 ERRORSET.W 1 ERRORSET.V 0 ERRORSET.U) F 0 sourceRules F 1 RESETY) ¿ohdohdP cci(24Q TTYIN 2 SET.TTYINEDIT.WINDOW) NIL (15Q (STRING NORAISE REPEAT) 7 " ") RuleSetSource.EditRulesA1264 D1 (NAME ERRORSET L (2 ERRORSET.W 1 ERRORSET.V 0 ERRORSET.U) F 0 sourceRules F 1 rulePos F 2 RESETY) =¿P ¿oP lÔc¿PQ c¿ohdohdP cci(65Q TTYIN 41Q CONCAT 36Q SUBSTRING 31Q GetRSAllDeclString 20Q STRPOS 7 GetRuleSetDeclarations 2 SET.TTYINEDIT.WINDOW) NIL (56Q (STRING NORAISE REPEAT) 50Q " " 14Q "********") RuleSetSource.EditRules D1 (P 26Q RESETZ P 25Q RESETY P 24Q LISPXHIST P 7 rulePos P 6 workSpace P 5 doneFlg P 4 sourceRules P 3 ruleSet P 2 oldSourceRules P 1 command P 0 needToCompileFlg I 1 coms I 0 self F 27Q TTYINEDITWINDOW F 30Q LISPXHIST F 31Q RESETVARSLST) iñ@@_g _¿OglO[@_g _¿OkOZd\Kg A§ghb¿M’±ÊAAb¿µ` Ydgð•¿°àgð²Bi¸W.go`o ¿W0!W2og ‘h‚g_, ¿O,“¿°›Idgð²D¿i¸W.go`o ¿W0!W2og ‘h‚g_, ¿O,“¿±ÿRgð²0@Ag Xd—gH §o ¿Hdl𢠺BkJYDI@ACE (73Q PutLocalState 52Q GetObjectName 37Q ERROR 27Q Class? 15Q GetObjectRec 12Q GetValue) (23Q RuleSet 7 RSPut) (34Q "RuleSet not found for active value.") RuleSetStop D1 (L (2 ^reason 1 ^status 0 stopValue) F 0 ^value) @cNIL NIL NIL RuleSetTransfer D1 (P 0 ruleSetPos I 0 ruleSetArgs) Bg H¨o ° mÿH gð²mþH gð—mýHd ¿g@Hdid h(76Q ENVAPPLY 61Q STKNTH 45Q STKNTHNAME 31Q STKNTHNAME 21Q ERROR 5 STKPOS) (65Q RuleSet.Run 50Q *ENV* 34Q APPLY 2 RuleSet.Run) (16Q "Must be inside a RuleSetR.Run to transfer") SetUpRE D1 (P 15Q WS P 11Q I P 4 wRegion P 3 mPosition P 2 traceMenu P 1 stkName P 0 ruleSetNames F 16Q controltype F 17Q rsTraceFont F 20Q reWindow F 21Q reTraceWindow)  €gcnèk2 OOñ§O Yµ}OX`dH¿dk¿dW¿dg¿dg ¿dg¿jdnÿdh_¿dO ¿dÉ l–¿ZW g \dl—ÙLLl2ÙØ[JhKg J c"h ²YI ^g ½NglM²BgIj  IOoO ooIo h_¿OµOh__¿OkØ_±ÿO&_¿°ñ(341Q CONCAT 320Q GetObjectName 301Q EVALV 276Q STKPOS 252Q FetchMethodOrHelp 243Q GetObjectRec 235Q GetObjectRec 226Q WFROMMENU 222Q ADDMENU 165Q GETWINDOWPROP 34Q STKNTHNAME 12Q REFocusRuleSet) (271Q self 257Q RuleSet 247Q InstOf! 217Q ScrollFlg 162Q REGION 144Q MENU 111Q DEFAULTMENUHELDFN 102Q CLRPROMPT 73Q RETraceSelectFn 46Q MENUTYPE# 5 DOALL) (335Q " rules" 330Q "Middle to EDIT " 324Q " " 313Q "Left to INSPECT ") TraceLHS D1 (I 2 ruleNum I 1 ruleLab I 0 ruleSetName) Hoi ¿`i ¿AµBi ¿`i ¿oi ¿`i ¿@i ¿`i ¿i i(104Q TERPRI 77Q CHANGEFONT 67Q PRIN1 61Q CHANGEFONT 51Q PRIN1 40Q CHANGEFONT 30Q PRIN1 17Q CHANGEFONT 7 PRIN1) (73Q DEFAULTFONT 55Q BOLDFONT 34Q DEFAULTFONT 13Q BOLDFONT) (45Q " in RuleSet " 3 "Testing rule ") TraceRHS D1 (I 3 ^value I 2 ruleNum I 1 ruleLab I 0 ruleSetName) Hoi ¿`i ¿AµBi ¿`i ¿oi ¿`i ¿@i ¿`i ¿i C(104Q TERPRI 77Q CHANGEFONT 67Q PRIN1 61Q CHANGEFONT 51Q PRIN1 40Q CHANGEFONT 30Q PRIN1 17Q CHANGEFONT 7 PRIN1) (73Q DEFAULTFONT 55Q BOLDFONT 34Q DEFAULTFONT 13Q BOLDFONT) (45Q " in RuleSet " 3 "Executing rule ") WRITETTY D1 (P 1 I P 0 nargs) ejHIñšIkØYa ¿°ói(31Q TERPRI 23Q PRIN1) NIL NIL WhichRule? D1 (P 0 auditRecord I 2 classFlg I 1 varName I 0 obj) +B˜@Ag ‡@Ag Xd´dgð§dg h(46Q GetValue 25Q GetValue 14Q GetClassValue) (43Q rule 35Q ? 22Q reason 11Q reason) NIL (PRETTYCOMPRINT LOOPSRULESCOMS) (RPAQQ LOOPSRULESCOMS ((* Copyright (c) 1982 by Xerox Corporation) (* * Package for Rule-Oriented Programming in LOOPS. - File LOOPSRULES contains the basic class definitions. File LOOPSRULESP contains the rule parser. - File LOOPSRULESC contains the rule compiler. File LOOPSRULESD interprets RuleSet declarations.) (* Written in August 1982 by Mark Stefik, Alan Bell, and Danny Bobrow) (* Classes for Rule-Oriented Programming in LOOPS.) (CLASSES * LOOPSRULESCLASSES) (FNS * LOOPSRULESFNS) ( FNS * RULESETMISCFNS) (VARS (^rs NIL) (^ws NIL) (^caller NIL) (^task NIL) (reWindow NIL) ( reTraceWindow NIL) (reInspectWindow NIL) (rsTraceFont (FONTCREATE (QUOTE GACHA) 8))) (P (CLDISABLE ( QUOTE ^))) (P (INTERRUPTCHAR 6 (LIST (FUNCTION RE)))) (MACROS RunRS) (DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS (ADDVARS (NLAMA) (NLAML) (LAMA WRITETTY))))) (RPAQQ LOOPSRULESCLASSES (Rule RuleSet RuleSetMeta RuleSetNode RuleSetSource StandardAuditRecord Task TestAuditRecord)) (DEFCLASSES Rule RuleSet RuleSetMeta RuleSetNode RuleSetSource StandardAuditRecord Task TestAuditRecord) (DEFCLASS Rule (MetaClass Class doc (* * Class for describing rules as objects. Instances of this class (rule objects) are created as a side-effect when RuleSets are compiled in audit mode.) Edited: ( * mjs: "12-FEB-83 12:19")) (Supers Object) (ClassVariables) (InstanceVariables (source NIL doc (* string that was the source of the rule in the RuleSet.)) (edited NIL doc (* person who edited the rule.)) (editor NIL doc (* time and date of the editing.)) (ruleNumber 0 doc (* sequence number of the rule in the RuleSet at the time of editing.)) (ruleSet NIL doc (* RuleSet to which this rule belongs. ))) (Methods (Print Rule.Print args (file) doc (* * Print out formatted information about a rule - the source, RuleSet, and editing information.)))) (DEFCLASS RuleSet (MetaClass RuleSetMeta doc (* * A RuleSet is a set of rules, together with methods for interpreting them.) Edited: (* mjs: " 1-JUN-83 09:55")) (Supers NamedObject Perspective Object) ( ClassVariables) (InstanceVariables (compiledRules NIL doc (* Name of Lisp Function for Rules.)) ( workSpace NIL doc (* name of class for work space.)) (args NIL doc (* arguments to the RuleSet other than self.)) (tempVars NIL doc (* temporary variables.)) (taskVars NIL doc (* Task variables.)) ( debugVars NIL doc (* variables to be printed during a trace or break.)) (numRules NIL doc (* Number of Rules in RuleSet.)) (controlStructure doAll doc (* control structure for rules.)) (whileCondition NIL doc (* while condition for RuleSet.)) (compilerOptions NIL doc (* Compilation options.)) (auditClass #$StandardAuditRecord doc (* name of class for audit records.)) (metaAssignments NIL doc (* RuleSet specific meta-assignment statements.)) (ruleClass #$Rule doc (* name of class for rule objects.)) ( taskClass NIL doc (* Name of class used for tasking.)) (perspectiveNode #$RuleSetNode)) (Methods ( CompileRules RuleSet.CompileRules doc (* Compile the RuleSet.)) (CopyRules RuleSet.CopyRules args ( newName) doc (* Creates a new RuleSet containing a copy of the rules.)) (ER RuleSet.EditRules doc (* Shorthand for EditRules)) (EditRules RuleSet.EditRules doc (* Forward the Edit message to the Source perspective of the RuleSet.) args NIL) (Off RuleSet.Off args (compilerOption) doc (* Turn off a compiler option.)) (On RuleSet.On args (compilerOption) doc (* Turn on a compiler option.)) (PPR RuleSet.PPRules doc (* Shorthand for PPRules)) (PPRules RuleSet.PPRules args NIL doc (* PrettyPrint the Rules.)))) (DEFCLASS RuleSetMeta (MetaClass MetaClass doc (* * MetaClass for RuleSets.) Edited: (* mjs: "29-SEP-82 09:14")) (Supers Template) (ClassVariables) (InstanceVariables) (Methods (New RuleSetMeta.New doc (* * Create a new rule set.) args (name)))) (DEFCLASS RuleSetNode (MetaClass Template doc (* Node for RuleSet perspectives.) Edited: (* mjs: "29-SEP-82 10:43")) (Supers Node Object) (ClassVariables) (InstanceVariables (perspectives NIL Source #$RuleSetSource RuleSet #$RuleSet)) (Methods)) (DEFCLASS RuleSetSource (MetaClass Template doc (* * Source code for a RuleSet. Contains editing information about the RuleSet, and an indexed list of rule objects.) Edited: (* mjs: "12-FEB-83 12:16" )) (Supers DatedObject Perspective VarLength) (ClassVariables) (InstanceVariables (perspectiveNode #$ RuleSetNode) (edited NIL doc (* Date last edited.)) (editor NIL doc (* Last User to edit the rules.))) (Methods (CompileRules RuleSetSource.CompileRules doc (* * Compile the Rules for a RuleSet from the Rule Language into Interlisp.) args (^userCompilerOptions sourceRules)) (EditRules RuleSetSource.EditRules doc (* Edit the rules associated with a RuleSetSource.) args NIL) (GetSource RuleSetSource.GetSource args (allDeclFlg) doc (* Compute the source string for a RuleSet for printing or editing. If allDeclFlg is T, the computed string will include extra rule declarations beyond the basic set, even if they have no current value.)) (PPRules RuleSetSource.PPRules args (file) doc (* Pretty Print the Rules)))) (DEFCLASS StandardAuditRecord (MetaClass Class doc (* * Standard (default) audit record for makeing audit trails of RuleSet invocations.) Edited: (* mjs: " 9-JUN-83 09:53")) (Supers Object) ( ClassVariables (metaAssns (rule _ ruleObject) doc (* default meta-assignment statements associated with this audit record.))) (InstanceVariables (rule NIL doc (* Rule used in setting the value.))) ( Methods)) (DEFCLASS Task (MetaClass Class doc (* * Representation of the invocation of a RuleSet. Used in creating variations of agenda control structures. Similar to the idea of closures.) Edited: (* mjs: " 7-JUN-83 10:24")) (Supers Object) (ClassVariables) (InstanceVariables (ruleNumber 1 doc (* Number of the next rule to be executed. Used for RuleSet debugging and for doNext and cycleNext.)) (rs NIL doc (* RuleSet that was invoked.)) (self NIL doc (* workSpace given to the RuleSet.)) (value NIL doc (* value returned by the RuleSet)) (status Started doc (* Execution status. Examples: Started, Done, Aborted, Suspended.)) (reason NotKnown doc (* Reason for the status. Examples: Success, NoSpace, Blocked)) (caller NIL doc (* Caller of the RuleSet.))) (Methods (Step NIL doc (* Method to Step the Task.)))) (DEFCLASS TestAuditRecord (MetaClass Class doc (* For Test cases.) Edited: (* mjs: "11-NOV-82 09:30")) (Supers StandardAuditRecord) (ClassVariables) (InstanceVariables (^rs NIL) (^ruleNumber 0) (cf .3) ( support NIL)) (Methods)) (RPAQQ LOOPSRULESFNS (ListRuleSets MakeEditMenu REObject ReinstallRuleSets Rule.Print RuleSet.CompileRules RuleSet.CopyRules RuleSet.EditRules RuleSet.Off RuleSet.On RuleSet.PPRules RuleSetMeta.New RuleSetSource.CompileRules RuleSetSource.EditRules RuleSetSource.GetSource RuleSetSource.PPRules SaveRules SearchStackForWorkSpace)) (RPAQQ RULESETMISCFNS (CloseREWindow CountRules DefRSM GetRules MINUSMINUS PAUSE PLUSPLUS PutAuditRec PutClassAuditRec RE RE1 REAskWhy REFocusRuleSet RETraceSelectFn RSGetFn RSPutFn RuleSetStop RuleSetTransfer SetUpRE TraceLHS TraceRHS WRITETTY WhichRule?)) (RPAQQ ^rs NIL) (RPAQQ ^ws NIL) (RPAQQ ^caller NIL) (RPAQQ ^task NIL) (RPAQQ reWindow NIL) (RPAQQ reTraceWindow NIL) (RPAQQ reInspectWindow NIL) (RPAQ rsTraceFont (FONTCREATE (QUOTE GACHA) 8)) (CLDISABLE (QUOTE ^)) (INTERRUPTCHAR 6 (LIST (FUNCTION RE))) (PUTPROPS RunRS MACRO ((rs ws . args) (APPLY* (COND ((LITATOM rs) rs) (T (GetObjectName rs))) ws . args))) (PUTPROPS LOOPSRULES COPYRIGHT ("Xerox Corporation" 1983)) NIL