File: constants-that-require-modifying-state.lisp

package info (click to toggle)
acl2 8.6%2Bdfsg-2
  • links: PTS
  • area: main
  • in suites: trixie
  • size: 1,111,420 kB
  • sloc: lisp: 17,818,294; java: 125,359; python: 28,122; javascript: 23,458; cpp: 18,851; ansic: 11,569; perl: 7,678; xml: 5,591; sh: 3,976; makefile: 3,833; ruby: 2,633; yacc: 1,126; ml: 763; awk: 295; csh: 233; lex: 197; php: 178; tcl: 49; asm: 23; haskell: 17
file content (26 lines) | stat: -rw-r--r-- 1,156 bytes parent folder | download | duplicates (8)
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
(in-package "ACL2")

; One may wish to modify state when defining constants inside a book.  This is
; particularly useful when such modification of state empowers one to do things
; like read from a file.  This example doesn't even modify state, but since foo
; returns the ACL2 state, foo could do so.  Thus, it demonstrates the idea.

; Note that this file has nothing to do with trust tags, which was my original
; intention.  The user that is interested in permitting trust tags during the
; first pass of certification but not the second pass should see ACL2
; documentation topic "set-write-acl2x" and book
; "make-event/double-cert-test-1.lisp".

(include-book "std/util/defconsts" :dir :system)

(defun foo (state)
  (declare (xargs :stobjs (state)
                  :verify-guards nil))
  (progn$ (cw "==========================================================~%")
          (cw "Running foo.~%")
          (cw "This should only print during certification.~%")
          (cw "==========================================================~%")
          (mv (f-get-global 'waterfall-parallelism state) state)))

(defconsts (*foo* state)
  (foo state))