Using Hashtables to Find the Generation Point of a Problematic Cons

Size: px
Start display at page:

Download "Using Hashtables to Find the Generation Point of a Problematic Cons"

Transcription

1 Using Hashtables to Find the Generation Point of a Problematic Cons Often when you generate a piece of bad data, you don t see a failure until after the program makes a lot of progress. In this case, issuing a simple backtrace from the Lisp (I use CCL) prompt doesn t reveal much about what s actually causing the problem (the problem is the generation of bad data). This document showcases a solution that captures backtrace data by using a hashtable keyed with the bad data. This allows the developer to later find the relevant backtrace, so long as they have access to the bad data via the current backtrace. The limitations of this method are: (1) The bad data needs to be a cons, so it doesn t work when the key is t or nil and (2) that you need some guesses as to where the bad data is generated. The second limitation is trivialized when you have a constructor for generating the data. In which case, you can just modify the constructor of that data to save the key-value-pair in the hashtable. In this example, the constructor is function silent-masg. Originally silent-masg just returned t, but then I redefined it to return a cons pair. And since the cons pair was just as bad as t, the problem was equally observable. 1 Modifications to ACL2 Source Code These modifications could probably be copy+pasted into an ACL2 session, but I prefered to install them into the ACL2 source code for this work. I performed the following steps: 1. Added silent-masg to the list of constants symbols in *primitive-program-fns-with-raw-code*. 2. Inserted the following code before the definition of silent-masg. #-acl2-loop-only (defvar *cons-to-backtrace-hashtable* nil) #-acl2-loop-only (setf *cons-to-backtrace-hashtable* (make-hash-table :test eq :size (expt 2 20))) 3. Finally, I modified my definition of silent-masg to store the key-value-pair in the hashtable. (defun silent-masg () ; This is for use in silent-error-masg. 1

2 (declare (xargs :guard t)) (let ((cp (cons silent-masg t))) #-acl2-loop-only (setf (gethash cp *cons-to-backtrace-hashtable*) (ccl::backtrace-as-list)) cp)) 2 Script for the ACL2 Session (set-debugger-enable t) (ld books/arithmetic-5/lib/floor-mod/floor-mod-basic.lisp ) ; used to find the stack frame and value slot with the offending cons pair :b ; the offending cons pair is in stack frame 1, value slot 1 :v 1 1 ; instead of that exact value, the key is really its cdar (cdar *) ; pretty print the saved stack frame (pprint (gethash * *cons-to-backtrace-hashtable*)) 2

3 3 ACL2 Session To make the ACL2 session more readable, I truncated all of the lines that didn t pretty print well. By looking at pages eleven and twelve of the document and examining the shown backtrace, we can see that function translate-hint-masg-with-state is generating the offending bad data. lhug-7.cs.utexas.edu:~/r/acl2-msg-modified$./ccl-saved_acl2 Welcome to Clozure Common Lisp Version 1.5-r13651 (LinuxX8664)! ACL2 Version 4.0 built September 1, :37:31. Copyright (C) 2010 University of Texas at Austin ACL2 comes with ABSOLUTELY NO WARRANTY. This is free software and you are welcome to redistribute it under certain conditions. For details, see the GNU General Public License. Initialized with (INITIALIZE-ACL2 INCLUDE-BOOK *ACL2-PASS-2-FILES*). See the documentation topic note-4-0 for recent changes. Note: We have modified the prompt in some underlying Lisps to further distinguish it from the ACL2 prompt. ACL2 Version 4.0. Level 1. Cbd "/v/filer4b/v8q002/hvg/ragerdl/repos/acl2-msg-modified/". Distributed books directory "/v/filer4b/v8q002/hvg/ragerdl/repos/acl2-msg-modified/books/". Type :help for help. Type (good-bye) to quit completely out of ACL2. ACL2!>(set-debugger-enable t) <state> ACL2!>(ld "books/arithmetic-5/lib/floor-mod/floor-mod-basic.lisp") ACL2 Version 4.0. Level 2. Cbd "/v/filer4b/v8q002/hvg/ragerdl/repos/acl2-msg-modified/books/arithmetic-5/lib/flo Distributed books directory "/v/filer4b/v8q002/hvg/ragerdl/repos/acl2-msg-modified/books/". Type :help for help. Type (good-bye) to quit completely out of ACL2. "ACL2" Form: ( TABLE ACL2-DEFAULTS-TABLE...) ACL2-DEFAULTS-TABLE 3

4 Form: ( INCLUDE-BOOK "../basic-ops/building-blocks"...) Time: 0.06 seconds (prove: 0.00, print: 0.00, other: 0.06) "/v/filer4b/v8q002/hvg/ragerdl/repos/acl2-msg-modified/books/arithmetic-5/lib/ba Form: ( INCLUDE-BOOK "forcing-types"...) Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01) "/v/filer4b/v8q002/hvg/ragerdl/repos/acl2-msg-modified/books/arithmetic-5/lib/fl To turn on non-linear arithmetic, execute : (SET-DEFAULT-HINTS ((NONLINEARP-DEFAULT-HINT STABLE-UNDER-SIMPLIFICATIONP HIST PSPV))) or : (SET-DEFAULT-HINTS ((NONLINEARP-DEFAULT-HINT++ ID STABLE-UNDER-SIMPLIFICATIONP HIST NIL))) See the README for more about non-linear arithmetic and general information about using this library. Form: ( INCLUDE-BOOK "../basic-ops/top"...) Time: 0.42 seconds (prove: 0.00, print: 0.00, other: 0.42) "/v/filer4b/v8q002/hvg/ragerdl/repos/acl2-msg-modified/books/arithmetic-5/lib/ba Form: ( INCLUDE-BOOK "floor-mod-basic-helper"...) Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02) "/v/filer4b/v8q002/hvg/ragerdl/repos/acl2-msg-modified/books/arithmetic-5/lib/fl ((NONLINEARP-DEFAULT-HINT++ ID STABLE-UNDER-SIMPLIFICATIONP HIST NIL)) Form: ( IN-THEORY (DISABLE...)) Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01) 4

5 3105 ACL2 Observation in ( DEFTHM INTEGERP-MOD-1...): Our heuristics choose (MOD X Y) as the :TYPED-TERM. ACL2 Warning [Subsume] in ( DEFTHM INTEGERP-MOD-1...): A newly proposed :REWRITE rule generated from INTEGERP-MOD-1 probably subsumes the previously added :REWRITE rule INTEGERP-MOD, in the sense that the new rule will now probably be applied whenever the old rule would have been. ACL2 Warning [Subsume] in ( DEFTHM INTEGERP-MOD-1...): The previously added rule INTEGERP-MOD subsumes a newly proposed :REWRITE rule generated from INTEGERP-MOD-1, in the sense that the old rule rewrites a more general target. Because the new rule will be tried first, it may nonetheless find application. But we reduce the conjecture to T, by the :type-prescription rules INTEGERP-MOD and RATIONALP-MOD. Q.E.D. Form: ( DEFTHM INTEGERP-MOD-1...) Rules: ((:TYPE-PRESCRIPTION INTEGERP-MOD) (:TYPE-PRESCRIPTION RATIONALP-MOD)) Warnings: Subsume INTEGERP-MOD-1 ACL2 Observation in ( DEFTHM INTEGERP-MOD-2...): Our heuristics choose (MOD X Y) as the :TYPED-TERM. [Note: A hint was supplied for our processing of the goal above. Thanks!] But simplification reduces this to T, using the :definitions FLOOR, MOD and SYNP, the :executable-counterparts of EQUAL and UNARY--, primitive type reasoning and the :rewrite rules (* (* x y) z), (* 0 x), (* 1 x), (* a (/ a)), (* x (if a b c)), (* y x), (+ 0 x), (+ x (- x)), (+ x (if a b c)), (+ y x), (- (if a b c)), BUBBLE-DOWN-+-MATCH-1, DEFAULT-DIVIDE, DEFAULT-MOD-2, INTEGERP==>DENOMINATOR-=-1, INTEGERP==>NUMERATOR-=-X and NORMALIZE-ADDENDS. Q.E.D. 5

