-
Notifications
You must be signed in to change notification settings - Fork 3
/
README.orig
132 lines (118 loc) · 4.7 KB
/
README.orig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
;;; ****************************************************************
;;; VPS2 -- Interpreter for OPS5 ***********************************
;;; ****************************************************************
;;;
;;; Ops5 is a programming language for production systems.
;;;
;;; This Common Lisp version of OPS5 is in the public domain. It is based
;;; in part on based on a Franz Lisp implementation done by Charles L. Forgy
;;; at Carnegie-Mellon University, which was placed in the public domain by
;;; the author in accordance with CMU policies. Ported to Common Lisp by
;;; George Wood and Jim Kowalski. CMU Common Lisp modifications by
;;; Dario Guise, Skef Wholey, Michael Parzen, and Dan Kuokka.
;;; Modified to work in CLtL1, CLtL2 and X3J13 compatible lisps by
;;; Mark Kantrowitz on 14-OCT-92. The auto.ops and reactor.ops demo files
;;; were provided by Michael Mauldin.
;;;
;;; This code is made available is, and without warranty of any kind by the
;;; authors or by Carnegie-Mellon University.
;;;
;;; This code has been tested in Allegro v4.1, Lucid v4.1, IBCL, and
;;; CMU CL.
;;;
;;; Source code:
;;; ops.lisp, ops-globals.lisp, ops-backup.lisp, ops-compile.lisp,
;;; ops-init.lisp, ops-io.lisp, ops-main.lisp, ops-match.lisp,
;;; ops-rhs.lisp, ops-util.lisp
;;;
;;; Demo Files:
;;; ops-demo-mab.lisp and ops-demo-ttt.lisp
;;; auto.ops and reactor.ops
;;;
;;; Documentation for OPS may be found in the OPS5 User's Manual, July 1981,
;;; by Forgy, CMU CSD.
;;;
;;; This version of OPS5 was obtained by anonymous ftp from
;;; ftp.cs.cmu.edu:/user/ai/areas/expert/systems/ops5/ops5_cl.tgz
;;; ********************************
;;; Usage **************************
;;; ********************************
;;;
;;; Before loading:
;;; Change the global variable *ops-code-directory* to refer to the
;;; directory where the OPS5 sources are kept. You may also need to
;;; change the definition of OPS-PATHNAME depending on your lisp.
;;;
;;;
;;; To use:
;;; 1. From Lisp, load the file "ops":
;;; (load "ops")
;;; 2. Go into the OPS package:
;;; (in-package "OPS")
;;; 3. To compile the OPS sources, use compile-ops:
;;; (compile-ops)
;;; 4. To load the OPS sources, use load-ops:
;;; (load-ops)
;;; Now you can load your OPS5 code or start typing in productions.
;;; If you want to load in a new set of productions, call (reset-ops)
;;; between rule sets. For a nice REP Loop, run (ops).
;;;
;;; Demos:
;;;
;;; There are two demos
;;; interactive tic-tac-toe
;;; the monkey and banana problem
;;; To run the former, just load it and call (run). For the latter,
;;; load it, enter (make start 1) and then call (run).
;;; ********************************
;;; Known Bugs *********************
;;; ********************************
;;;
;;; Loading new rule-sets clobbers the state of the interpreter. To use
;;; a new rule-set, exit lisp and restart OPS.
;;;
;;; Although this implementation has been put into its own package, only
;;; a few interfaces have been exported. You must run in the OPS package.
;;; ********************************
;;; Sample Run *********************
;;; ********************************
> (load "ops")
;;; Loading binary file "ops.hbin"
#P"/afs/andrew.cmu.edu/scs/cs/15-381/ops5v1/ops.hbin"
> (in-package "OPS")
#<Package "OPS" 40242A7E>
> (load-ops)
;;; Loading binary file "/afs/andrew.cmu.edu/scs/cs/15-381/ops5/ops-globals.hbin"
;;; Loading binary file "/afs/andrew.cmu.edu/scs/cs/15-381/ops5/ops-util.hbin"
;;; Loading binary file "/afs/andrew.cmu.edu/scs/cs/15-381/ops5/ops-backup.hbin"
;;; Loading binary file "/afs/andrew.cmu.edu/scs/cs/15-381/ops5/ops-compile.hbin"
;;; Loading binary file "/afs/andrew.cmu.edu/scs/cs/15-381/ops5/ops-main.hbin"
;;; Loading binary file "/afs/andrew.cmu.edu/scs/cs/15-381/ops5/ops-match.hbin"
;;; Loading binary file "/afs/andrew.cmu.edu/scs/cs/15-381/ops5/ops-io.hbin"
;;; Loading binary file "/afs/andrew.cmu.edu/scs/cs/15-381/ops5/ops-rhs.hbin"
NIL
> (load "../ops/auto.ops")
;;; Loading source file "../ops/auto.ops"
;;; Warning: File "../ops/auto.ops" does not begin with IN-PACKAGE. Loading into package "OPS"
******************
#P"/afs/andrew.cmu.edu/scs/cs/15-381/ops/auto.ops"
> (make ready)
NIL
> (run)
Automobile Diagnosis
Is this true: key is off [no] y
Concluding you must turn the key to start the car
*End of diagnosis*
Is this true: key is off [no]
Is this true: engine is turning [no] yes
Concluding problem is in fuel or ignition system
Is this true: headlights are dim or dead [no] q
end -- explicit halt
18 productions (108 // 200 nodes)
19 firings (42 rhs actions)
5 mean working memory size (8 maximum)
4 mean conflict set size (7 maximum)
10 mean token memory size (17 maximum)
NIL
>
;;; *EOF*