• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
        • Syntax-for-tools
        • Atc
        • Language
          • Abstract-syntax
          • Integer-ranges
          • Implementation-environments
          • Dynamic-semantics
          • Static-semantics
            • Check-stmt
            • Check-cond
            • Check-binary-pure
            • Var-table-add-var
            • Check-unary
            • Check-obj-declon
            • Fun-table-add-fun
            • Check-fundef
            • Fun-sinfo
            • Check-expr-asg
            • Check-expr-call
            • Check-arrsub
            • Uaconvert-types
            • Apconvert-type-list
            • Check-initer
            • Adjust-type-list
            • Types+vartab
            • Promote-type
            • Check-tag-declon
            • Check-expr-call-or-asg
            • Check-ext-declon
            • Check-param-declon
            • Check-member
            • Check-expr-pure
            • Init-type-matchp
            • Check-obj-adeclor
            • Check-memberp
            • Check-expr-call-or-pure
            • Check-cast
            • Check-struct-declon-list
            • Check-fun-declor
            • Expr-type
            • Check-ext-declon-list
            • Check-transunit
            • Check-fun-declon
            • Var-defstatus
            • Struct-member-lookup
            • Preprocess
            • Wellformed
            • Check-tyspecseq
            • Check-param-declon-list
            • Check-iconst
            • Check-expr-pure-list
            • Var-sinfo-option
            • Fun-sinfo-option
            • Var-scope-all-definedp
            • Funtab+vartab+tagenv
            • Var-sinfo
            • Var-table-lookup
            • Apconvert-type
            • Var-table
              • Var-table-fix
                • Var-tablep
                • Var-table-equiv
              • Check-tyname
              • Types+vartab-result
              • Funtab+vartab+tagenv-result
              • Fun-table-lookup
              • Wellformed-result
              • Var-table-add-block
              • Var-table-scope
              • Var-table-result
              • Fun-table-result
              • Expr-type-result
              • Adjust-type
              • Check-fileset
              • Var-table-all-definedp
              • Check-const
              • Fun-table-all-definedp
              • Check-ident
              • Fun-table
              • Var-table-init
              • Fun-table-init
            • Grammar
            • Integer-formats
            • Types
            • Portable-ascii-identifiers
            • Values
            • Integer-operations
            • Computation-states
            • Object-designators
            • Operations
            • Errors
            • Tag-environments
            • Function-environments
            • Character-sets
            • Flexible-array-member-removal
            • Arithmetic-operations
            • Pointer-operations
            • Bytes
            • Keywords
            • Real-operations
            • Array-operations
            • Scalar-operations
            • Structure-operations
          • Representation
          • Transformation-tools
          • Insertion-sort
          • Pack
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Bitcoin
        • Riscv
        • Des
        • Ethereum
        • X86isa
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Var-table

    Var-table-fix

    (var-table-fix x) is a usual ACL2::fty list fixing function.

    Signature
    (var-table-fix x) → fty::newx
    Arguments
    x — Guard (var-tablep x).
    Returns
    fty::newx — Type (var-tablep fty::newx).

    In the logic, we apply var-table-scope-fix to each member of the x. In the execution, none of that is actually necessary and this is just an inlined identity function.

    Definitions and Theorems

    Function: var-table-fix$inline

    (defun var-table-fix$inline (x)
      (declare (xargs :guard (var-tablep x)))
      (let ((__function__ 'var-table-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (if (consp (cdr x))
                 (cons (var-table-scope-fix (car x))
                       (var-table-fix (cdr x)))
               (cons (var-table-scope-fix (car x))
                     nil))
             :exec x)))

    Theorem: var-tablep-of-var-table-fix

    (defthm var-tablep-of-var-table-fix
      (b* ((fty::newx (var-table-fix$inline x)))
        (var-tablep fty::newx))
      :rule-classes :rewrite)

    Theorem: var-table-fix-when-var-tablep

    (defthm var-table-fix-when-var-tablep
      (implies (var-tablep x)
               (equal (var-table-fix x) x)))

    Function: var-table-equiv$inline

    (defun var-table-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (var-tablep acl2::x)
                                  (var-tablep acl2::y))))
      (equal (var-table-fix acl2::x)
             (var-table-fix acl2::y)))

    Theorem: var-table-equiv-is-an-equivalence

    (defthm var-table-equiv-is-an-equivalence
      (and (booleanp (var-table-equiv x y))
           (var-table-equiv x x)
           (implies (var-table-equiv x y)
                    (var-table-equiv y x))
           (implies (and (var-table-equiv x y)
                         (var-table-equiv y z))
                    (var-table-equiv x z)))
      :rule-classes (:equivalence))

    Theorem: var-table-equiv-implies-equal-var-table-fix-1

    (defthm var-table-equiv-implies-equal-var-table-fix-1
      (implies (var-table-equiv acl2::x x-equiv)
               (equal (var-table-fix acl2::x)
                      (var-table-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: var-table-fix-under-var-table-equiv

    (defthm var-table-fix-under-var-table-equiv
      (var-table-equiv (var-table-fix acl2::x)
                       acl2::x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-var-table-fix-1-forward-to-var-table-equiv

    (defthm equal-of-var-table-fix-1-forward-to-var-table-equiv
      (implies (equal (var-table-fix acl2::x) acl2::y)
               (var-table-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: equal-of-var-table-fix-2-forward-to-var-table-equiv

    (defthm equal-of-var-table-fix-2-forward-to-var-table-equiv
      (implies (equal acl2::x (var-table-fix acl2::y))
               (var-table-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: var-table-equiv-of-var-table-fix-1-forward

    (defthm var-table-equiv-of-var-table-fix-1-forward
      (implies (var-table-equiv (var-table-fix acl2::x)
                                acl2::y)
               (var-table-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: var-table-equiv-of-var-table-fix-2-forward

    (defthm var-table-equiv-of-var-table-fix-2-forward
      (implies (var-table-equiv acl2::x (var-table-fix acl2::y))
               (var-table-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: car-of-var-table-fix-x-under-var-table-scope-equiv

    (defthm car-of-var-table-fix-x-under-var-table-scope-equiv
      (var-table-scope-equiv (car (var-table-fix acl2::x))
                             (car acl2::x)))

    Theorem: car-var-table-equiv-congruence-on-x-under-var-table-scope-equiv

    (defthm
        car-var-table-equiv-congruence-on-x-under-var-table-scope-equiv
      (implies (var-table-equiv acl2::x x-equiv)
               (var-table-scope-equiv (car acl2::x)
                                      (car x-equiv)))
      :rule-classes :congruence)

    Theorem: cdr-of-var-table-fix-x-under-var-table-equiv

    (defthm cdr-of-var-table-fix-x-under-var-table-equiv
      (var-table-equiv (cdr (var-table-fix acl2::x))
                       (cdr acl2::x)))

    Theorem: cdr-var-table-equiv-congruence-on-x-under-var-table-equiv

    (defthm cdr-var-table-equiv-congruence-on-x-under-var-table-equiv
      (implies (var-table-equiv acl2::x x-equiv)
               (var-table-equiv (cdr acl2::x)
                                (cdr x-equiv)))
      :rule-classes :congruence)

    Theorem: cons-of-var-table-scope-fix-x-under-var-table-equiv

    (defthm cons-of-var-table-scope-fix-x-under-var-table-equiv
      (var-table-equiv (cons (var-table-scope-fix acl2::x)
                             acl2::y)
                       (cons acl2::x acl2::y)))

    Theorem: cons-var-table-scope-equiv-congruence-on-x-under-var-table-equiv

    (defthm
       cons-var-table-scope-equiv-congruence-on-x-under-var-table-equiv
      (implies (var-table-scope-equiv acl2::x x-equiv)
               (var-table-equiv (cons acl2::x acl2::y)
                                (cons x-equiv acl2::y)))
      :rule-classes :congruence)

    Theorem: consp-of-var-table-fix

    (defthm consp-of-var-table-fix
      (consp (var-table-fix acl2::x)))

    Theorem: consp-cdr-of-var-table-fix

    (defthm consp-cdr-of-var-table-fix
      (equal (consp (cdr (var-table-fix acl2::x)))
             (consp (cdr acl2::x))))

    Theorem: car-of-var-table-fix

    (defthm car-of-var-table-fix
      (equal (car (var-table-fix acl2::x))
             (var-table-scope-fix (car acl2::x))))

    Theorem: var-table-fix-under-iff

    (defthm var-table-fix-under-iff
      (var-table-fix acl2::x))

    Theorem: var-table-fix-of-cons

    (defthm var-table-fix-of-cons
      (equal (var-table-fix (cons a x))
             (cons (var-table-scope-fix a)
                   (and (consp x) (var-table-fix x)))))

    Theorem: len-of-var-table-fix

    (defthm len-of-var-table-fix
      (equal (len (var-table-fix acl2::x))
             (max 1 (len acl2::x))))