Filtering...

remove-guard-holders

books/system/remove-guard-holders

Included Books

other
(in-package "ACL2")
include-book
(include-book "tools/flag" :dir :system)
include-book
(include-book "remove-guard-holders1")
include-book
(include-book "remove-guard-holders-weak")
include-book
(include-book "termp")
include-book
(include-book "subst-var")
include-book
(include-book "subcor-var")
other
(verify-termination flatten-ands-in-lit-lst)
other
(verify-termination translate-declaration-to-guard/integer-gen)
other
(verify-termination subst-each-for-var)
other
(verify-termination possibly-dirty-lambda-objectp1)
other
(verify-termination translate-declaration-to-guard1-gen)
other
(verify-termination translate-declaration-to-guard-gen)
other
(verify-termination subst-each-for-var)
local
(local (in-theory (disable remove-guard-holders-weak)))
badge-userfn-structure-alistp-implies-weak-badge-userfn-structure-alistptheorem
(defthm badge-userfn-structure-alistp-implies-weak-badge-userfn-structure-alistp
  (implies (badge-userfn-structure-alistp x)
    (weak-badge-userfn-structure-alistp x))
  :rule-classes :forward-chaining)
ilks-plist-worldp-forward-to-plist-worldptheorem
(defthm ilks-plist-worldp-forward-to-plist-worldp
  (implies (ilks-plist-worldp w) (plist-worldp w))
  :rule-classes :forward-chaining)
ilks-plist-worldp-forward-to-alistp-for-badge-userfn-structuretheorem
(defthm ilks-plist-worldp-forward-to-alistp-for-badge-userfn-structure
  (implies (ilks-plist-worldp wrld)
    (and (alistp (fgetprop 'badge-table 'table-alist nil wrld))
      (alistp (cdr (assoc-equal :badge-userfn-structure (fgetprop 'badge-table 'table-alist nil wrld))))))
  :rule-classes :forward-chaining)
local
(local (defthm weak-badge-userfn-structure-alistp-implies-consp-cdr-assoc-equal
    (implies (and (weak-badge-userfn-structure-alistp alist)
        (cdr (assoc-equal fn alist)))
      (consp (cdr (assoc-equal fn alist))))))
weak-badge-userfn-structure-alistp-forward-to-alistptheorem
(defthm weak-badge-userfn-structure-alistp-forward-to-alistp
  (implies (weak-badge-userfn-structure-alistp alist)
    (alistp alist))
  :rule-classes :forward-chaining)
local
(local (defthm consp-assoc-equal-forced
    (implies (and (force (alistp l)) (assoc-equal name l))
      (consp (assoc-equal name l)))))
local
(local (defthm weak-badge-userfn-structure-alistp-implies-consp-cddr-assoc-equal
    (implies (and (weak-badge-userfn-structure-alistp alist)
        (cddr (assoc-equal fn alist)))
      (consp (cddr (assoc-equal fn alist))))))
other
(verify-termination executable-badge
  (declare (xargs :guard-hints (("Goal" :do-not-induct t)))))
local
(local (defthm executable-tamep-1
    (implies (and (apply$-badge-alistp-ilks-t bpf)
        (cdr (hons-assoc-equal fn bpf)))
      (consp (cdr (hons-assoc-equal fn bpf))))))
local
(local (defthm executable-tamep-2
    (implies (and (apply$-badge-alistp-ilks-t bpf)
        (cddr (hons-assoc-equal fn bpf)))
      (consp (cddr (hons-assoc-equal fn bpf))))))
local
(local (defthm executable-tamep-3
    (implies (and (apply$-badge-alistp-ilks-t bpf)
        (cdddr (hons-assoc-equal fn bpf)))
      (consp (cdddr (hons-assoc-equal fn bpf))))))
local
(local (defthm executable-tamep-4
    (implies (and (weak-badge-userfn-structure-alistp alist)
        (caddr (assoc-equal fn alist)))
      (consp (caddr (assoc-equal fn alist))))))
local
(local (defthm executable-tamep-5
    (implies (and (weak-badge-userfn-structure-alistp alist)
        (cdr (caddr (assoc-equal fn alist))))
      (consp (cdr (caddr (assoc-equal fn alist)))))))
local
(local (defthm executable-tamep-6
    (implies (and (weak-badge-userfn-structure-alistp alist)
        (cddr (caddr (assoc-equal fn alist))))
      (consp (cddr (caddr (assoc-equal fn alist)))))))
local
(local (defthm executable-tamep-7-8
    (implies (and (apply$-badge-alistp-ilks-t bpf)
        (cdr (hons-assoc-equal fn bpf)))
      (natp (caddr (hons-assoc-equal fn bpf))))
    :rule-classes :type-prescription))
