File: package.lsp

package info (click to toggle)
acl2 8.3dfsg-2
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 309,408 kB
  • sloc: lisp: 3,311,842; javascript: 22,569; cpp: 9,029; ansic: 7,872; perl: 6,501; xml: 3,838; java: 3,738; makefile: 3,383; ruby: 2,633; sh: 2,489; ml: 763; python: 741; yacc: 721; awk: 260; csh: 186; php: 171; lex: 154; tcl: 49; asm: 23; haskell: 17
file content (441 lines) | stat: -rw-r--r-- 12,037 bytes parent folder | download | duplicates (2)
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
; ACL2 Standard Library
; Copyright (c) 2008-2014 Centaur Technology
;
; Contact:
;   Centaur Technology Formal Verification Group
;   7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA.
;   http://www.centtech.com/
;
; License: (An MIT/X11-style license)
;
;   Permission is hereby granted, free of charge, to any person obtaining a
;   copy of this software and associated documentation files (the "Software"),
;   to deal in the Software without restriction, including without limitation
;   the rights to use, copy, modify, merge, publish, distribute, sublicense,
;   and/or sell copies of the Software, and to permit persons to whom the
;   Software is furnished to do so, subject to the following conditions:
;
;   The above copyright notice and this permission notice shall be included in
;   all copies or substantial portions of the Software.
;
;   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
;   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
;   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
;   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
;   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
;   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;   DEALINGS IN THE SOFTWARE.
;
; Original author: Jared Davis <jared@centtech.com>

(in-package "ACL2")

; The following comment line tells the build system that if *acl2-exports*
; changes, then every book that uses this file should be recertified:
; (depends-on "build/acl2-exports.certdep" :dir :system)

(defconst *standard-acl2-imports*
  (set-difference-eq-exec
   (union-eq-exec (append
                   '(;; Some symbols ought to be included but aren't.
                     print-base-p
                     )
                   *acl2-exports*)
                  *common-lisp-symbols-from-main-lisp-package*)
   '(
     ;; Various string functions have nasty standard-char-p guards.  We remove
     ;; them from our packages because we don't want to accidentally try to use
     ;; them.  We especially want to keep these out of the STR package.
     upper-case-p
     lower-case-p
     char-upcase
     char-downcase
     string-upcase1
     string-downcase1
     string-upcase
     string-downcase

     ;; Various nice names have problematic definitions in Common Lisp and so
     ;; they are not ACL2 functions.  But that's no reason to import them into
     ;; our own packages.
     union
     delete
     find
     map
     set
     byte
     read
     write

     ;; Matt K. mod: rewrite-equiv was added 3/2020 to *acl2-exports but had
     ;; that addition caused the event (defprod rewrite ...) to fail in
     ;; centaur/meta/parse-rewrite.lisp; so we exclude that symbol here.
     rewrite-equiv
     )))

(defpkg "STR"
  (append '(simpler-take list-fix list-equiv rev
                         prefixp str b* assert! repeat replicate
                         listpos sublistp implode explode
                         a b c d e f g h i j k l m n o p q r s v x y z
                         top
                         defxdoc defsection lnfix definlined definline
                         define defines defaggregate
                         char-fix chareqv
                         str-fix streqv
                         raise
                         std
                         std/strings)
          *standard-acl2-imports*))

; Packages for the ordered sets library.  We should probably consolidate this
; stuff into the sets package, eventually.

(defpkg "INSTANCE" *standard-acl2-imports*)

(defpkg "COMPUTED-HINTS"
  (append '(mfc-ancestors
            mfc-clause
            INSTANCE::instance-rewrite)
          *standard-acl2-imports*))

(defpkg "SET"
  (append '(defsection
             defxdoc
             definline
             definlined
             lexorder
             lnfix
             <<
             <<-irreflexive
             <<-transitive
             <<-asymmetric
             <<-trichotomy
             <<-implies-lexorder
             fast-<<
             fast-lexorder
             COMPUTED-HINTS::rewriting-goal-lit
             COMPUTED-HINTS::rewriting-conc-lit
             def-ruleset
             def-ruleset!
             add-to-ruleset
             ;; makes :instance hints more convenient
             a b c d e f g h i j k l m n o p q r s t u v w x y z
             ;; for nicer (package-free) documentation links
             std/osets
             std)
          (set-difference-eq-exec
           *standard-acl2-imports*
           ;; [Changed by Matt K. to handle changes to member, assoc,
           ;;  etc. after ACL2 4.2 (intersectp was added to *acl2-exports*).]
           '(intersectp enable disable e/d))))

#!SET
(defconst *sets-exports*
  ;; This just contains the user-level set functions, and a couple of theroems
  ;; that frequently need to be enabled/disabled.
  '(<<
    setp
    empty
    sfix
    head
    tail
    insert
    in
    subset
    delete
    union
    intersect
    ;; intersectp -- we leave this out because of the existing ACL2 function
    ;; called intersectp.
    difference
    cardinality
    mergesort
    ;; A couple of theorems that frequently need to be enabled/disabled.
    double-containment
    pick-a-point-subset-strategy
    ))

(defpkg "XDOC"
  (append '(b* value defxdoc defxdoc-raw macro-args
               defpointer
               xdoc-extend defsection defsection-progn lnfix
               set-default-parents
               getprop formals justification def-bodies current-acl2-world def-body
               access theorem untranslated-theorem guard xdoc xdoc! unquote
               undocumented assert! top explode implode
               remove-equal-with-hint)
          set::*sets-exports*
          *standard-acl2-imports*))

