home *** CD-ROM | disk | FTP | other *** search
Wrap
÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷ INSTALLING OPS5 UNDER FRANZ ---------------------------------------------------------------------- The following files are needed to install OPS5 under FRANZ. VPS2.L -- FRANZ sources for the interpreter. TRY5.L -- One-rule system to check whether the interpreter has been installed properly. To install OPS5 on a VAX running franz lisp, first compile vps2.l with the lisp compiler. Then run lisp and give it the following commands: (fasl 'vps2.o) (i-g-v) At that point OPS5 is ready to use. The core image can be saved using dumplisp or savelisp. To check the interpreter, run OPS5 and load TRY5.L. If it is working, the interpreter will print the message: ops5 installed The file MAB.L contains a small example OPS5 production system. It solves a version of the old Monkey and Bananas problem. To run it, load it in and give the commands: (make start 1) (run) atus satified)) (p mb5 (goal ^status active ^type; VPS2 -- Interpreter for OPS5 ; ; Copyright (C) 1979, 1980, 1981 ; Charles L. Forgy, Pittsburgh, Pennsylvania ; Users of this interpreter are requested to contact ; ; Charles Forgy ; Computer Science Department ; Carnegie-Mellon University ; Pittsburgh, PA 15213 ; or ; Forgy@CMUA ; ; so that they can be added to the mailing list for OPS5. The mailing list ; is needed when new versions of the interpreter or manual are released. ;;; Definitions (declare (special *matrix* *feature-count* *pcount* *vars* *cur-vars* *curcond* *subnum* *last-node* *last-branch* *first-node* *sendtocall* *flag-part* *alpha-flag-part* *data-part* *alpha-data-part* *ce-vars* *virtual-cnt* *real-cnt* *current-token* *c1* *c2* *c3* *c4* *c5* *c6* *c7* *c8* *c9* *c10* *c11* *c12* *c13* *c14* *c15* *c16* *c17* *c18* *c19* *c20* *c21* *c22* *c23* *c24* *c25* *c26* *c27* *c28* *c29* *c30* *c31* *c32* *c33* *c34* *c35* *c36* *c37* *c38* *c39* *c40* *c41* *c42* *c43* *c44* *c45* *c46* *c47* *c48* *c49* *c50* *c51* *c52* *c53* *c54* *c55* *c56* *c57* *c58* *c59* *c60* *c61* *c62* *c63* *c64* *record-array* *result-array* *max-cs* *total-cs* *limit-cs* *cr-temp* *side* *conflict-set* *halt-flag* *phase* *critical* *cycle-count* *total-token* *max-token* *refracts* *limit-token* *total-wm* *current-wm* *max-wm* *action-count* *wmpart-list* *wm* *data-matched* *p-name* *variable-memory* *ce-variable-memory* *max-index* *next-index* *size-result-array* *rest* *build-trace* *last* *ptrace* *wtrace* *in-rhs* *recording* *accept-file* *trace-file* *write-file* *record-index* *max-record-index* *old-wm* *record* *filters* *break-flag* *strategy* *remaining-cycles* *wm-filter* *rhs-bound-vars* *rhs-bound-ce-vars* *ppline* *ce-count* *brkpts* *class-list* *buckets* *action-type*)) (declare (localf ce-gelm gelm peek-sublex sublex eval-nodelist sendto and-left and-right not-left not-right top-levels-eq add-token real-add-token remove-old remove-old-num remove-old-no-num removecs insertcs dsort best-of best-of* conflict-set-compare =alg )) ;;; Functions that were revised so that they would compile efficiently ;* The function == is machine dependent! ;* This function compares small integers for equality. It uses EQ ;* so that it will be fast, and it will consequently not work on all ;* Lisps. It works in Franz Lisp for integers in [-128, 127] (def == (macro (z) `(eq ,(cadr z) ,(caddr z)))) ; =ALG returns T if A and B are algebraicly equal. (defun =alg (a b) (zerop (difference a b))) (def fast-symeval (macro (z) `(cond ((eq ,(cadr z) '*c1*) *c1*) ((eq ,(cadr z) '*c2*) *c2*) ((eq ,(cadr z) '*c3*) *c3*) ((eq ,(cadr z) '*c4*) *c4*) ((eq ,(cadr z) '*c5*) *c5*) ((eq ,(cadr z) '*c6*) *c6*) ((eq ,(cadr z) '*c7*) *c7*) (t (eval ,(cadr z)))] ; getvector and putvector are fast routines for using one-dimensional ; arrays. these routines do no checking; they assume ; 1. the array is a vector with 0 being the index of the first ; element ; 2. the vector holds arbitrary list values ; Example call: (putvector array index value) (def putvector (macro (z) (list '*rplacx (caddr z) (cadr z) (cadddr z))] ; Example call: (getvector name index) (def getvector (macro (z) (list 'cxr (caddr z) (cadr z))] (defun ce-gelm (x k) (prog nil loop (and (== k 1.) (return (car x))) (setq k (1- k)) (setq x (cdr x)) (go loop))) ; The loops in gelm were unwound so that fewer calls on DIFFERENCE ; would be needed (defun gelm (x k) (prog (ce sub) (setq ce (/ k 10000.)) (setq sub (- k (* ce 10000.))) celoop (and (== ce 0.) (go ph2)) (setq x (cdr x)) (and (== ce 1.) (go ph2)) (setq x (cdr x)) (and (== ce 2.) (go ph2)) (setq x (cdr x)) (and (== ce 3.) (go ph2)) (setq x (cdr x)) (and (== ce 4.) (go ph2)) (setq ce (- ce 4.)) (go celoop) ph2 (setq x (car x)) subloop (and (== sub 0.) (go finis)) (setq x (cdr x)) (and (== sub 1.) (go finis)) (setq x (cdr x)) (and (== sub 2.) (go finis)) (setq x (cdr x)) (and (== sub 3.) (go finis)) (setq x (cdr x)) (and (== sub 4.) (go finis)) (setq x (cdr x)) (and (== sub 5.) (go finis)) (setq x (cdr x)) (and (== sub 6.) (go finis)) (setq x (cdr x)) (and (== sub 7.) (go finis)) (setq x (cdr x)) (and (== sub 8.) (go finis)) (setq sub (- sub 8.)) (go subloop) finis (return (car x)))) ;;; Utility functions (def neq (macro (a) `(not (eq ,(cadr a) ,(caddr a] (defun printline (x) (mapc (function printline*) x)) (defun printline* (y) (princ '| |) (print y)) (defun printlinec (x) (mapc (function printlinec*) x)) (defun printlinec* (y) (princ '| |) (princ y)) ; intersect two lists using eq for the equality test (defun interq (x y) (cond ((atom x) nil) ((memq (car x) y) (cons (car x) (interq (cdr x) y))) (t (interq (cdr x) y)))) (defun i-g-v nil (prog (x) (sstatus translink t) (setsyntax '\{ 66.) (setsyntax '\} 66.) (setsyntax '^ 66.) (setq *buckets* 64.) ; OPS5 allows 64 named slots (setq *accept-file* nil) (setq *write-file* nil) (setq *trace-file* nil) (setq *class-list* nil) (setq *brkpts* nil) (setq *strategy* 'lex) (setq *in-rhs* nil) (setq *ptrace* t) (setq *wtrace* nil) (setq *recording* nil) (setq *refracts* nil) (setq *real-cnt* (setq *virtual-cnt* 0.)) (setq *max-cs* (setq *total-cs* 0.)) (setq *limit-token* 1000000.) (setq *limit-cs* 1000000.) (setq *critical* nil) (setq *build-trace* nil) (setq *wmpart-list* nil) (setq *size-result-array* 127.) (setq *result-array* (*makhunk 6)) (setq *record-array* (*makhunk 6)) (setq x 0) loop (putvector *result-array* x nil) (setq x (1+ x)) (and (not (> x *size-result-array*)) (go loop)) (make-bottom-node) (setq *pcount* 0.) (initialize-record) (setq *cycle-count* (setq *action-count* 0.)) (setq *total-token* (setq *max-token* (setq *current-token* 0.))) (setq *total-cs* (setq *max-cs* 0.)) (setq *total-wm* (setq *max-wm* (setq *current-wm* 0.))) (setq *conflict-set* nil) (setq *wmpart-list* nil) (setq *p-name* nil) (setq *remaining-cycles* 1000000)] ; if the size of result-array changes, change the line in i-g-v which ; sets the value of *size-result-array* (defun %warn (what where) (prog nil (terpri) (princ '?) (and *p-name* (princ *p-name*)) (princ '|..|) (princ where) (princ '|..|) (princ what) (return where))) (defun %error (what where) (%warn what where) (throw '!error! !error!)) (defun round (x) (fix (plus 0.5 x))) (d