local
(local (defthm executable-tamep-8
    (implies (and (apply$-badge-alistp-ilks-t bpf)
        (hons-assoc-equal fn bpf))
      (equal (cddddr (hons-assoc-equal fn bpf)) t))))
local
(local (defthm executable-tamep-9
    (implies (and (badge-userfn-structure-alistp alist)
        (caddr (assoc-equal fn alist)))
      (natp (cadr (caddr (assoc-equal fn alist)))))
    :rule-classes :type-prescription))
local
(local (defthm executable-tamep-10
    (implies (and (badge-userfn-structure-alistp alist)
        (not (equal (cdddr (caddr (assoc-equal fn alist))) t)))
      (true-listp (cdddr (caddr (assoc-equal fn alist)))))))
other
(verify-termination executable-tamep
  (declare (xargs :guard-hints (("Goal" :do-not-induct t)))))
other
(verify-termination weak-splo-extracts-tuple-listp)
other
(verify-termination well-formed-lambda-objectp1
  (declare (xargs :guard-hints (("Goal" :do-not-induct t)))))
other
(verify-termination translate-declaration-to-guard1-gen)
other
(verify-termination translate-declaration-to-guard-gen)
local
(local (defthm symbol-listp-implies-pseudo-term-listp
    (implies (symbol-listp x) (pseudo-term-listp x))))
local
(local (make-flag flag-translate-declaration-to-guard-gen
    translate-declaration-to-guard-gen))
local
(local (defthm-flag-translate-declaration-to-guard-gen (defthm pseudo-termp-translate-declaration-to-guard-gen
      (implies (and (pseudo-termp var) (equal tflg t))
        (pseudo-termp (translate-declaration-to-guard-gen x var tflg wrld)))
      :flag translate-declaration-to-guard-gen)
    (defthm pseudo-term-listp-translate-declaration-to-guard-gen
      (implies (and (pseudo-termp var) (equal tflg t))
        (pseudo-term-listp (translate-declaration-to-guard-gen-lst l var tflg wrld)))
      :flag translate-declaration-to-guard-gen-lst)))
other
(verify-termination type-expressions-from-type-spec)
other
(verify-termination syntactically-plausible-lambda-objectp1)
local
(local (defthm syntactically-plausible-lambda-objectp-termination-lemma-1
    (< (acl2-count (mv-nth 5
          (syntactically-plausible-lambda-objectp1 edcls
            formals
            ignores
            ignorables
            type-exprs
            satisfies-exprs
            guard)))
      (+ 5
        (acl2-count edcls)
        (acl2-count formals)
        (acl2-count guard)))
    :rule-classes :linear))
