Script started on Mon Mar 01 12:48:38 2004 pollux {~/cse740/GCD_project} > acl International Allegro CL Enterprise Edition 6.2 [Solaris] (Oct 28, 2003 9:00) Copyright (C) 1985-2002, Franz Inc., Berkeley, CA, USA. All Rights Reserved. This development copy of Allegro CL is licensed to: [4549] SUNY/Buffalo, N. Campus ;; Optimization settings: safety 1, space 1, speed 1, debug 2. ;; For a complete description of all compiler switches given the ;; current optimization settings evaluate (explain-compiler-settings). ;;--- ;; Current reader case mode: :case-sensitive-lower cl-user(1): (load "/projects/snwiz/bin/sneps") ; Loading /projects/snwiz/bin/sneps.lisp Loading system SNePS...10% 20% 30% 40% 50% 60% 70% 80% 90% 100% SNePS-2.6 [PL:0a 2002/09/30 22:37:46] loaded. Type `(sneps)' or `(snepslog)' to get started. t cl-user(2): (load "BuildDivisorList.lisp") ; Loading /home/csgrad/ag33/cse740/GCD_project/BuildDivisorList.lisp t cl-user(3): (sneps) Welcome to SNePS-2.6 [PL:0a 2002/09/30 22:37:46] Copyright (C) 1984--2002 by Research Foundation of State University of New York. SNePS comes with ABSOLUTELY NO WARRANTY! Type `(copyright)' for detailed copyright information. Type `(demo)' for a list of example applications. 3/1/2004 12:50:09 * (demo "NatLangGCD.demo") File /home/csgrad/ag33/cse740/GCD_project/NatLangGCD.demo is now the source of input. CPU time : 0.00 * ^( --> setq snip:*infertrace* nil) nil CPU time : 0.00 * ^( --> setq snip:*plantrace* nil) nil CPU time : 0.00 * ;^(load "BuildDivisorList") (resetnet t) Net reset CPU time : 0.00 * ; ; NL GCD Algorithm primitive actions ; (^ (define-primaction say (object1 object2) "Print the argument nodes in order." (format t "~&~A ~A.~%" (sneps::choose.ns object1) (sneps::choose.ns object2)))) (say) CPU time : 0.00 * (^ (define-primaction build-div-list() "Build divisor list" (setf dlist (common-lisp-user::build-divisor-list 100 1 nil)) (format t "~&Divisor List in LISP is ~A.~%" dlist) (common-lisp-user::sneps-divisor-list dlist) ) ) (build-div-list) CPU time : 0.00 * ;(^ (define-primaction divisible-by (object1 object2) ; "Print if object1 is divisible by object2." ; (format t "~& Object 1 in sneps ~A and in LISP ~A~%" (sneps::choose.ns object1) object1) ; (format t "~& Object 1 after applying node-to-lisp-object ~A~%" (node-to-lisp-object object1)) ; ;(if (equal object1 '(fifteen))(setf object1 '(15))(format t "~& NOT EQUAL TO FIFTEEN~%")) ; ;(if (equal object2 '(five))(setf object2 '(5))(format t "~& NOT EQUAL TO FIVE~%")) ; (setf object1 '(15)) ; (setf object2 '(5)) ; (if (and (numberp(first object1))(numberp(first object2))) ; (if (zerop (rem (first object1) (first object2))) ; (format t "~&~A is divisible by ~A.~%" (sneps::choose.ns object1) (sneps::choose.ns object2)) ; (format t "~&~A is not divisible by ~A.~%" (sneps::choose.ns object1) (sneps::choose.ns object2)) ; ) ; (format t "~&Either ~A or ~A is not a number.~%" (first object1)(first object2)) ; )) ;) ; ; Mimicking Deepak Kumar's initialization of primitive actions ; Attach functions to their associated primitive action nodes: ; (^ (attach-primaction ;; built-in actions: snsequence snsequence sniterate sniterate achieve achieve believe believe withsome withsome withall withall ;;user defined actions: say say ;TEMP ;divisible-by divisible-by build-div-list build-div-list)) (t) CPU time : 0.00 * ; ; Define all the necessary rels for NL GCD Algo ; (define before after lex member class object state object3 object4 object5 object6 object7 first rest) (before after lex member class object state object3 object4 object5 object6 object7 first rest) CPU time : 0.00 * ;TEMP: Natural number concept definitions (assert member (x y) class NaturalNumber) (m1!) CPU time : 0.01 * (assert member (x-divisor-list y-divisor-list) class NaturalNumberList) (m2!) CPU time : 0.00 * ;Temporal Sequence Definition (assert before T1 after T2) (m3!) CPU time : 0.00 * (assert before T2 after T3) (m4!) CPU time : 0.00 * (assert before T3 after T4) (m5!) CPU time : 0.00 * (assert before T4 after T5) (m6!) CPU time : 0.00 * (assert before T5 after T6) (m7!) CPU time : 0.00 * (assert before T6 after T7) (m8!) CPU time : 0.00 * (assert before T7 after T8) (m9!) CPU time : 0.00 * (assert before T8 after T9) (m10!) CPU time : 0.00 * (assert member (T1 T2 T3 T4 T5 T6 T7 T8 T9) class time) (m11!) CPU time : 0.00 * ;----------------------------------------------- ; Complex acts and the plans for achieving them ;----------------------------------------------- (assert forall $x ant (build member *x class NaturalNumber) cq (build act (build action create-divisor-list object1 *x) plan (build action build-div-list)) ) (m13!) CPU time : 0.01 * (assert forall ($x $y) &ant(build member *x class NaturalNumberList) &ant(build member *y class NaturalNumberList) cq(build act (build action find-common object1 *x object2 *y) plan (build action say object1 "Found common members," object2 "for the given lists") ) ) (m15!) CPU time : 0.00 * (assert forall $x ant(build member *x class NaturalNumberList) cq(build act (build action find-greatest object1 *x) plan (build action say object1 "Found greatest member for the given list" object2 *x) ) ) (m16!) CPU time : 0.00 * (assert forall ($x $y) &ant (build member *x class NaturalNumber) &ant (build member *y class NaturalNumber) &ant (build member *x-divisor-list class NaturalNumberList) &ant (build member *y-divisor-list class NaturalNumberList) cq (build act (build action find-gcd object1 *x object2 *y) plan (build action snsequence object1 (build action create-divisor-list object1 *x) object2 (build action create-divisor-list object1 *y) object3 (build action believe object1 (build object divisor-lists state built)) object4 (build action find-common object1 *x-divisor-list object2 *y-divisor-list) object5 (build action believe object1 (build object common-divisors state found)) object6 (build action find-greatest object1 *x-divisor-list) object7 (build action believe object1 (build object gcd state found))) ) ) (m26!) CPU time : 0.00 * ;------------------------------------------------------------------ ; The SNeRE NL GCD Algorithm is now given as a goal-plan case frame ; ----------------------------------------------------------------- ;CASSIE initially believes that all (sub)goals are not yet reached (assert min 0 max 0 arg (build object divisor-lists state built)) (m27!) CPU time : 0.01 * (assert min 0 max 0 arg (build object common-divisors state found)) (m28!) CPU time : 0.00 * (assert min 0 max 0 arg (build object gcd state found)) (m29!) CPU time : 0.00 * (assert goal (build object gcd state found) plan (build action find-gcd object1 x object2 y) ) (m31!) CPU time : 0.00 * ;Invoke achieve action (perform (build action achieve object1 (build object gcd state found))) Divisor List in LISP is (1 2 4 5 10 20 25 50 100). Divisor List in LISP is (1 2 4 5 10 20 25 50 100). Found common members, for the given lists. Found greatest member for the given list y-divisor-list. CPU time : 0.20 * End of /home/csgrad/ag33/cse740/GCD_project/NatLangGCD.demo demonstration. CPU time : 0.28 * (describe 43)  SNePS ERROR: Unknown node: 43 Occurred in module nodeset-evaluator in function nseval-atom Do you want to debug it? no CPU time : 0.00 * (describe m43) (m43! (first 1) (rest 2)) (m43!) CPU time : 0.00 * (lisp) "End of SNePS" cl-user(4): (exit) ; Exiting Lisp