• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
        • Deftreeops
        • Defdefparse
        • Defgrammar
        • Tree-utilities
        • Notation
          • Syntax-abstraction
          • Semantics
          • Abstract-syntax
            • Convenience-constructors
            • Num-val
            • Char-val
            • Repeat-range
            • Rulename
            • Rule
            • Rulename-option
            • Num-base
            • Rule-option
            • Prose-val
            • Rulelist
              • Rulelist-fix
                • Rulelistp
                • Rulelist-equiv
              • Char-val-set
              • Rulename-set
              • Rulename-list
              • Grammar
              • Alt/conc/rep/elem
            • Core-rules
            • Concrete-syntax
          • Grammar-parser
          • Meta-circular-validation
          • Parsing-primitives-defresult
          • Parsing-primitives-seq
          • Operations
          • Examples
          • Differences-with-paper
          • Constructor-utilities
          • Grammar-printer
          • Parsing-tools
        • Vwsim
        • Isar
        • Pfcs
        • Wp-gen
        • Dimacs-reader
        • Legacy-defrstobj
        • Proof-checker-array
        • Soft
        • C
        • Farray
        • Rp-rewriter
        • Riscv
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Bitcoin
        • 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
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Rulelist

    Rulelist-fix

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

    Signature
    (rulelist-fix x) → fty::newx
    Arguments
    x — Guard (rulelistp x).
    Returns
    fty::newx — Type (rulelistp fty::newx).

    In the logic, we apply rule-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: rulelist-fix$inline

    (defun rulelist-fix$inline (x)
      (declare (xargs :guard (rulelistp x)))
      (let ((__function__ 'rulelist-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (if (atom x)
                 nil
               (cons (rule-fix (car x))
                     (rulelist-fix (cdr x))))
             :exec x)))

    Theorem: rulelistp-of-rulelist-fix

    (defthm rulelistp-of-rulelist-fix
      (b* ((fty::newx (rulelist-fix$inline x)))
        (rulelistp fty::newx))
      :rule-classes :rewrite)

    Theorem: rulelist-fix-when-rulelistp

    (defthm rulelist-fix-when-rulelistp
      (implies (rulelistp x)
               (equal (rulelist-fix x) x)))

    Function: rulelist-equiv$inline

    (defun rulelist-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (rulelistp acl2::x)
                                  (rulelistp acl2::y))))
      (equal (rulelist-fix acl2::x)
             (rulelist-fix acl2::y)))

    Theorem: rulelist-equiv-is-an-equivalence

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

    Theorem: rulelist-equiv-implies-equal-rulelist-fix-1

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

    Theorem: rulelist-fix-under-rulelist-equiv

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

    Theorem: equal-of-rulelist-fix-1-forward-to-rulelist-equiv

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

    Theorem: equal-of-rulelist-fix-2-forward-to-rulelist-equiv

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

    Theorem: rulelist-equiv-of-rulelist-fix-1-forward

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

    Theorem: rulelist-equiv-of-rulelist-fix-2-forward

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

    Theorem: car-of-rulelist-fix-x-under-rule-equiv

    (defthm car-of-rulelist-fix-x-under-rule-equiv
      (rule-equiv (car (rulelist-fix acl2::x))
                  (car acl2::x)))

    Theorem: car-rulelist-equiv-congruence-on-x-under-rule-equiv

    (defthm car-rulelist-equiv-congruence-on-x-under-rule-equiv
      (implies (rulelist-equiv acl2::x x-equiv)
               (rule-equiv (car acl2::x)
                           (car x-equiv)))
      :rule-classes :congruence)

    Theorem: cdr-of-rulelist-fix-x-under-rulelist-equiv

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

    Theorem: cdr-rulelist-equiv-congruence-on-x-under-rulelist-equiv

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

    Theorem: cons-of-rule-fix-x-under-rulelist-equiv

    (defthm cons-of-rule-fix-x-under-rulelist-equiv
      (rulelist-equiv (cons (rule-fix acl2::x) acl2::y)
                      (cons acl2::x acl2::y)))

    Theorem: cons-rule-equiv-congruence-on-x-under-rulelist-equiv

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

    Theorem: cons-of-rulelist-fix-y-under-rulelist-equiv

    (defthm cons-of-rulelist-fix-y-under-rulelist-equiv
      (rulelist-equiv (cons acl2::x (rulelist-fix acl2::y))
                      (cons acl2::x acl2::y)))

    Theorem: cons-rulelist-equiv-congruence-on-y-under-rulelist-equiv

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

    Theorem: consp-of-rulelist-fix

    (defthm consp-of-rulelist-fix
      (equal (consp (rulelist-fix acl2::x))
             (consp acl2::x)))

    Theorem: rulelist-fix-under-iff

    (defthm rulelist-fix-under-iff
      (iff (rulelist-fix acl2::x)
           (consp acl2::x)))

    Theorem: rulelist-fix-of-cons

    (defthm rulelist-fix-of-cons
      (equal (rulelist-fix (cons a x))
             (cons (rule-fix a) (rulelist-fix x))))

    Theorem: len-of-rulelist-fix

    (defthm len-of-rulelist-fix
      (equal (len (rulelist-fix acl2::x))
             (len acl2::x)))

    Theorem: rulelist-fix-of-append

    (defthm rulelist-fix-of-append
      (equal (rulelist-fix (append std::a std::b))
             (append (rulelist-fix std::a)
                     (rulelist-fix std::b))))

    Theorem: rulelist-fix-of-repeat

    (defthm rulelist-fix-of-repeat
      (equal (rulelist-fix (repeat acl2::n acl2::x))
             (repeat acl2::n (rule-fix acl2::x))))

    Theorem: list-equiv-refines-rulelist-equiv

    (defthm list-equiv-refines-rulelist-equiv
      (implies (list-equiv acl2::x acl2::y)
               (rulelist-equiv acl2::x acl2::y))
      :rule-classes :refinement)

    Theorem: nth-of-rulelist-fix

    (defthm nth-of-rulelist-fix
      (equal (nth acl2::n (rulelist-fix acl2::x))
             (if (< (nfix acl2::n) (len acl2::x))
                 (rule-fix (nth acl2::n acl2::x))
               nil)))

    Theorem: rulelist-equiv-implies-rulelist-equiv-append-1

    (defthm rulelist-equiv-implies-rulelist-equiv-append-1
      (implies (rulelist-equiv acl2::x fty::x-equiv)
               (rulelist-equiv (append acl2::x acl2::y)
                               (append fty::x-equiv acl2::y)))
      :rule-classes (:congruence))

    Theorem: rulelist-equiv-implies-rulelist-equiv-append-2

    (defthm rulelist-equiv-implies-rulelist-equiv-append-2
      (implies (rulelist-equiv acl2::y fty::y-equiv)
               (rulelist-equiv (append acl2::x acl2::y)
                               (append acl2::x fty::y-equiv)))
      :rule-classes (:congruence))

    Theorem: rulelist-equiv-implies-rulelist-equiv-nthcdr-2

    (defthm rulelist-equiv-implies-rulelist-equiv-nthcdr-2
      (implies (rulelist-equiv acl2::l l-equiv)
               (rulelist-equiv (nthcdr acl2::n acl2::l)
                               (nthcdr acl2::n l-equiv)))
      :rule-classes (:congruence))

    Theorem: rulelist-equiv-implies-rulelist-equiv-take-2

    (defthm rulelist-equiv-implies-rulelist-equiv-take-2
      (implies (rulelist-equiv acl2::l l-equiv)
               (rulelist-equiv (take acl2::n acl2::l)
                               (take acl2::n l-equiv)))
      :rule-classes (:congruence))