local
(local (encapsulate nil
    (local (defun all-vars1/all-vars1-lst
        (flg lst ans)
        (if (eq flg 'all-vars1)
          (cond ((variablep lst) (add-to-set-eq lst ans))
            ((fquotep lst) ans)
            (t (all-vars1/all-vars1-lst 'all-vars-lst1 (cdr lst) ans)))
          (cond ((endp lst) ans)
            (t (all-vars1/all-vars1-lst 'all-vars-lst1
                (cdr lst)
                (all-vars1/all-vars1-lst 'all-vars1 (car lst) ans)))))))
    (local (defthm step-1-lemma
        (equal (all-vars1/all-vars1-lst flg lst ans)
          (if (equal flg 'all-vars1)
            (all-vars1 lst ans)
            (all-vars1-lst lst ans)))))
    (local (defthm step-2-lemma
        (implies (and (symbol-listp ans)
            (if (equal flg 'all-vars1)
              (pseudo-termp lst)
              (pseudo-term-listp lst)))
          (symbol-listp (all-vars1/all-vars1-lst flg lst ans)))))
    (defthm symbol-listp-all-vars1
      (implies (and (symbol-listp ans) (pseudo-termp lst))
        (symbol-listp (all-vars1 lst ans)))
      :hints (("Goal" :use (:instance step-2-lemma (flg 'all-vars1)))))))
local
(local (defthm arglistp1-implies-symbol-listp
    (implies (arglistp1 x) (symbol-listp x))
    :hints (("Goal" :in-theory (enable arglistp1)))))
local
(local (defthm pseudo-term-listp-revappend
    (implies (true-listp x)
      (equal (pseudo-term-listp (revappend x y))
        (and (pseudo-term-listp x) (pseudo-term-listp y))))))
other
(set-induction-depth-limit 1)
local
(local (defthm member-symbol-listp-forward-to-symbolp
    (implies (and (member-equal a x) (symbol-listp x))
      (symbolp a))
    :rule-classes :forward-chaining))
include-book
(include-book "system/subst-var" :dir :system)
local
(local (defthm pseudo-term-listp-subst-each-for-var
    (implies (and (pseudo-term-listp new-lst)
        (variablep old)
        (pseudo-termp term))
      (pseudo-term-listp (subst-each-for-var new-lst old term)))))
local
(local (defthm subset-symbol-listp-forward-to-symbol-listp
    (implies (and (subsetp-equal x y) (true-listp x) (symbol-listp y))
      (symbol-listp x))
    :rule-classes :forward-chaining))
local
(local (defthm pseudo-term-listp-mv-nth-3-syntactically-plausible-lambda-objectp1
    (implies (and (car (syntactically-plausible-lambda-objectp1 edcls
            formals
            ignores
            ignorables
            type-exprs
            satisfies-exprs
            guard))
        (symbol-listp formals)
        (pseudo-term-listp type-exprs))
      (pseudo-term-listp (mv-nth 3
          (syntactically-plausible-lambda-objectp1 edcls
            formals
            ignores
            ignorables
            type-exprs
            satisfies-exprs
            guard))))))
local
(local (defthm symbol-listp-set-difference-equal
    (implies (symbol-listp x)
      (symbol-listp (set-difference-equal x y)))))
local
(local (encapsulate nil
    (local (defthm symbol-listp-revappend-lemma
        (implies (not (symbol-listp y))
          (not (symbol-listp (revappend x y))))))
    (defthm symbol-listp-revappend
      (implies (true-listp x)
        (equal (symbol-listp (revappend x y))
          (and (symbol-listp x) (symbol-listp y)))))))
local
(local (defthm true-listp-mv-nth-1-syntactically-plausible-lambda-objectp1
    (implies (and (car (syntactically-plausible-lambda-objectp1 edcls
            formals
            ignores
            ignorables
            type-exprs
            satisfies-exprs
            guard))
        (symbol-listp ignores)
        (symbol-listp formals))
      (true-listp (mv-nth 1
          (syntactically-plausible-lambda-objectp1 edcls
            formals
            ignores
            ignorables
            type-exprs
            satisfies-exprs
            guard))))))
local
(local (defthm true-listp-mv-nth-2-syntactically-plausible-lambda-objectp1
    (implies (and (car (syntactically-plausible-lambda-objectp1 edcls
            formals
            ignores
            ignorables
            type-exprs
            satisfies-exprs
            guard))
        (symbol-listp ignorables)
        (symbol-listp formals))
      (true-listp (mv-nth 2
          (syntactically-plausible-lambda-objectp1 edcls
            formals
            ignores
            ignorables
            type-exprs
            satisfies-exprs
            guard))))))
arglistp-forward-to-symbol-listptheorem
(defthm arglistp-forward-to-symbol-listp
  (implies (arglistp x) (symbol-listp x))
  :rule-classes :forward-chaining)
other
(verify-termination syntactically-plausible-lambda-objectp
  (declare (xargs :guard-hints (("Goal" :do-not-induct t)))))
other
(verify-termination expand-all-lambdas)
local
(local (make-flag flag-expand-all-lambdas
    expand-all-lambdas
    :flag-mapping ((expand-all-lambdas term) (expand-all-lambdas-lst terms))))
local
(local (defthm len-expand-all-lambdas-lst
    (equal (len (expand-all-lambdas-lst terms)) (len terms))))
local
(local (defthm pseudo-termp-forward-to-pseudo-term-listp-cdr
    (implies (and (pseudo-termp x) (consp x) (consp (car x)))
      (pseudo-term-listp (cdr x)))
    :rule-classes :forward-chaining))
local
(local (defthm-flag-expand-all-lambdas (defthm type-of-pseudo-termp
      (implies (pseudo-termp term)
        (pseudo-termp (expand-all-lambdas term)))
      :flag term)
    (defthm pseudo-term-listp-expand-all-lambdas-lst
      (implies (pseudo-term-listp terms)
        (pseudo-term-listp (expand-all-lambdas-lst terms)))
      :flag terms)))
other
(verify-guards expand-all-lambdas)
other
(verify-termination find-warrant-function-name)
other
(verify-termination warrants-for-tamep
  (declare (xargs :verify-guards nil)))
local
(local (make-flag flag-warrants-for-tamep
    warrants-for-tamep
    :flag-mapping ((warrants-for-tamep term) (warrants-for-tamep-functionp fn)
      (warrants-for-suitably-tamep-listp lst))))
local
(local (defthm-flag-warrants-for-tamep (defthm true-listp-car-warrants-for-tamep
      (implies (and (ilks-plist-worldp wrld)
          (executable-tamep x wrld)
          (true-listp warrants))
        (true-listp (car (warrants-for-tamep x wrld warrants unwarranteds))))
      :flag term)
    (defthm true-listp-car-warrants-for-tamep-functionp
      (implies (and (ilks-plist-worldp wrld)
          (executable-tamep-functionp fn wrld)
          (true-listp warrants))
        (true-listp (car (warrants-for-tamep-functionp fn wrld warrants unwarranteds))))
      :flag fn)
    (defthm true-listp-car-warrants-for-warrants-for-suitably-tamep-listp
      (implies (and (ilks-plist-worldp wrld)
          (executable-suitably-tamep-listp flags args wrld)
          (true-listp warrants))
        (true-listp (car (warrants-for-suitably-tamep-listp flags
              args
              wrld
              warrants
              unwarranteds))))
      :flag lst)))
local
(local (defthm-flag-warrants-for-tamep (defthm symbol-listp-mv-nth-1-warrants-for-tamep
      (implies (and (ilks-plist-worldp wrld)
          (executable-tamep x wrld)
          (symbol-listp unwarranteds))
        (symbol-listp (mv-nth 1 (warrants-for-tamep x wrld warrants unwarranteds))))
      :flag term)
    (defthm symbol-listp-mv-nth-1-warrants-for-tamep-functionp
      (implies (and (ilks-plist-worldp wrld)
          (executable-tamep-functionp fn wrld)
          (symbol-listp unwarranteds))
        (symbol-listp (mv-nth 1
            (warrants-for-tamep-functionp fn wrld warrants unwarranteds))))
      :flag fn)
    (defthm symbol-listp-mv-nth-1-warrants-for-warrants-for-suitably-tamep-listp
      (implies (and (ilks-plist-worldp wrld)
          (executable-suitably-tamep-listp flags args wrld)
          (symbol-listp unwarranteds))
        (symbol-listp (mv-nth 1
            (warrants-for-suitably-tamep-listp flags
              args
              wrld
              warrants
              unwarranteds))))
      :flag lst)))
other
(verify-guards warrants-for-tamep)
other
(verify-termination weak-splo-extracts-tuple-listp)
weak-splo-extracts-tuple-listp-forward-to-true-listptheorem
(defthm weak-splo-extracts-tuple-listp-forward-to-true-listp
  (implies (weak-splo-extracts-tuple-listp x) (true-listp x))
  :rule-classes :forward-chaining)
weak-splo-extracts-tuple-listp-appendtheorem
(defthm weak-splo-extracts-tuple-listp-append
  (implies (true-listp x)
    (equal (weak-splo-extracts-tuple-listp (append x y))
      (and (weak-splo-extracts-tuple-listp x)
        (weak-splo-extracts-tuple-listp y)))))
other
(verify-termination type-expressions-from-type-spec)
other
(verify-termination syntactically-plausible-lambda-objectp1
  (declare (xargs :verify-guards nil)))
other
(verify-termination syntactically-plausible-lambda-objectp
  (declare (xargs :verify-guards nil)))
local
(local (make-flag flag-syntactically-plausible-lambda-objectp
    syntactically-plausible-lambda-objectp
    :flag-mapping ((syntactically-plausible-lambda-objectp main) (syntactically-plausible-lambda-objectsp-within within)
      (syntactically-plausible-lambda-objectsp-within-lst listp))))
local
(local (defthm-flag-syntactically-plausible-lambda-objectp (defthm weak-splo-extracts-tuple-listp-1
      (implies (syntactically-plausible-lambda-objectp gflg x)
        (weak-splo-extracts-tuple-listp (syntactically-plausible-lambda-objectp gflg x)))
      :flag main)
    (defthm weak-splo-extracts-tuple-listp-2
      (let ((ans (syntactically-plausible-lambda-objectsp-within gflg body)))
        (implies ans
          (or (weak-splo-extracts-tuple-listp ans) (equal ans t))))
      :rule-classes nil
      :flag within)
    (defthm weak-splo-extracts-tuple-listp-3
      (let ((ans (syntactically-plausible-lambda-objectsp-within-lst gflg
             args)))
        (implies ans
          (or (weak-splo-extracts-tuple-listp ans) (equal ans t))))
      :rule-classes nil
      :flag listp)))
weak-splo-extracts-tuple-listp-of-syntactically-plausible-lambda-objectptheorem
(defthm weak-splo-extracts-tuple-listp-of-syntactically-plausible-lambda-objectp
  (implies (syntactically-plausible-lambda-objectp nil x)
    (weak-splo-extracts-tuple-listp (syntactically-plausible-lambda-objectp nil x))))
other
(verify-termination well-formed-lambda-objectp)
other
(verify-termination possibly-dirty-lambda-objectp)
other
(verify-guards possibly-dirty-lambda-objectp)