(defconst *bitset-exports*
  '(bitsets
    bitset-singleton
    bitset-insert
    bitset-list
    bitset-list*
    bitset-delete
    bitset-union
    bitset-intersect
    bitset-difference
    bitset-memberp
    bitset-intersectp
    bitset-subsetp
    bitset-cardinality
    bitset-members

    equal-bitsets-by-membership
    bitset-witnessing
    bitset-equal-witnessing
    bitset-equal-instancing
    bitset-equal-example
    bitset-fns

    sbitsets
    sbitsetp
    sbitset-fix
    sbitset-members
    sbitset-singleton
    sbitset-union
    sbitset-intersect
    sbitset-difference
    ))

(defconst *bitsets-pkg-symbols*
  (append '(*bitset-exports*
            std
            std/util
            std/bitsets
            std/osets
            __function__
            raise
            define
            defines
            defrule
            rule
            defsection
            defxdoc
            defwitness
            definstantiate
            defexample
            include-raw
            witness
            xdoc
            assert!
            b*
            progn$

            enable*
            disable*
            e/d*
            set::enable
            set::disable
            set::e/d

            rev

            arith-equiv-forwarding
            lnfix
            lifix
            lbfix
            nat-equiv
            int-equiv

            logbitp-mismatch
            equal-by-logbitp
            logbitp-hyp
            logbitp-lhs
            logbitp-rhs

            a b c d e f g h i j k l m n o p q r s t u v w x y z
            )
          set::*sets-exports*
          *bitset-exports*
          (set-difference-eq-exec *standard-acl2-imports*
                                  '(intersectp enable disable e/d))))

(defpkg "BITSETS" *bitsets-pkg-symbols*)

(defconst *std-pkg-symbols*
  (append set::*sets-exports*

; Things I want to "export" to the ACL2 package.
;
; Should we export deflist, defalist, etc.?  On one hand, it would be nice NOT
; to export them since this makes these parts of the std library incompatible
; with books like data-structures/deflist.  On the other hand, it is ugly to
; type (std::deflist ...) instead of just deflist.
;
; I've gone back and forth on it.  I guess exporting them is bad.  I'll
; continue to export defsection and defmvtypes since they're unusually named
; and convenient, but for consistency all of the data-type introduction macros
; will be kept in the std package.

    '(std ; Makes ":xdoc std" do the right thing.
      std/util ;; likewise


      __function__
      raise
      tag
      tag-reasoning
      defsection
      defsection-progn
      defmvtypes
      rule
      defrule
      defruled
      defruledl
      defrulel
      define
      defines
      defconsts
      defval
      more-returns
      defret
      xdoc
;               defaggregate
;               defenum
;               defprojection
;               defmapappend
;               defalist
;               deflist

      ;; Things I want to "import" from ACL2 into the STD package.
      assert!
      must-fail
      b*
      ret
      def-b*-binder
      progn$
      simpler-take
      repeat
      replicate
      list-fix
      llist-fix
      rev
      rcons
      revappend-without-guard
      value
      two-nats-measure
      make-fal
      xdoc-extend
      legal-variablep
      set-equiv
      list-equiv
      never-memoize

      ;; BOZO consider moving these to std?
      defconsts
      definline
      definlined

      ;; BOZO why aren't these imported?
      strip-cadrs
      defxdoc

      uniquep
      duplicated-members

      alists-agree
      alist-keys
      alist-vals
      alist-equiv
      sub-alistp
      hons-rassoc-equal

      def-ruleset
      def-ruleset!
      add-to-ruleset
      add-to-ruleset!
      get-ruleset
      ruleset-theory

      ;; Stuff I moved into xdoc:
      xdoc::extract-keyword-from-args
      xdoc::throw-away-keyword-parts
      xdoc::mksym
      xdoc::mksym-package-symbol
      undocumented
      )
    *standard-acl2-imports*))

(defpkg "STD" *std-pkg-symbols*)

#!STD
(defconst *std-exports*
  '(std
    tag
    ret
    tag-reasoning
    defprojection
    deflist
    defalist
    defenum
    defaggregate
    defmapappend
    defmvtypes
    defsection
    defsection-progn
    defsum
    define
    defines
    rule
    defrule
    defruled
    defruledl
    defrulel
    defval
    defret
    defretd
    defconsts
    defxdoc
    raise
    __function__
    more-returns))

(assign acl2::verbose-theory-warning nil)

(defconst *stobjs-exports*
  ;; Things we want to "export" to the ACL2 package or other packages
  '(defabsstobj-events
    def-1d-arr
    def-2d-arr
    def-updater-independence-thm
    defstobj-clone
    new old))

(defpkg "STOBJS"
  (append '(
            ;; More things we want to import from the ACL2 package, because we're
            ;; going to use them internally
            *stobjs-exports*
            b* template-subst
            defmacfun deffunmac def-universal-equiv
            bit-equiv bfix bfix$inline
            enable* disable* e/d* e/d**
            def-ruleset def-ruleset! add-to-ruleset add-to-ruleset!
            arith-equiv-forwarding
            lnfix lifix lbfix nat-equiv int-equiv bit-equiv
            ;; for better documentation
            stobj stobjs abstract-stobj congruence equivalence bitarr
            std/stobjs
            )
          *stobjs-exports*
          std::*std-exports*
          *standard-acl2-imports*))

(defpkg "FLAG"
  (append '(getprop access def-body justification current-acl2-world
                    formals recursivep def-bodies
                    make-flag flag-present flag-fn-name flag-alist
                    flag-defthm-macro
                    flag-equivs-name
                    std::expand-calls-computed-hint
                    std::find-calls-of-fns-term
                    std::find-calls-of-fns-list
                    defxdoc defsection
                    b*
                    )
          (set-difference-eq acl2::*standard-acl2-imports*
                             '(id))))