Filtering...

boot-strap-pass-2-b

boot-strap-pass-2-b
other
(in-package "ACL2")
other
(verify-termination-boot-strap +f!-fn2$inline)
other
(verify-termination-boot-strap +f!-fn3$inline)
other
(verify-termination-boot-strap safe-access-command-tuple-form)
other
(verify-termination-boot-strap acl2-system-namep)
system-pseudo-termpmutual-recursion
(mutual-recursion (defun system-pseudo-termp
    (x w)
    (declare (xargs :guard (and (pseudo-termp x) (plist-worldp w))
        :mode :logic))
    (cond ((atom x) (symbolp x))
      ((eq (car x) 'quote) (and (consp (cdr x)) (null (cdr (cdr x)))))
      ((not (true-listp x)) nil)
      ((not (system-pseudo-term-listp (cdr x) w)) nil)
      (t (if (symbolp (car x))
          (acl2-system-namep (car x) w)
          (system-pseudo-termp (caddr (car x)) w)))))
  (defun system-pseudo-term-listp
    (lst w)
    (declare (xargs :guard (and (pseudo-term-listp lst) (plist-worldp w))
        :mode :logic))
    (cond ((atom lst) (equal lst nil))
      (t (and (system-pseudo-termp (car lst) w)
          (system-pseudo-term-listp (cdr lst) w))))))
pair-fns-with-measured-subsetsfunction
(defun pair-fns-with-measured-subsets
  (fns wrld acc)
  (declare (xargs :guard (and (symbol-listp fns)
        (plist-worldp wrld)
        (true-listp acc))))
  (cond ((endp fns) (reverse acc))
    (t (pair-fns-with-measured-subsets (cdr fns)
        wrld
        (cons (let* ((fn (car fns)) (justification (getpropc fn 'justification nil wrld))
              (ms0 (and (weak-justification-p justification)
                  (access justification justification :measure)))
              (ms (and ms0
                  (if (and (pseudo-termp ms0) (system-pseudo-termp ms0 wrld))
                    ms0
                    (cons :? (access justification justification :subset))))))
            (cons fn ms))
          acc)))))
new-verify-guards-fns1function
(defun new-verify-guards-fns1
  (wrld installed-wrld acc)
  (declare (xargs :guard (and (plist-worldp wrld)
        (plist-worldp installed-wrld)
        (symbol-listp acc))))
  (cond ((or (endp wrld)
       (and (eq (caar wrld) 'command-landmark)
         (eq (cadar wrld) 'global-value)
         (equal (safe-access-command-tuple-form (cddar wrld))
           '(exit-boot-strap-mode)))) (pair-fns-with-measured-subsets (strict-merge-sort-symbol< acc)
        installed-wrld
        nil))
    ((and (eq (cadar wrld) 'symbol-class)
       (eq (cddar wrld) :common-lisp-compliant)
       (not (eq (caar wrld) 'do$))
       (getpropc (caar wrld) 'predefined nil installed-wrld)) (new-verify-guards-fns1 (cdr wrld)
        installed-wrld
        (cons (caar wrld) acc)))
    (t (new-verify-guards-fns1 (cdr wrld) installed-wrld acc))))
new-verify-guards-fnsfunction
(defun new-verify-guards-fns
  (state)
  (declare (xargs :stobjs state))
  (let ((wrld (w state)))
    (new-verify-guards-fns1 wrld wrld nil)))
other
(verify-termination-boot-strap logicp)
*devel-check-book*constant
(defconst *devel-check-book* "system/devel-check")
chk-new-verified-guardsmacro
(defmacro chk-new-verified-guards
  nil
  `(progn (include-book ,*DEVEL-CHECK-BOOK* :dir :system :uncertified-okp nil :defaxioms-okp nil :ttags nil)
    (assert-event (equal *system-verify-guards-alist*
        (new-verify-guards-fns state))
      :msg (msg "ERROR: The set of newly guard-verified functions from ~
                      the ACL2 community book ~x0 does not match the expected ~
                      set from the constant ~
                      *system-verify-guards-alist*.~|~%From the ~
                      book:~|~X13~|~%Expected from ~
                      *system-verify-guards-alist*:~|~X23~|"
        ,*DEVEL-CHECK-BOOK*
        (new-verify-guards-fns state)
        *system-verify-guards-alist*
        nil))
    (value-triple :chk-new-verified-guards-success)))
system-verify-guards-auxfunction
(defun system-verify-guards-aux
  (fns-alist acc acc1 old-num)
  (declare (xargs :guard (and (alistp fns-alist)
        (nat-listp (strip-cars fns-alist))
        (symbol-alistp (strip-cdrs fns-alist))
        (true-list-listp acc1))
      :ruler-extenders :lambdas))
  (let* ((num/pair (car fns-alist)) (num (car num/pair))
      (entry (cdr num/pair))
      (next (and fns-alist
          `(,(CAR ENTRY) ,@(LET ((MEASURE (CDR ENTRY)))
    (AND MEASURE `((DECLARE (XARGS :MEASURE ,MEASURE))))))))
      (same-num-p (and fns-alist (eql num old-num)))
      (acc (if (or (null acc1) same-num-p)
          acc
          (list* `(skip-proofs (verify-termination-boot-strap ,@ACC1))
            `(skip-proofs (verify-guards ,(CAAR ACC1)))
            acc))))
    (cond ((endp fns-alist) acc)
      (t (system-verify-guards-aux (cdr fns-alist)
          acc
          (if same-num-p
            (cons next acc1)
            (list next))
          num)))))
cons-absolute-event-numbersfunction
(defun cons-absolute-event-numbers
  (fns-alist wrld acc)
  (declare (xargs :guard (and (symbol-alistp fns-alist)
        (plist-worldp wrld)
        (alistp acc))))
  (cond ((endp fns-alist) acc)
    (t (cons-absolute-event-numbers (cdr fns-alist)
        wrld
        (acons (or (getpropc (caar fns-alist) 'absolute-event-number nil wrld)
            (er hard?
              'cons-absolute-event-numbers
              "The 'absolute-event-number property is missing ~
                            for ~x0."
              (caar fns-alist)))
          (car fns-alist)
          acc)))))
sort->-absolute-event-numberfunction
(defun sort->-absolute-event-number
  (fns-alist wrld)
  (declare (xargs :mode :program))
  (merge-sort-car-> (cons-absolute-event-numbers fns-alist wrld nil)))
system-verify-guardsmacro
(defmacro system-verify-guards
  (alist)
  `(make-event (let ((events (system-verify-guards-aux (sort->-absolute-event-number ,ALIST (w state))
           nil
           nil
           nil)))
      (list* 'encapsulate
        nil
        '(set-inhibit-warnings "Skip-proofs")
        '(set-verify-guards-eagerness 2)
        events))))
other
(system-verify-guards *system-verify-guards-alist-1*)
other
(verify-termination-boot-strap apply$-prim)
other
(verify-termination-boot-strap badge)
in-theory
(in-theory (disable badge (:executable-counterpart badge)))
other
(system-verify-guards *system-verify-guards-alist-2*)
system-eventmacro
(defmacro system-event (event) `(skip-proofs ,EVENT))
system-events-fnfunction
(defun system-events-fn
  (events)
  (declare (xargs :guard (true-listp events)))
  (cond ((endp events) nil)
    (t (cons `(system-event ,(CAR EVENTS))
        (system-events-fn (cdr events))))))
system-eventsmacro
(defmacro system-events
  (&rest events)
  (declare (xargs :guard t))
  (cons 'progn (system-events-fn events)))
check-system-eventsmacro
(defmacro check-system-events
  nil
  '(make-event (let ((event-book-alist (table-alist 'system-event-table (w state))))
      `(progn (include-book ,*DEVEL-CHECK-BOOK* :dir :system)
        (set-enforce-redundancy t)
        (defthm well-founded-l<
          (and (implies (lexp x) (o-p (ltoo x)))
            (implies (and (lexp x) (lexp y) (l< x y))
              (o< (ltoo x) (ltoo y))))
          :rule-classes :well-founded-relation)
        ,@(STRIP-CARS EVENT-BOOK-ALIST)
        (value-triple :check-system-events-success)))))
other
(system-events (defthm legal-variable-or-constant-namep-implies-symbolp
    (implies (not (symbolp x))
      (not (legal-variable-or-constant-namep x))))
  (in-theory (disable legal-variable-or-constant-namep))
  (defthm termp-implies-pseudo-termp
    (implies (termp x w) (pseudo-termp x))
    :rule-classes (:rewrite :forward-chaining))
  (defthm term-listp-implies-pseudo-term-listp
    (implies (term-listp x w) (pseudo-term-listp x))
    :rule-classes (:rewrite :forward-chaining))
  (defthm arities-okp-implies-arity
    (implies (and (arities-okp user-table w) (assoc fn user-table))
      (equal (arity fn w) (cdr (assoc fn user-table)))))
  (defthm arities-okp-implies-logicp
    (implies (and (arities-okp user-table w) (assoc fn user-table))
      (logicp fn w)))
  (in-theory (disable arity arities-okp logicp)))
encapsulate
(encapsulate (((brr-near-missp * * * * *) =>
     *
     :formals (msgp lemma target rcnst criteria-alist)
     :guard (and (or (weak-rewrite-rule-p lemma) (weak-linear-lemma-p lemma))
       (pseudo-termp target)
       (weak-rewrite-constant-p rcnst)
       (brr-criteria-alistp criteria-alist))))
  (local (defun brr-near-missp
      (msgp lemma target rcnst criteria-alist)
      (declare (ignore msgp lemma target rcnst criteria-alist))
      nil)))
in-theory
(in-theory (disable (:executable-counterpart tamep)
    (:executable-counterpart tamep-functionp)
    (:executable-counterpart suitably-tamep-listp)
    ev$
    ev$-list
    apply$
    (:executable-counterpart apply$)))
apply$-equivalencefunction
(defun-sk apply$-equivalence
  (fn1 fn2)
  (declare (xargs :verify-guards t :guard t))
  (forall (args)
    (equal (ec-call (apply$ fn1 args))
      (ec-call (apply$ fn2 args)))))
fn-equalfunction
(defun fn-equal
  (fn1 fn2)
  (declare (xargs :mode :logic :guard t))
  (if (equal fn1 fn2)
    t
    (and (tamep-functionp fn1)
      (tamep-functionp fn2)
      (apply$-equivalence fn1 fn2))))
other
(system-events (defequiv fn-equal :package :legacy))
other
(system-events (defthm natp-from-to-by-measure
    (natp (from-to-by-measure i j))
    :rule-classes :type-prescription))
memposfunction
(defun mempos
  (e lst)
  (declare (xargs :guard (true-listp lst)))
  (cond ((endp lst) 0)
    ((equal e (car lst)) 0)
    (t (+ 1 (mempos e (cdr lst))))))
encapsulate
(encapsulate nil
  (verify-termination-boot-strap stobj-print-name)
  (verify-termination-boot-strap eviscerate-do$-alist)
  (local (defthm nfix-list-preserves-consp
      (implies (consp x) (consp (nfix-list x)))))
  (local (defthm nat-listp-nfix-list (nat-listp (nfix-list x))))
  (verify-termination-boot-strap do$))
other
(when-pass-2 (defwarrant empty-loop$-as-tuplep)
  (defwarrant car-loop$-as-tuple)
  (defwarrant cdr-loop$-as-tuple)
  (defwarrant loop$-as-ac)
  (defwarrant loop$-as)
  (defwarrant from-to-by-measure)
  (defwarrant tails-ac)
  (defwarrant tails)
  (defwarrant from-to-by-ac)
  (defwarrant from-to-by)
  (defwarrant until$-ac)
  (defwarrant until$)
  (defwarrant until$+-ac)
  (defwarrant until$+)
  (defwarrant when$-ac)
  (defwarrant when$)
  (defwarrant when$+-ac)
  (defwarrant when$+)
  (defwarrant sum$-ac)
  (defwarrant sum$)
  (defwarrant sum$+-ac)
  (defwarrant sum$+)
  (defwarrant always$)
  (defwarrant always$+)
  (defwarrant thereis$)
  (defwarrant thereis$+)
  (defwarrant collect$-ac)
  (defwarrant collect$)
  (defwarrant collect$+-ac)
  (defwarrant collect$+)
  (defwarrant append$-ac)
  (defwarrant append$)
  (defwarrant append$+-ac)
  (defwarrant append$+)
  (defwarrant mempos)
  (defwarrant d<)
  (defwarrant l<)
  (defwarrant nfix-list)
  (defwarrant lex-fix)
  (defwarrant lexp)
  (defwarrant stobj-print-name)
  (defwarrant eviscerate-do$-alist)
  (defwarrant loop$-default-values1)
  (defwarrant loop$-default-values)
  (defwarrant do$))
other
(progn (memoize 'fchecksum-obj :stats nil :forget t)
  (memoize 'immediate-canonical-ancestors :stats nil)
  (memoize 'canonical-ancestors-rec :stats nil)
  (memoize 'immediate-canonical-ancestors-tr :stats nil)
  (memoize 'canonical-ancestors-tr-rec :stats nil)
  (memoize 'canonical-ancestors-path :stats nil)
  (memoize 'canonical-ancestors-tr-path :stats nil))
defdeprecatemacro
(defmacro defdeprecate
  (old new version)
  (declare (type string version))
  `(progn (defmacro ,OLD
      (&rest args)
      (prog2$ (cw "~%**DEPRECATED** after ACL2 Version ~s0: ~x1.  Use ~x2 instead.~|"
          ,VERSION
          ',OLD
          ',NEW)
        (cons ',NEW args)))
    (add-macro-alias ,OLD ,NEW)
    (value-triple ',OLD)))
in-theory
(in-theory (disable all-boundp-initial-global-table))
other
(verify-termination-boot-strap clear-brr-data-lst)
in-theory
(in-theory (disable iprint-oracle-updates))
in-theory
(in-theory (disable array-order))
in-theory
(in-theory (disable error-fms
    error-fms-channel
    error1
    error1-state-p
    fms
    fmt
    fmt-abbrev1
    fmt-ppr
    fmt0
    fmt1
    fmt1!
    ppr
    ppr1
    ppr2))
*df-pi*constant
(defconst *df-pi* (from-df (df-pi)))
other
(add-macro-alias +f!-fn2 +f!-fn2$inline)
other
(add-macro-alias +f!-fn3 +f!-fn3$inline)
other
(deftheory ground-zero (current-theory :here))
other
(deflabel end-of-pass-2)