6 Form: ( DEFTHM INTEGERP-MOD-2...) Rules: ((:DEFINITION FLOOR) (:DEFINITION MOD) (:DEFINITION SYNP) (:EXECUTABLE-COUNTERPART EQUAL) (:EXECUTABLE-COUNTERPART UNARY--) (:FAKE-RUNE-FOR-TYPE-SET NIL) (:REWRITE (* (* x y) z) ) (:REWRITE (* 0 x) ) (:REWRITE (* 1 x) ) (:REWRITE (* a (/ a)) ) (:REWRITE (* x (if a b c)) ) (:REWRITE (* y x) ) (:REWRITE (+ 0 x) ) (:REWRITE (+ x (- x)) ) (:REWRITE (+ x (if a b c)) ) (:REWRITE (+ y x) ) (:REWRITE (- (if a b c)) ) (:REWRITE BUBBLE-DOWN-+-MATCH-1) (:REWRITE DEFAULT-DIVIDE) (:REWRITE DEFAULT-MOD-2) (:REWRITE INTEGERP==>DENOMINATOR-=-1) (:REWRITE INTEGERP==>NUMERATOR-=-X) (:REWRITE NORMALIZE-ADDENDS)) Time: 0.02 seconds (prove: 0.01, print: 0.00, other: 0.01) INTEGERP-MOD-2 ACL2 Observation in ( DEFTHM INTEGERP-MOD-3...): Our heuristics choose (MOD X (EXPT 2 I)) as the :TYPED-TERM. [Note: A hint was supplied for our processing of the goal above. Thanks!] We now split the goal into the cases specified by the :CASES hint to produce four new non-trivial subgoals. Subgoal 4 (IMPLIES (AND (NOT (EQUAL I 0)) (<= 0 I) (<= I 0)) (IMPLIES (INTEGERP X) (INTEGERP (MOD X (EXPT 2 I))))). But we reduce the conjecture to T, by the :executable-counterparts of <, INTEGERP and RATIONALP and the :type-prescription rules EXPT-TYPE-PRESCRIPTION-INTEGERP-BASE, 6

7 EXPT-TYPE-PRESCRIPTION-NONNEGATIVE-BASE, EXPT-TYPE-PRESCRIPTION-POSITIVE-BASE and INTEGERP-MOD-1. Subgoal 3 (IMPLIES (EQUAL I 0) (IMPLIES (INTEGERP X) (INTEGERP (MOD X (EXPT 2 I))))). But we reduce the conjecture to T, by the :executable-counterparts of <, INTEGERP and RATIONALP, primitive type reasoning and the :typeprescription rules EXPT-TYPE-PRESCRIPTION-INTEGERP-BASE, EXPT-TYPE-PRESCRIPTION-NONNEGATIVE-BASE, EXPT-TYPE-PRESCRIPTION-POSITIVE-BASE, INTEGERP-/-EXPT-1 and INTEGERP-MOD-2. Subgoal 2 (IMPLIES (< I 0) (IMPLIES (INTEGERP X) (INTEGERP (MOD X (EXPT 2 I))))). By case analysis we reduce the conjecture to Subgoal 2 (IMPLIES (AND (< I 0) (INTEGERP X)) (INTEGERP (MOD X (EXPT 2 I)))). But simplification reduces this to T, using the :definition SYNP, the :executable-counterparts of <, INTEGERP, RATIONALP and UNARY-/, primitive type reasoning, the :rewrite rules (/ (expt x n)), (/ (if a b c)), DEFAULT-EXPT-2, DEFAULT-LESS-THAN-1 and INTEGERP-MOD-2 and the :typeprescription rules EXPT-TYPE-PRESCRIPTION-INTEGERP-BASE, EXPT-TYPE-PRESCRIPTION-NONNEGATIVE-BASE and EXPT-TYPE-PRESCRIPTION-POSITIVE-BASE. Subgoal 1 (IMPLIES (< 0 I) (IMPLIES (INTEGERP X) (INTEGERP (MOD X (EXPT 2 I))))). But we reduce the conjecture to T, by the :executable-counterparts of <, INTEGERP and RATIONALP, primitive type reasoning and the :typeprescription rules EXPT-TYPE-PRESCRIPTION-INTEGERP-BASE, EXPT-TYPE-PRESCRIPTION-NONNEGATIVE-BASE, EXPT-TYPE-PRESCRIPTION-POSITIVE-BASE and INTEGERP-MOD-1. Q.E.D. 7

8 Form: ( DEFTHM INTEGERP-MOD-3...) Rules: ((:DEFINITION NOT) (:DEFINITION SYNP) (:EXECUTABLE-COUNTERPART <) (:EXECUTABLE-COUNTERPART INTEGERP) (:EXECUTABLE-COUNTERPART RATIONALP) (:EXECUTABLE-COUNTERPART UNARY-/) (:FAKE-RUNE-FOR-TYPE-SET NIL) (:REWRITE (/ (expt x n)) ) (:REWRITE (/ (if a b c)) ) (:REWRITE DEFAULT-EXPT-2) (:REWRITE DEFAULT-LESS-THAN-1) (:REWRITE INTEGERP-MOD-2) (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP-BASE) (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-NONNEGATIVE-BASE) (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-POSITIVE-BASE) (:TYPE-PRESCRIPTION INTEGERP-/-EXPT-1) (:TYPE-PRESCRIPTION INTEGERP-MOD-1) (:TYPE-PRESCRIPTION INTEGERP-MOD-2)) Time: 0.04 seconds (prove: 0.03, print: 0.01, other: 0.00) INTEGERP-MOD-3 Form: ( IN-THEORY (DISABLE...)) 3105 ACL2 Observation in ( DEFTHM RATIONALP-MOD...): Our heuristics choose (MOD X Y) as the :TYPED-TERM. The event ( DEFTHM RATIONALP-MOD...) is redundant. See :DOC redundantevents. Form: ( DEFTHM RATIONALP-MOD...) :REDUNDANT Form: ( IN-THEORY (DISABLE...)) Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01) 3103 The event ( DEFTHM FLOOR-MOD-ELIM...) is redundant. See :DOC redundant- 8

9 events. Form: ( DEFTHM FLOOR-MOD-ELIM...) :REDUNDANT The event ( DEFTHM LINEAR-FLOOR-BOUNDS-1...) is redundant. See :DOC redundant-events. Form: ( DEFTHM LINEAR-FLOOR-BOUNDS-1...) :REDUNDANT The event ( DEFTHM LINEAR-FLOOR-BOUNDS-2...) is redundant. See :DOC redundant-events. Form: ( DEFTHM LINEAR-FLOOR-BOUNDS-2...) :REDUNDANT The event ( DEFTHM LINEAR-FLOOR-BOUNDS-3...) is redundant. See :DOC redundant-events. Form: ( DEFTHM LINEAR-FLOOR-BOUNDS-3...) :REDUNDANT The event ( DEFTHM MOD-BOUNDS-1...) is redundant. See :DOC redundantevents. Form: ( DEFTHM MOD-BOUNDS-1...) :REDUNDANT The event ( DEFTHM MOD-BOUNDS-2...) is redundant. See :DOC redundantevents. 9

10 Form: ( DEFTHM MOD-BOUNDS-2...) :REDUNDANT By case analysis we reduce the conjecture to Goal (IMPLIES (AND (ACL2-NUMBERP Y) (INTEGERP (* X (/ Y))) (NOT (EQUAL Y 0))) (EQUAL (MOD X Y) 0)). This simplifies, using the :definition SYNP, the :executable-counterpart of EQUAL and the :rewrite rules (equal (if a b c) x) and DEFAULT-MOD-1, to Goal (IMPLIES (AND (ACL2-NUMBERP Y) (INTEGERP (* X (/ Y))) (NOT (EQUAL Y 0)) (ACL2-NUMBERP X)) (EQUAL (MOD X Y) 0)). [Note: branch.] ACL2 Error in ( DEFTHM MOD-BOUNDS-3...): > Error: value T is not of the expected type LIST. > While executing: CCL::APPEND-2, in process listener(1). > Type :GO to continue, :POP to abort, :R for a list of available restarts. > If continued: Skip evaluation of (acl2::acl2-default-restart) > Type :? for other options. 1 > [RAW LISP] :b *(7F615E1C6B80) : 0 (APPEND-2 T ((#\0 SILENT-MASG. T))) 52 (7F615E1C6BF0) : 1 (FMT0 T ((#\0 SILENT-MASG. T)) ACL2-OUTPUT-CHANNEL::S (7F615E1C6C80) : 2 (FMT1 "~@0" ((#\0 SILENT-MASG. T)) 43 ACL2-OUTPUT-CHANNEL::S (7F615E1C6CE8) : 3 (FMT-ABBREV1 "~@0" ((#\0 SILENT-MASG. T)) 43 ACL2-OUTPUT-CHA (7F615E1C6D40) : 4 (FMT-ABBREV "~@0" ((#\0 SILENT-MASG. T)) 43 ACL2-OUTPUT-CHAN (7F615E1C6D88) : 5 (ERROR-FMS NIL (DEFTHM. MOD-BOUNDS-3) "~@0" ((#\0 SILENT-MAS (7F615E1C6DD8) : 6 (ERROR1 (DEFTHM. MOD-BOUNDS-3) "~@0" ((#\0 SILENT-MASG. T)) (7F615E1C6E40) : 7 (WATERFALL 0 NIL ((#)) ((# NIL) (NIL) (NIL # # NIL) (IMPLIES (7F615E1C6EF8) : 8 (PROVE-LOOP1 0 NIL ((#)) ((# NIL) (NIL) (NIL # # NIL) (IMPLIE (7F615E1C6F78) : 9 (PROVE-LOOP0 ((#)) ((# NIL) (NIL) (NIL # # NIL) (IMPLIES # #) 10

11 (7F615E1C7008) : 10 (PROVE-LOOP ((#)) ((# NIL) (NIL) (NIL # # NIL) (IMPLIES # #) (7F615E1C70D0) : 11 (PROVE (IMPLIES (IF # # #) (EQUAL # #)) ((# NIL) (NIL) (NIL (7F615E1C7140) : 12 (DEFTHM-FN1 MOD-BOUNDS-3 (IMPLIES (AND # # #) (EQUAL # 0)) A (7F615E1C7310) : 13 (RAW-EV-FNCALL DEFTHM-FN (MOD-BOUNDS-3 (IMPLIES # #) ACL2_IN (7F615E1C73C0) : 14 (EV (DEFTHM-FN MOD-BOUNDS-3 # STATE #...) ((STATE. ACL2 (7F615E1C7458) : 15 (EV-FOR-TRANS-EVAL (DEFTHM-FN MOD-BOUNDS-3 # STATE #...) (7F615E1C74C0) : 16 (LD-READ-EVAL-PRINT ACL2_INVISIBLE:: The Live State Itself ) (7F615E1C7588) : 17 (LD-LOOP ACL2_INVISIBLE:: The Live State Itself ) 133 (7F615E1C75B0) : 18 (LD-FN-BODY "books/arithmetic-5/lib/floor-mod/floor-mod-basi (7F615E1C7608) : 19 (LD-FN0 ((STANDARD-OI. "books/arithmetic-5/lib/floor-mod/fl (7F615E1C7748) : 20 (RAW-EV-FNCALL LD-FN ((# #) ACL2_INVISIBLE:: The Live State (7F615E1C77F8) : 21 (EV (LD-FN (CONS # #) STATE T) ((STATE. ACL2_INVISIBLE:: T (7F615E1C7890) : 22 (EV-FOR-TRANS-EVAL (LD-FN (CONS # #) STATE T) (STATE) (NIL (7F615E1C78F8) : 23 (LD-READ-EVAL-PRINT ACL2_INVISIBLE:: The Live State Itself ) (7F615E1C79C0) : 24 (LD-LOOP ACL2_INVISIBLE:: The Live State Itself ) 133 (7F615E1C79E8) : 25 (LD-FN-BODY ACL2-INPUT-CHANNEL::STANDARD-OBJECT-INPUT-0 ((LD directory ~xb.~ Type :help for help.~%type (good-bye) to ~ quit completely out of ACL2.~ ~%") (LD-QUERY-CONTROL-ALIST) (L (7F615E1C7A40) : 26 (LD-FN0 ((STANDARD-OI. ACL2-INPUT-CHANNEL::STANDARD-OBJECT- (7F615E1C7B80) : 27 (LD-FN ((STANDARD-OI. ACL2-INPUT-CHANNEL::STANDARD-OBJECT-I (7F615E1C7BE8) : 28 (LP) 7445 (7F615E1C7C40) : 29 (CALL-CHECK-REGS LP) 229 (7F615E1C7C78) : 30 (CHEAP-EVAL (LP)) 101 (7F615E1C7CB0) : 31 (ACL2-DEFAULT-RESTART) 709 (7F615E1C7CD0) : 32 (CALL-CHECK-REGS ACL2-DEFAULT-RESTART) 229 (7F615E1C7D08) : 33 (CHEAP-EVAL (ACL2-DEFAULT-RESTART)) 101 (7F615E1C7D40) : 34 (FUNCALL # #<(:INTERNAL CCL::EVAL-STRING CCL::STARTUP-CCL)> (7F615E1C7D88) : 35 (STARTUP-CCL ("home:ccl-init" "home:\\.ccl-init")) 1661 (7F615E1C7DF8) : 36 (FUNCALL # #<(:INTERNAL (CCL:TOPLEVEL-FUNCTION (CCL::LISP-DE (7F615E1C7E18) : 37 (FUNCALL # #<(:INTERNAL CCL::MAKE-MCL-LISTENER-PROCESS)>) 64 (7F615E1C7EB0) : 38 (RUN-PROCESS-INITIAL-FORM #<TTY-LISTENER listener(1) [Active (7F615E1C7F48) : 39 (FUNCALL # #<(:INTERNAL (CCL::%PROCESS-PRESET-INTERNAL (CCL: (7F615E1C7F98) : 40 (FUNCALL # #<(:INTERNAL CCL::THREAD-MAKE-STARTUP-FUNCTION)>) 1 > [RAW LISP] :v 1 1 ((#\0 SILENT-MASG. T)) 1 > [RAW LISP] (cdar *) (SILENT-MASG. T) 1 > [RAW LISP] (pprint (gethash * *cons-to-backtrace-hashtable*)) ((CCL::BACKTRACE-AS-LIST ":CONTEXT" ":PROCESS" ":ORIGIN" ":COUNT" 11

12 " " ":START-FRAME-NUMBER" "0" ":PRINT-LEVEL" "2" ":PRINT-LENGTH" "5" ":SHOW-INTERNAL-FRAMES" ) (SILENT-MASG) (TRANSLATE-HINT-MASG-WITH-STATE "(MOD-BOUNDS-3. \"Goal \")" "(\"Subgoal D2\" :DYNAMIC-E/D (# #) :NONLINEARP NIL)" "(\"a ~#0~[custom keyword~/computed~] hint for ~x1: The ~ ~#0~[custom keyword~/computed~] hint ~%~#0~[~x2 ~ ~/~q2~]produced the non-nil result~%~y3.~@4regarding this ~ value\" (#\\0. 1) (#\\1. \"Goal \") (#\\2 LIST NIL # STATE) (TRANSLATE-OR-HINT-MASG-WITH-STATE "(MOD-BOUNDS-3. \"Goal \")" "\"Goal \"" "((:DYNAMIC-E/D # :NONLINEARP NIL) (:NONLINEARP T))" "(\"a ~#0~[custom keyword~/computed~] hint for ~x1: The ~ ~#0~[custom keyword~/computed~] hint ~%~#0~[~x2 ~ ~/~q2~]produced the non-nil result~%~y3.~@4regarding this ~ value\" (#\\0. 1) (#\\1. \"Goal \") (#\\2 LIST NIL # STATE) (TRANSLATE-HINT-SETTINGS-MASG-WITH-STATE "(MOD-BOUNDS-3. \"Goal \")" "\"Goal \"" "(:OR (# #))" "(\"a ~#0~[custom keyword~/computed~] hint for ~x1: The ~ ~#0~[custom keyword~/computed~] hint ~%~#0~[~x2 ~ ~/~q2~]produced the non-nil result~%~y3.~@4regarding this ~ value\" (#\\0. 1) (#\\1. \"Goal \") (#\\2 LIST NIL # STATE) (TRANSLATE-HINT-MASG-WITH-STATE "MOD-BOUNDS-3" "(\"Goal \" :OR (# #))" "(\"a ~#0~[custom keyword~/computed~] hint for ~x1: The ~ ~#0~[custom keyword~/computed~] hint ~%~#0~[~x2 ~ ~/~q2~]produced the non-nil result~%~y3.~@4regarding this ~ 12

13 value\" (#\\0. 1) (#\\1. \"Goal \") (#\\2 LIST NIL # STATE) (EVAL-AND-TRANSLATE-HINT-EXPRESSION-MASG-WITH-STATE "(MOD-BOUNDS-3 T (CONS # #))" "((0) NIL. 2)" "((NOT #) (NOT #) (EQUAL Y #) (NOT #) (EQUAL # #))" "T" "((SETTLED-DOWN-CLAUSE NIL #. HIT) (SIMPLIFY-CLAUSE # #. HIT-REWRITE) (PREPR "((# NIL) (#) (NIL # # NIL) (IMPLIES # #) (IMPLIES # #)...)" ":OMITTED" ":OMITTED" ":OMITTED" (FIND-APPLICABLE-HINT-SETTINGS1-MASG-WITH-STATE "((0) NIL. 2)" "((NOT #) (NOT #) (EQUAL Y #) (NOT #) (EQUAL # #))" "((SETTLED-DOWN-CLAUSE NIL #. HIT) (SIMPLIFY-CLAUSE # #. HIT-REWRITE) (PREPR "((# NIL) (#) (NIL # # NIL) (IMPLIES # #) (IMPLIES # #)...)" "T" (WATERFALL0 "(ELIMINATE-DESTRUCTORS-CLAUSE FERTILIZE-CLAUSE GENERALIZE-CLAUSE EL "((0) NIL. 2)" "((NOT #) (NOT #) (EQUAL Y #) (NOT #) (EQUAL # #))" "((SETTLED-DOWN-CLAUSE NIL #. HIT) (SIMPLIFY-CLAUSE # #. HIT-REWRI "((# NIL) (#) (NIL # # NIL) (IMPLIES # #) (IMPLIES # #)...)" "((3665 # # # #...) (ENABLED-ARRAY ) (#\\E #\\N #\\A #\\B # "((COMMAND-LANDMARK GLOBAL-VALUE 6335 # \"/v/filer4b/v8q002/hvg/rage (WATERFALL1 "(APPLY-TOP-HINTS-CLAUSE PREPROCESS-CLAUSE SIMPLIFY-CLAUSE SETTLED-D "((0) NIL. 2)" "((NOT #) (NOT #) (EQUAL Y #) (NOT #) (EQUAL # #))" "((SETTLED-DOWN-CLAUSE NIL #. HIT) (SIMPLIFY-CLAUSE # #. HIT-REWRI "((# NIL) (#) (NIL # # NIL) (IMPLIES # #) (IMPLIES # #)...)" "T" 13

14 "((3665 # # # #...) (ENABLED-ARRAY ) (#\\E #\\N #\\A #\\B # "((COMMAND-LANDMARK GLOBAL-VALUE 6335 # \"/v/filer4b/v8q002/hvg/rage (WATERFALL1-LST "SETTLED-DOWN-CLAUSE" "((0) NIL. 2)" "((# # # # #))" "((SETTLED-DOWN-CLAUSE NIL #. HIT) (SIMPLIFY-CLAUSE # #. HIT-REWRITE) (PREPR "((# NIL) (#) (NIL # # NIL) (IMPLIES # #) (IMPLIES # #)...)" "T" "((3665 # # # #...) (ENABLED-ARRAY ) (#\\E #\\N #\\A #\\B #\\L...). (WATERFALL1 "(APPLY-TOP-HINTS-CLAUSE PREPROCESS-CLAUSE SIMPLIFY-CLAUSE SETTLED-D "((0) NIL. 2)" "((NOT #) (NOT #) (EQUAL Y #) (NOT #) (EQUAL # #))" "((SIMPLIFY-CLAUSE # #. HIT-REWRITE) (PREPROCESS-CLAUSE # #. HIT)) "((# NIL) (#) (NIL # # NIL) (IMPLIES # #) (IMPLIES # #)...)" "((3665 # # # #...) (ENABLED-ARRAY ) (#\\E #\\N #\\A #\\B # "((COMMAND-LANDMARK GLOBAL-VALUE 6335 # \"/v/filer4b/v8q002/hvg/rage (WATERFALL1-LST "((0) NIL. 1)" "((# # # # #))" "((SIMPLIFY-CLAUSE # #. HIT-REWRITE) (PREPROCESS-CLAUSE # #. HIT))" "((# NIL) (#) (NIL # # NIL) (IMPLIES # #) (IMPLIES # #)...)" "((3665 # # # #...) (ENABLED-ARRAY ) (#\\E #\\N #\\A #\\B #\\L...). (WATERFALL1 "(APPLY-TOP-HINTS-CLAUSE PREPROCESS-CLAUSE SIMPLIFY-CLAUSE SETTLED-D "((0) NIL. 1)" "((NOT #) (NOT #) (EQUAL Y #) (EQUAL # #))" "((PREPROCESS-CLAUSE # #. HIT))" "((# NIL) (#) (NIL # # NIL) (IMPLIES # #) (IMPLIES # #)...)" 14

15 "((3665 # # # #...) (ENABLED-ARRAY ) (#\\E #\\N #\\A #\\B # "((COMMAND-LANDMARK GLOBAL-VALUE 6335 # \"/v/filer4b/v8q002/hvg/rage (WATERFALL1-LST "((0) NIL. 0)" "((# # # #))" "((PREPROCESS-CLAUSE # #. HIT))" "((# NIL) (#) (NIL # # NIL) (IMPLIES # #) (IMPLIES # #)...)" "((3665 # # # #...) (ENABLED-ARRAY ) (#\\E #\\N #\\A #\\B #\\L...). (WATERFALL1 "(APPLY-TOP-HINTS-CLAUSE PREPROCESS-CLAUSE SIMPLIFY-CLAUSE SETTLED-D "((0) NIL. 0)" "((IMPLIES # #))" "((# NIL) (NIL) (NIL # # NIL) (IMPLIES # #) (IMPLIES # #)...)" "T" "((3665 # # # #...) (ENABLED-ARRAY ) (#\\E #\\N #\\A #\\B # "((COMMAND-LANDMARK GLOBAL-VALUE 6335 # \"/v/filer4b/v8q002/hvg/rage (WATERFALL1-LST "SETTLED-DOWN-CLAUSE" "((0) NIL. 0)" "((#))" "((# NIL) (NIL) (NIL # # NIL) (IMPLIES # #) (IMPLIES # #)...)" "T" "((3665 # # # #...) (ENABLED-ARRAY ) (#\\E #\\N #\\A #\\B #\\L...). (WATERFALL "0" "((#))" "((# NIL) (NIL) (NIL # # NIL) (IMPLIES # #) (IMPLIES # #)...)" 15

16 "((3665 # # # #...) (ENABLED-ARRAY ) (#\\E #\\N #\\A #\\B #\ "((COMMAND-LANDMARK GLOBAL-VALUE 6335 # \"/v/filer4b/v8q002/hvg/rager (PROVE-LOOP1 "0" "((#))" "((# NIL) (NIL) (NIL # # NIL) (IMPLIES # #) (IMPLIES # #)...)" "((3665 # # # #...) (ENABLED-ARRAY ) (#\\E #\\N #\\A #\\B "((COMMAND-LANDMARK GLOBAL-VALUE 6335 # \"/v/filer4b/v8q002/hvg/rag (PROVE-LOOP0 "((#))" "((# NIL) (NIL) (NIL # # NIL) (IMPLIES # #) (IMPLIES # #)...)" "((3665 # # # #...) (ENABLED-ARRAY ) (#\\E #\\N #\\A #\\B "((COMMAND-LANDMARK GLOBAL-VALUE 6335 # \"/v/filer4b/v8q002/hvg/rag (PROVE-LOOP "((#))" "((# NIL) (NIL) (NIL # # NIL) (IMPLIES # #) (IMPLIES # #)...)" "((3665 # # # #...) (ENABLED-ARRAY ) (#\\E #\\N #\\A #\\B # "((COMMAND-LANDMARK GLOBAL-VALUE 6335 # \"/v/filer4b/v8q002/hvg/rage (PROVE "(IMPLIES (IF # # #) (EQUAL # #))" "((# NIL) (NIL) (NIL # # NIL) T (IMPLIES # #)...)" "((3665 # # # #...) (ENABLED-ARRAY ) (#\\E #\\N #\\A #\\B #\\L. "((COMMAND-LANDMARK GLOBAL-VALUE 6335 # \"/v/filer4b/v8q002/hvg/ragerdl/r (DEFTHM-FN1 "MOD-BOUNDS-3" "(IMPLIES (AND # # #) (EQUAL # 0))" "ACL2_INVISIBLE:: The Live State Itself " "((:GENERALIZE) (:LINEAR))" "(DEFTHM MOD-BOUNDS-3 (IMPLIES # #) :RULE-CLASSES (# #))") (RAW-EV-FNCALL "DEFTHM-FN" "(MOD-BOUNDS-3 (IMPLIES # #) ACL2_INVISIBLE:: The Live State Itself (# #) NIL "((STATE. ACL2_INVISIBLE:: The Live State Itself ))" 16

17 "T") (EV "(DEFTHM-FN MOD-BOUNDS-3 # STATE #...)" "((STATE. ACL2_INVISIBLE:: The Live State Itself ))" "ACL2_INVISIBLE:: The Live State Itself " "((STATE. ACL2_INVISIBLE:: The Live State Itself ))" "T") (EV-FOR-TRANS-EVAL "(DEFTHM-FN MOD-BOUNDS-3 # STATE #...)" "(STATE)" "(NIL NIL STATE)" "TOP-LEVEL" "ACL2_INVISIBLE:: The Live State Itself " "T") (LD-READ-EVAL-PRINT (LD-LOOP (LD-FN-BODY "\"books/arithmetic-5/lib/floor-mod/floor-mod-basic.lisp\"" "((LD-ERROR-ACTION. :RETURN!) (STANDARD-OI. ACL2-INPUT-CHANNEL:: / (LD-FN0 "((STANDARD-OI. \"books/arithmetic-5/lib/floor-mod/floor-mod-basic.lisp "ACL2_INVISIBLE:: The Live State Itself " "T") (RAW-EV-FNCALL "LD-FN" "((# #) ACL2_INVISIBLE:: The Live State Itself T)" "((STATE. ACL2_INVISIBLE:: The Live State Itself ))" "T") (EV "(LD-FN (CONS # #) STATE T)" "((STATE. ACL2_INVISIBLE:: The Live State Itself ))" "ACL2_INVISIBLE:: The Live State Itself " "((STATE. ACL2_INVISIBLE:: The Live State Itself ))" "T") (EV-FOR-TRANS-EVAL "(LD-FN (CONS # #) STATE T)" "(STATE)" "(NIL NIL STATE)" "TOP-LEVEL" "ACL2_INVISIBLE:: The Live State Itself " "T") (LD-READ-EVAL-PRINT (LD-LOOP (LD-FN-BODY "ACL2-INPUT-CHANNEL::STANDARD-OBJECT-INPUT-0" "((LD-VERBOSE. \"~sv. Level ~Fl. Cbd ~xc.~ Distributed books ~ directory ~xb.~ Type :help for help.~%type (good-bye) to ~ 17

18 quit completely out of ACL2.~ ~%\") (LD-QUERY-CONTROL-ALIST) ( (LD-FN0 "((STANDARD-OI. ACL2-INPUT-CHANNEL::STANDARD-OBJECT-INPUT-0) (STANDARD- "ACL2_INVISIBLE:: The Live State Itself " ) (LD-FN "((STANDARD-OI. ACL2-INPUT-CHANNEL::STANDARD-OBJECT-INPUT-0) (STANDARD-C "ACL2_INVISIBLE:: The Live State Itself " ) (LP) (CCL::CALL-CHECK-REGS "LP") (CCL::CHEAP-EVAL "(LP)") (ACL2-DEFAULT-RESTART) (CCL::CALL-CHECK-REGS "ACL2-DEFAULT-RESTART") (CCL::CHEAP-EVAL "(ACL2-DEFAULT-RESTART)") (FUNCALL "(:INTERNAL CCL::EVAL-STRING CCL::STARTUP-CCL)" "\"(acl2::acl2-default-restart)\"") (CCL::STARTUP-CCL "(\"home:ccl-init\" \"home:\\\\.ccl-init\")") (FUNCALL "(:INTERNAL (CCL:TOPLEVEL-FUNCTION (CCL::LISP-DEVELOPMENT-SYSTEM T)))") (FUNCALL "(:INTERNAL CCL::MAKE-MCL-LISTENER-PROCESS)") (CCL::RUN-PROCESS-INITIAL-FORM "#<TTY-LISTENER listener(1) [Active] #x b92d>" "(#<CCL:COMPILED-LEXICAL-CLOSURE # #x302003c253cf>)") (FUNCALL "(:INTERNAL (CCL::%PROCESS-PRESET-INTERNAL (CCL:PROCESS)))" "#<TTY-LISTENER listener(1) [Active] #x b92d>" "(#<CCL:COMPILED-LEXICAL-CLOSURE # #x302003c253cf>)") (FUNCALL "(:INTERNAL CCL::THREAD-MAKE-STARTUP-FUNCTION)")) 1 > [RAW LISP] 18

A Tool for Simplifying ACL2 Definitions

A Tool for Simplifying ACL2 Definitions 1/27 A Tool for Simplifying ACL2 Definitions Matt Kaufmann The University of Texas at Austin May 3, 2016 2/27 INTRODUCTION (1) In this talk we present a tool for simplifying ACL2 definitions. Used in Kestrel

More information

Improving Eliminate-Irrelevance for ACL2

Improving Eliminate-Irrelevance for ACL2 1/19 Improving Eliminate-Irrelevance for ACL2 Matt Kaufmann (Joint Work with J Moore) The University of Texas at Austin October 14, 2016 2/19 OUTLINE Organization of this talk. 2/19 OUTLINE Organization

More information

Induction Schemes. Math Foundations of Computer Science

Induction Schemes. Math Foundations of Computer Science Induction Schemes Math Foundations of Computer Science Topics Induction Example Induction scheme over the naturals Termination Reduction to equational reasoning ACL2 proof General Induction Schemes Induction

More information

Backtracking and Induction in ACL2

Backtracking and Induction in ACL2 Backtracking and Induction in ACL2 John Erickson University of Texas at Austin jderick@cs.utexas.edu ABSTRACT This paper presents an extension to ACL2 that allows backtracking to occur when a proof fails.

More information

Reasoning About Programs Panagiotis Manolios

Reasoning About Programs Panagiotis Manolios Reasoning About Programs Panagiotis Manolios Northeastern University March 1, 2017 Version: 101 Copyright c 2017 by Panagiotis Manolios All rights reserved. We hereby grant permission for this publication

More information

Announcement. Overview. LISP: A Quick Overview. Outline of Writing and Running Lisp.

Announcement. Overview. LISP: A Quick Overview. Outline of Writing and Running Lisp. Overview Announcement Announcement Lisp Basics CMUCL to be available on sun.cs. You may use GNU Common List (GCL http://www.gnu.org/software/gcl/ which is available on most Linux platforms. There is also

More information

Common Lisp. Blake McBride

Common Lisp. Blake McBride Contents Common Lisp Blake McBride (blake@mcbride.name) 1 Data Types 2 2 Numeric Hierarchy 3 3 Comments 3 4 List Operations 4 5 Evaluation and Quotes 5 6 String Operations 5 7 Predicates 6 8 Math Predicates

More information

Extending ACL2 with SMT solvers

Extending ACL2 with SMT solvers Extending ACL2 with SMT solvers Yan Peng & Mark Greenstreet University of British Columbia October 2nd, 2015 Smtlink handles tedious details of proofs so you can focus on the interesting parts. 1 / 24

More information

Software Verification with ACL2

Software Verification with ACL2 Software Verification with ACL2 Francisco Palomo Lozano francisco.palomo@uca.es Software Verification and Validation Department of Computer Science Summary Introduction 1 Introduction 2 First Steps 3 Atoms

More information

Finite Set Theory. based on Fully Ordered Lists. Jared Davis UT Austin. ACL2 Workshop 2004

Finite Set Theory. based on Fully Ordered Lists. Jared Davis UT Austin. ACL2 Workshop 2004 Finite Set Theory based on Fully Ordered Lists Jared Davis UT Austin ACL2 Workshop 2004 Motivation (1/2) Unique representation for each set No mutual recursion needed for membership, subset, and set equality

More information

A Futures Library and Parallelism Abstractions for a Functional Subset of Lisp

A Futures Library and Parallelism Abstractions for a Functional Subset of Lisp A Futures Library and Parallelism Abstractions for a Functional Subset of Lisp David L. Rager {ragerdl@cs.utexas.edu} Warren A. Hunt, Jr. {hunt@cs.utexas.edu} Matt Kaufmann {kaufmann@cs.utexas.edu} The

More information

INF4820: Algorithms for Artificial Intelligence and Natural Language Processing. Common Lisp Fundamentals

INF4820: Algorithms for Artificial Intelligence and Natural Language Processing. Common Lisp Fundamentals INF4820: Algorithms for Artificial Intelligence and Natural Language Processing Common Lisp Fundamentals Stephan Oepen & Murhaf Fares Language Technology Group (LTG) August 30, 2017 Last Week: What is

More information

CSCI337 Organisation of Programming Languages LISP

CSCI337 Organisation of Programming Languages LISP Organisation of Programming Languages LISP Getting Started Starting Common Lisp $ clisp i i i i i i i ooooo o ooooooo ooooo ooooo I I I I I I I 8 8 8 8 8 o 8 8 I \ `+' / I 8 8 8 8 8 8 \ `-+-' / 8 8 8 ooooo

More information

SCHEME 7. 1 Introduction. 2 Primitives COMPUTER SCIENCE 61A. October 29, 2015

SCHEME 7. 1 Introduction. 2 Primitives COMPUTER SCIENCE 61A. October 29, 2015 SCHEME 7 COMPUTER SCIENCE 61A October 29, 2015 1 Introduction In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write Scheme programs,

More information

Polymorphic Types in ACL2

Polymorphic Types in ACL2 Polymorphic Types in ACL2 Benjamin Selfridge University of Texas at Austin Austin, TX benself@cs.utexas.edu Eric Smith Kestrel Institute Palo Alto, CA eric.smith@kestrel.edu This paper describes a tool

More information

SCHEME AND CALCULATOR 5b

SCHEME AND CALCULATOR 5b SCHEME AND CALCULATOR 5b COMPUTER SCIENCE 6A July 25, 203 In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write Scheme programs,

More information

Homework 1. Notes. What To Turn In. Unix Accounts. Reading. Handout 3 CSCI 334: Spring, 2017

Homework 1. Notes. What To Turn In. Unix Accounts. Reading. Handout 3 CSCI 334: Spring, 2017 Homework 1 Due 14 February Handout 3 CSCI 334: Spring, 2017 Notes This homework has three types of problems: Self Check: You are strongly encouraged to think about and work through these questions, but

More information

Functional programming with Common Lisp

Functional programming with Common Lisp Functional programming with Common Lisp Dr. C. Constantinides Department of Computer Science and Software Engineering Concordia University Montreal, Canada August 11, 2016 1 / 81 Expressions and functions

More information

Gene Kim 9/9/2016 CSC 2/444 Lisp Tutorial

Gene Kim 9/9/2016 CSC 2/444 Lisp Tutorial Gene Kim 9/9/2016 CSC 2/444 Lisp Tutorial About this Document This document was written to accompany an in-person Lisp tutorial. Therefore, the information on this document alone is not likely to be sufficient

More information

Mechanized Operational Semantics

Mechanized Operational Semantics Mechanized Operational Semantics J Strother Moore Department of Computer Sciences University of Texas at Austin Marktoberdorf Summer School 2008 (Lecture 2: An Operational Semantics) 1 M1 An M1 state consists

More information

Lecture #5 Kenneth W. Flynn RPI CS

Lecture #5 Kenneth W. Flynn RPI CS Outline Programming in Lisp Lecture #5 Kenneth W. Flynn RPI CS We've seen symbols in three contexts so far: > (setf sym ) (let ((sym ))...) >'Sym SYM -- Context The first of these refers to a special (or

More information

Reasoning About Programs Panagiotis Manolios

Reasoning About Programs Panagiotis Manolios Reasoning About Programs Panagiotis Manolios Northeastern University February 26, 2017 Version: 100 Copyright c 2017 by Panagiotis Manolios All rights reserved. We hereby grant permission for this publication

More information

Refinement and Theorem Proving

Refinement and Theorem Proving Refinement and Theorem Proving Panagiotis Manolios College of Computing Georgia Institute of Technology Atlanta, GA, 30318 manolios@cc.gatech.edu 1 Introduction In this chapter, we describe the ACL2 theorem

More information

Function Memoization and Unique Object Representation for ACL2 Functions

Function Memoization and Unique Object Representation for ACL2 Functions Function Memoization and Unique Object Representation for ACL2 Functions Robert S. Boyer Department of Computer Sciences The University of Texas Austin, Texas USA boyer@cs.utexas.edu Warren A. Hunt, Jr.

More information

Reasoning About Programs Panagiotis Manolios

Reasoning About Programs Panagiotis Manolios Reasoning About Programs Panagiotis Manolios Northeastern University March 22, 2012 Version: 58 Copyright c 2012 by Panagiotis Manolios All rights reserved. We hereby grant permission for this publication

More information

Homework 1. Reading. Problems. Handout 3 CSCI 334: Spring, 2012

Homework 1. Reading. Problems. Handout 3 CSCI 334: Spring, 2012 Homework 1 Due 14 February Handout 3 CSCI 334: Spring, 2012 Reading 1. (Required) Mitchell, Chapter 3. 2. (As Needed) The Lisp Tutorial from the Links web page, as needed for the programming questions.

More information

Lisp Basic Example Test Questions

Lisp Basic Example Test Questions 2009 November 30 Lisp Basic Example Test Questions 1. Assume the following forms have been typed into the interpreter and evaluated in the given sequence. ( defun a ( y ) ( reverse y ) ) ( setq a (1 2

More information

Function Memoization and Unique Object Representation for ACL2 Functions

Function Memoization and Unique Object Representation for ACL2 Functions Function Memoization and Unique Object Representation for ACL2 Functions ABSTRACT Robert S. Boyer Department of Computer Sciences The University of Texas Austin, Texas USA boyer@cs.utexas.edu We have developed

More information

Proof-Pattern Recognition and Lemma Discovery in ACL2

Proof-Pattern Recognition and Lemma Discovery in ACL2 Proof-Pattern Recognition and Lemma Discovery in ACL2 Jónathan Heras (joint work with K. Komendantskaya, M. Johansson and E. Maclean) University of Dundee http://staff.computing.dundee.ac.uk/jheras/acl2ml/

More information

An Executable Model for JFKr

An Executable Model for JFKr An Executable Model for JFKr An ACL2 approach to key-establishment protocol verification Presented by: David Rager Outline Derivation of JFKr Books developed for JFKr reasoning Demonstrate the JFKr executable

More information

Verifying Centaur s Floating Point Adder

Verifying Centaur s Floating Point Adder Verifying Centaur s Floating Point Adder Sol Swords sswords@cs.utexas.edu April 23, 2008 Sol Swords () Verifying Centaur s Floating Point Adder April 23, 2008 1 / 21 Problem Given: Verilog RTL for the

More information

Lecture Notes on Lisp A Brief Introduction

Lecture Notes on Lisp A Brief Introduction Why Lisp? Lecture Notes on Lisp A Brief Introduction Because it s the most widely used AI programming language Because Prof Peng likes using it Because it s good for writing production software (Graham

More information

A Mechanically Checked Proof of the Correctness of the Boyer-Moore Fast String Searching Algorithm

A Mechanically Checked Proof of the Correctness of the Boyer-Moore Fast String Searching Algorithm A Mechanically Checked Proof of the Correctness of the Boyer-Moore Fast String Searching Algorithm J Strother MOORE a,1 and Matt MARTINEZ a a Department of Computer Sciences, University of Texas at Austin,

More information

by the evening of Tuesday, Feb 6

by the evening of Tuesday, Feb 6 Homework 1 Due 14 February Handout 6 CSCI 334: Spring 2018 Notes This homework has three types of problems: Self Check: You are strongly encouraged to think about and work through these questions, and

More information

Parameterized Congruences in ACL2

Parameterized Congruences in ACL2 Parameterized Congruences in ACL2 David Greve Rockwell Collins Advanced Technology Center Cedar Rapids, IA dagreve@rockwellcollins.com ABSTRACT Support for congruence-based rewriting is built into ACL2.

More information

Environments

Environments Environments PLAI Chapter 6 Evaluating using substitutions is very inefficient To work around this, we want to use a cache of substitutions. We begin evaluating with no cached substitutions, then collect

More information

LISP. Everything in a computer is a string of binary digits, ones and zeros, which everyone calls bits.

LISP. Everything in a computer is a string of binary digits, ones and zeros, which everyone calls bits. LISP Everything in a computer is a string of binary digits, ones and zeros, which everyone calls bits. From one perspective, sequences of bits can be interpreted as a code for ordinary decimal digits,

More information

Artificial Intelligence Programming

Artificial Intelligence Programming Artificial Intelligence Programming Rob St. Amant Department of Computer Science North Carolina State University Lisp basics NC State University 2 / 99 Why Lisp? Some recent Lisp success stories include

More information

SCHEME 8. 1 Introduction. 2 Primitives COMPUTER SCIENCE 61A. March 23, 2017

SCHEME 8. 1 Introduction. 2 Primitives COMPUTER SCIENCE 61A. March 23, 2017 SCHEME 8 COMPUTER SCIENCE 61A March 2, 2017 1 Introduction In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write Scheme programs,

More information

Vanilla Lisp Shell (VLS)

Vanilla Lisp Shell (VLS) Vanilla Lisp Shell (VLS) Copyright c 2001 William Paul Vrotney i Table of Contents 1 Introduction............................... 2 2 Notation Conventions...................... 3 3 Getting Started............................

More information

CS 842 Ben Cassell University of Waterloo

CS 842 Ben Cassell University of Waterloo CS 842 Ben Cassell University of Waterloo Recursive Descent Re-Cap Top-down parser. Works down parse tree using the formal grammar. Built from mutually recursive procedures. Typically these procedures

More information

An ACL2 Tutorial. Matt Kaufmann and J Strother Moore

An ACL2 Tutorial. Matt Kaufmann and J Strother Moore An ACL2 Tutorial Matt Kaufmann and J Strother Moore Department of Computer Sciences, University of Texas at Austin, Taylor Hall 2.124, Austin, Texas 78712 {kaufmann,moore}@cs.utexas.edu Abstract. We describe

More information

(defmacro while (condition &body body) `(iterate loop () (if,condition (loop)))))

(defmacro while (condition &body body) `(iterate loop () (if,condition (loop))))) ; PARCIL - A Parser for C syntax In Lisp version 0.1a copyright (c) 1992 by Erann Gat, all rights reserved This program is free software; you can redistribute it and/or modify it under the terms of the

More information

Reasoning about copydata

Reasoning about copydata Reasoning about copydata Yet Another Account of a Proof of Correctness of an x86 Machine-Code Program Shilpi Goel ACL2 Seminar 19th October, 2015 Quick Background This talk is about machine-code program

More information

SCHEME The Scheme Interpreter. 2 Primitives COMPUTER SCIENCE 61A. October 29th, 2012

SCHEME The Scheme Interpreter. 2 Primitives COMPUTER SCIENCE 61A. October 29th, 2012 SCHEME COMPUTER SCIENCE 6A October 29th, 202 In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write Scheme programs, we will eventually

More information

INF4820. Common Lisp: Closures and Macros

INF4820. Common Lisp: Closures and Macros INF4820 Common Lisp: Closures and Macros Erik Velldal University of Oslo Oct. 19, 2010 Erik Velldal INF4820 1 / 22 Topics for Today More Common Lisp A quick reminder: Scope, binding and shadowing Closures

More information

Allegro CL Certification Program

Allegro CL Certification Program Allegro CL Certification Program Lisp Programming Series Level I Presented by 1 About David Margolies Manager, Documentation, Franz Inc Been working with Lisp since 1984 dm@franz.com 2 About Franz Inc.

More information

Introduction to ACL2. CS 680 Formal Methods for Computer Verification. Jeremy Johnson Drexel University

Introduction to ACL2. CS 680 Formal Methods for Computer Verification. Jeremy Johnson Drexel University Introduction to ACL2 CS 680 Formal Methods for Computer Verification Jeremy Johnson Drexel University ACL2 www.cs.utexas.edu/~moore/acl2 ACL2 is a programming language, logic, and theorem prover/checker

More information

An Industrially Useful Prover

An Industrially Useful Prover An Industrially Useful Prover J Strother Moore Department of Computer Science University of Texas at Austin July, 2017 1 Recap Yesterday s Talk: ACL2 is used routinely in the microprocessor industry to

More information

Common LISP-Introduction

Common LISP-Introduction Common LISP-Introduction 1. The primary data structure in LISP is called the s-expression (symbolic expression). There are two basic types of s-expressions: atoms and lists. 2. The LISP language is normally

More information

Proving Theorems about Java and the JVM

Proving Theorems about Java and the JVM Proving Theorems about Java and the JVM with ACL2 J Strother Moore Department of Computer Sciences, University of Texas at Austin, Taylor Hall 2.124, Austin, Texas 78712 DRAFT June 16, 2002 Abstract. We

More information

1. Allowed you to see the value of one or more variables, or 2. Indicated where you were in the execution of a program

1. Allowed you to see the value of one or more variables, or 2. Indicated where you were in the execution of a program CS0449 GDB Lab What is a debugger? A debugger is a program that helps you find logical mistakes in your programs by running them in a controlled way. Undoubtedly by this point in your programming life,

More information

Spring 2018 Discussion 7: March 21, Introduction. 2 Primitives

Spring 2018 Discussion 7: March 21, Introduction. 2 Primitives CS 61A Scheme Spring 2018 Discussion 7: March 21, 2018 1 Introduction In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write Scheme

More information

Fall 2017 Discussion 7: October 25, 2017 Solutions. 1 Introduction. 2 Primitives

Fall 2017 Discussion 7: October 25, 2017 Solutions. 1 Introduction. 2 Primitives CS 6A Scheme Fall 207 Discussion 7: October 25, 207 Solutions Introduction In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write

More information

Allegro CL Certification Program

Allegro CL Certification Program Allegro CL Certification Program Lisp Programming Series Level I Session 1.3.1 David Margolies Manipulating Lists 9/16/2010 1 What is a List? An ordered (possibly empty) collection of things in a particular

More information

Symbolic Programming. Dr. Zoran Duric () Symbolic Programming 1/ 89 August 28, / 89

Symbolic Programming. Dr. Zoran Duric () Symbolic Programming 1/ 89 August 28, / 89 Symbolic Programming Symbols: +, -, 1, 2 etc. Symbolic expressions: (+ 1 2), (+ (* 3 4) 2) Symbolic programs are programs that manipulate symbolic expressions. Symbolic manipulation: you do it all the

More information

Reasoning About Programs Panagiotis Manolios

Reasoning About Programs Panagiotis Manolios Reasoning About Programs Panagiotis Manolios Northeastern University April 2, 2016 Version: 95 Copyright c 2016 by Panagiotis Manolios All rights reserved. We hereby grant permission for this publication

More information

Basics of Using Lisp! Gunnar Gotshalks! BLU-1

Basics of Using Lisp! Gunnar Gotshalks! BLU-1 Basics of Using Lisp BLU-1 Entering Do Lisp work Exiting Getting into and out of Clisp % clisp (bye)» A function with no arguments» CTRL d can also be used Documentation files are in the directory» /cse/local/doc/clisp

More information

UMBC CMSC 331 Final Exam

UMBC CMSC 331 Final Exam UMBC CMSC 331 Final Exam Name: UMBC Username: You have two hours to complete this closed book exam. We reserve the right to assign partial credit, and to deduct points for answers that are needlessly wordy

More information

Emacs: Editing, Writing and Programming

Emacs: Editing, Writing and Programming Emacs: Editing, Writing and Programming KOM Computer Workshop help@kom.auc.dk Release 1.20 September 30, 2001 1 Introduction Editing of text is probably one the functions you will need the most from the

More information

Efficient, Formally Verifiable Data Structures using ACL2 Single-Threaded Objects for High-Assurance Systems

Efficient, Formally Verifiable Data Structures using ACL2 Single-Threaded Objects for High-Assurance Systems Efficient, Formally Verifiable Data Structures using ACL2 Single-Threaded Objects for High-Assurance Systems David Hardin Rockwell Collins Samuel Hardin Iowa State University Introduction Bounded versions

More information

c constructor P, Q terms used as propositions G, H hypotheses scope identifier for a notation scope M, module identifiers t, u arbitrary terms

c constructor P, Q terms used as propositions G, H hypotheses scope identifier for a notation scope M, module identifiers t, u arbitrary terms Coq quick reference Meta variables Usage Meta variables Usage c constructor P, Q terms used as propositions db identifier for a hint database s string G, H hypotheses scope identifier for a notation scope

More information

Coq quick reference. Category Example Description. Inductive type with instances defined by constructors, including y of type Y. Inductive X : Univ :=

Coq quick reference. Category Example Description. Inductive type with instances defined by constructors, including y of type Y. Inductive X : Univ := Coq quick reference Category Example Description Meta variables Usage Meta variables Usage c constructor P, Q terms used as propositions db identifier for a hint database s string G, H hypotheses scope

More information

A Library For Hardware Verification

A Library For Hardware Verification Computational Logic, Inc. August 19, 1988 A Library For Hardware Verification Bill Bevier 1. Introduction This note describes the library of Boyer-Moore events which I have been working on for the last

More information

Debugging in LISP. trace causes a trace to be printed for a function when it is called

Debugging in LISP. trace causes a trace to be printed for a function when it is called trace causes a trace to be printed for a function when it is called ;;; a function that works like reverse (defun rev (list) (cons (first (last list)) (rev (butlast list)))) USER: (trace rev) ; note trace

More information

Common LISP Tutorial 1 (Basic)

Common LISP Tutorial 1 (Basic) Common LISP Tutorial 1 (Basic) CLISP Download https://sourceforge.net/projects/clisp/ IPPL Course Materials (UST sir only) Download https://silp.iiita.ac.in/wordpress/?page_id=494 Introduction Lisp (1958)

More information

Project 5 - The Meta-Circular Evaluator

Project 5 - The Meta-Circular Evaluator MASSACHVSETTS INSTITVTE OF TECHNOLOGY Department of Electrical Engineering and Computer Science 6.001 Structure and Interpretation of Computer Programs Fall Semester, 2005 Project 5 - The Meta-Circular

More information

April 2 to April 4, 2018

April 2 to April 4, 2018 MORE SCHEME COMPUTER SCIENCE MENTORS 61A April 2 to April 4, 2018 1 Scheme 1. What will Scheme output? Draw box-and-pointer diagrams to help determine this. (a) (cons (cons 1 nil) (cons 2 (cons (cons 3

More information

Documentation for LISP in BASIC

Documentation for LISP in BASIC Documentation for LISP in BASIC The software and the documentation are both Copyright 2008 Arthur Nunes-Harwitt LISP in BASIC is a LISP interpreter for a Scheme-like dialect of LISP, which happens to have

More information

Compositional Cutpoint Verification

Compositional Cutpoint Verification Compositional Cutpoint Verification Eric Smith (Stanford University) Collaborators: David Dill (Stanford University) David Hardin (Rockwell Collins) Contact ewsmith@stanford.edu Background Based on A Symbolic

More information

Functions, Conditionals & Predicates

Functions, Conditionals & Predicates Functions, Conditionals & Predicates York University Department of Computer Science and Engineering 1 Overview Functions as lambda terms Defining functions Variables (bound vs. free, local vs. global)

More information

An Overview of the DE Hardware Description Language and Its Application in Formal Verification of the FM9001 Microprocessor

An Overview of the DE Hardware Description Language and Its Application in Formal Verification of the FM9001 Microprocessor An Overview of the DE Hardware Description Language and Its Application in Formal Verification of the FM9001 Microprocessor Cuong Chau ckcuong@cs.utexas.edu Department of Computer Science The University

More information

Mathematica for the symbolic. Combining ACL2 and. ACL2 Workshop 2003 Boulder,CO. TIMA Laboratory -VDS Group, Grenoble, France

Mathematica for the symbolic. Combining ACL2 and. ACL2 Workshop 2003 Boulder,CO. TIMA Laboratory -VDS Group, Grenoble, France Combining ACL2 and Mathematica for the symbolic simulation of digital systems AL SAMMANE Ghiath, BORRIONE Dominique, OSTIER Pierre, SCHMALTZ Julien, TOMA Diana TIMA Laboratory -VDS Group, Grenoble, France

More information

Project 5 - The Meta-Circular Evaluator

Project 5 - The Meta-Circular Evaluator MASSACHVSETTS INSTITVTE OF TECHNOLOGY Department of Electrical Engineering and Computer Science 6.001 Structure and Interpretation of Computer Programs Spring Semester, 2005 Project 5 - The Meta-Circular

More information

An Explicit Continuation Evaluator for Scheme

An Explicit Continuation Evaluator for Scheme Massachusetts Institute of Technology Course Notes 2 6.844, Spring 05: Computability Theory of and with Scheme February 17 Prof. Albert R. Meyer revised March 3, 2005, 1265 minutes An Explicit Continuation

More information

;;; Determines if e is a primitive by looking it up in the primitive environment. ;;; Define indentation and output routines for the output for

;;; Determines if e is a primitive by looking it up in the primitive environment. ;;; Define indentation and output routines for the output for Page 1/11 (require (lib "trace")) Allow tracing to be turned on and off (define tracing #f) Define a string to hold the error messages created during syntax checking (define error msg ""); Used for fancy

More information

CONTENTS defstructure CONTENTS Contents 1 Introduction 3 2 User's Guide Basic Use Typed Structur

CONTENTS defstructure CONTENTS Contents 1 Introduction 3 2 User's Guide Basic Use Typed Structur defstructure for ACL2 Version 2.0 Bishop Brock Computational Logic, Inc. brock@cli.com December 1, 1997 Abstract This article documents the defstructure macro, a facility provided by the ACL2 book acl2-sources/books/data-structures/structures.lisp

More information

ACT-R 6.0 Software Updates Summer 08 Summer 09. Dan Bothell Carnegie Mellon University

ACT-R 6.0 Software Updates Summer 08 Summer 09. Dan Bothell Carnegie Mellon University ACT-R 6.0 Software Updates Summer 08 Summer 09 Dan Bothell Carnegie Mellon University db30@andrew.cmu.edu Overview Updates and changes over the past year Documentation Extras Environment New functionality

More information

A LISP Interpreter in ML

A LISP Interpreter in ML UNIVERSITY OF OSLO Department of Informatics A LISP Interpreter in ML Mandatory Assignment 1 INF3110 September 21, 2009 Contents 1 1 Introduction The purpose of this assignment is to write an interpreter,

More information

A guided tour of hydra.el

A guided tour of hydra.el A guided tour of hydra.el Oleh Krehel 2017-07-24 Oleh Krehel A guided tour of hydra.el 2017-07-24 1 / 12 hydra.el - Make bindings that stick around. A package for GNU Emacs that can be used to tie related

More information

Administrivia. Simple data types

Administrivia. Simple data types Administrivia Lists, higher order procedures, and symbols 6.037 - Structure and Interpretation of Computer Programs Mike Phillips (mpp) Massachusetts Institute of Technology Project 0 was due today Reminder:

More information

Copyright. David Lawrence Rager

Copyright. David Lawrence Rager Copyright by David Lawrence Rager 2008 Implementing a Parallelism Library for ACL2 in Modern Day LISPs by David Lawrence Rager, B.B.A Thesis Presented to the Faculty of the Graduate School of The University

More information

Introduction. hashing performs basic operations, such as insertion, better than other ADTs we ve seen so far

Introduction. hashing performs basic operations, such as insertion, better than other ADTs we ve seen so far Chapter 5 Hashing 2 Introduction hashing performs basic operations, such as insertion, deletion, and finds in average time better than other ADTs we ve seen so far 3 Hashing a hash table is merely an hashing

More information

CS/COE 0449 term 2174 Lab 5: gdb

CS/COE 0449 term 2174 Lab 5: gdb CS/COE 0449 term 2174 Lab 5: gdb What is a debugger? A debugger is a program that helps you find logical mistakes in your programs by running them in a controlled way. Undoubtedly by this point in your

More information

A verified runtime for a verified theorem prover

A verified runtime for a verified theorem prover A verified runtime for a verified theorem prover Magnus Myreen 1 and Jared Davis 2 1 University of Cambridge, UK 2 Centaur Technology, USA Two projects meet My theorem prover is written in Lisp. Can I

More information

Efficient execution in an automated reasoning environment

Efficient execution in an automated reasoning environment JFP 18 (1): 15 46, 2008. c 2007 Cambridge University Press doi:10.1017/s0956796807006338 First published online 23 April 2007 Printed in the United Kingdom 15 Efficient execution in an automated reasoning

More information

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division Fall, 2001 Prof. R. Fateman SUGGESTED S CS 164 Final Examination: December 18, 2001, 8-11AM

More information

Software Manual for Windows Z/EVES Version 2.3

Software Manual for Windows Z/EVES Version 2.3 Software Manual for Windows Z/EVES Version 2.3 TR-97-5505-04h Irwin Meisels Release date: June 2004 ORA Canada P.O. Box 46005, 2339 Ogilvie Rd. Ottawa, Ontario K1J 9M7 CANADA c ORA Canada (1996,1997,1999,

More information

Bit-Blasting ACL2 Theorems

Bit-Blasting ACL2 Theorems Bit-Blasting ACL2 Theorems Sol Swords and Jared Davis Centaur Technology Inc. 7600-C N. Capital of Texas Hwy, Suite 300 Austin, TX 78731 {sswords,jared}@centtech.com Interactive theorem proving requires

More information

Unit 1: Understanding Production Systems

Unit 1: Understanding Production Systems Unit 1: Understanding Production Systems Section 1.1: The ACT-R Production System ACT-R is a production system theory that tries to explain human cognition by developing a model of the knowledge structures

More information

Write a procedure powerset which takes as its only argument a set S and returns the powerset of S.

Write a procedure powerset which takes as its only argument a set S and returns the powerset of S. Answers to CS61 A Final of May 23, 1997 We repeat the questions; some have typos corrected with respect to the actual exam handed out. Question 1 (5 points): Let us represent a set S of unique expressions,

More information

Indium Documentation. Release Nicolas Petton

Indium Documentation. Release Nicolas Petton Indium Documentation Release 1.2.0 Nicolas Petton Nov 23, 2018 Contents 1 Table of contents 3 1.1 Installation................................................ 3 1.2 Getting up and running..........................................

More information

Scheme Quick Reference

Scheme Quick Reference Scheme Quick Reference COSC 18 Winter 2003 February 10, 2003 1 Introduction This document is a quick reference guide to common features of the Scheme language. It is by no means intended to be a complete

More information

Well-Formedness Guarantees for ACL2 Metafunctions and Clause Processors

Well-Formedness Guarantees for ACL2 Metafunctions and Clause Processors Well-Formedness Guarantees for ACL2 Metafunctions and Clause Processors Matt Kaufmann and J Strother Moore Department of Computer Science University of Texas at Austin email:{kaufmann,moore}@cs.utexas.edu

More information

CIS4/681 { Articial Intelligence 2 > (insert-sort '( )) ( ) 2 More Complicated Recursion So far everything we have dened requires

CIS4/681 { Articial Intelligence 2 > (insert-sort '( )) ( ) 2 More Complicated Recursion So far everything we have dened requires 1 A couple of Functions 1 Let's take another example of a simple lisp function { one that does insertion sort. Let us assume that this sort function takes as input a list of numbers and sorts them in ascending

More information

CSCI 2210: Programming in Lisp. Progn. Block. CSCI Programming in Lisp; Instructor: Alok Mehta 1. ANSI Common Lisp, Chapters 5-10

CSCI 2210: Programming in Lisp. Progn. Block. CSCI Programming in Lisp; Instructor: Alok Mehta 1. ANSI Common Lisp, Chapters 5-10 CSCI 2210: Programming in Lisp ANSI Common Lisp, Chapters 5-10 CSCI 2210 - Programming in Lisp; Instructor: Alok Mehta; 4.ppt 1 Progn Progn Creates a block of code Expressions in body are evaluated Value

More information

Question Score Points Out Of 25

Question Score Points Out Of 25 University of Texas at Austin 6 May 2005 Department of Computer Science Theory in Programming Practice, Spring 2005 Test #3 Instructions. This is a 50-minute test. No electronic devices (including calculators)

More information

Chapter 5 Hashing. Introduction. Hashing. Hashing Functions. hashing performs basic operations, such as insertion,

Chapter 5 Hashing. Introduction. Hashing. Hashing Functions. hashing performs basic operations, such as insertion, Introduction Chapter 5 Hashing hashing performs basic operations, such as insertion, deletion, and finds in average time 2 Hashing a hash table is merely an of some fixed size hashing converts into locations

More information

Introduction 2 Lisp Part I

Introduction 2 Lisp Part I Introduction 2 Lisp Part I Andreas Wichert LEIC-T (Página da cadeira: Fenix) Corpo docente n Andreas (Andrzej) Wichert Praticas n andreas.wichert@tecnico.ulisboa.pt n tel: 214233231 n room: N2 5-7 n http://web.tecnico.ulisboa.pt/andreas.wichert/

More information

This should prevent residual sexism, racism, favoritism lurking in the unconscious of your professor & TA from biasing grading!!

This should prevent residual sexism, racism, favoritism lurking in the unconscious of your professor & TA from biasing grading!! NAME login: Signature: Computer Science and Engineering 150 Programming Languages for Artificial Intelligence Tuesday, November 5, 2002: DON T FORGET TO VOTE!!! FIRST MIDTERM EXAM DO NOT TURN THIS PAGE

More information