• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
      • Gl
      • Witness-cp
      • Ccg
      • Install-not-normalized
      • Rewrite$
      • Fgl
        • Fgl-rewrite-rules
        • Fgl-function-mode
        • Fgl-object
        • Fgl-solving
        • Fgl-handling-if-then-elses
        • Fgl-getting-bits-from-objects
        • Fgl-primitive-and-meta-rules
        • Fgl-counterexamples
          • Def-ctrex-rule
          • Fgl-counterexample-implementation-details
            • Cgraph
              • Cgraph-p
              • Ctrex-rule
                • Ctrex-rule-fix
                  • Make-ctrex-rule
                  • Ctrex-rule-p
                  • Ctrex-rule-equiv
                  • Ctrex-rule->dep-success-vars
                  • Change-ctrex-rule
                  • Ctrex-rule->unify-subst
                  • Ctrex-rule->ruletype
                  • Ctrex-rule->priority
                  • Ctrex-rule->value
                  • Ctrex-rule->target
                  • Ctrex-rule->success
                  • Ctrex-rule->match
                  • Ctrex-rule->deps
                  • Ctrex-rule->order
                  • Ctrex-rule->name
                • Cgraph-fix
                • Cgraph-equiv
              • Cgraph-derive-assignments-for-vars
              • Cgraph-derive-assignments-obj
              • Cgraph-derive-assignments-bindings
          • Fgl-interpreter-overview
          • Fgl-correctness-of-binding-free-variables
          • Fgl-debugging
          • Fgl-testbenches
          • Def-fgl-boolean-constraint
          • Fgl-stack
          • Fgl-rewrite-tracing
          • Def-fgl-param-thm
          • Def-fgl-thm
          • Fgl-fast-alist-support
          • Fgl-array-support
          • Advanced-equivalence-checking-with-fgl
          • Fgl-fty-support
          • Fgl-internals
        • Removable-runes
        • Efficiency
        • Rewrite-bounds
        • Bash
        • Def-dag-measure
        • Bdd
        • Remove-hyps
        • Contextual-rewriting
        • Simp
        • Rewrite$-hyps
        • Bash-term-to-dnf
        • Use-trivial-ancestors-check
        • Minimal-runes
        • Clause-processor-tools
        • Fn-is-body
        • Without-subsumption
        • Rewrite-equiv-hint
        • Def-bounds
        • Rewrite$-context
        • Try-gl-concls
        • Hint-utils
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Ctrex-rule

    Ctrex-rule-fix

    Fixing function for ctrex-rule structures.

    Signature
    (ctrex-rule-fix x) → new-x
    Arguments
    x — Guard (ctrex-rule-p x).
    Returns
    new-x — Type (ctrex-rule-p new-x).

    Definitions and Theorems

    Function: ctrex-rule-fix$inline

    (defun ctrex-rule-fix$inline (x)
     (declare (xargs :guard (ctrex-rule-p x)))
     (let ((__function__ 'ctrex-rule-fix))
      (declare (ignorable __function__))
      (mbe
       :logic
       (b*
        ((name (acl2::symbol-fix (cdr (std::da-nth 0 x))))
         (match (pseudo-term-fix (cdr (std::da-nth 1 x))))
         (unify-subst (fgl-object-bindings-fix (cdr (std::da-nth 2 x))))
         (target (pseudo-term-fix (cdr (std::da-nth 3 x))))
         (deps (pseudo-term-subst-fix (cdr (std::da-nth 4 x))))
         (dep-success-vars
              (pseudo-term-subst-fix (cdr (std::da-nth 5 x))))
         (success (pseudo-term-fix (cdr (std::da-nth 6 x))))
         (priority (pseudo-term-fix (cdr (std::da-nth 7 x))))
         (value (pseudo-term-fix (cdr (std::da-nth 8 x))))
         (order (nfix (cdr (std::da-nth 9 x))))
         (ruletype (ctrex-ruletype-fix (cdr (std::da-nth 10 x)))))
        (list (cons 'name name)
              (cons 'match match)
              (cons 'unify-subst unify-subst)
              (cons 'target target)
              (cons 'deps deps)
              (cons 'dep-success-vars
                    dep-success-vars)
              (cons 'success success)
              (cons 'priority priority)
              (cons 'value value)
              (cons 'order order)
              (cons 'ruletype ruletype)))
       :exec x)))

    Theorem: ctrex-rule-p-of-ctrex-rule-fix

    (defthm ctrex-rule-p-of-ctrex-rule-fix
      (b* ((new-x (ctrex-rule-fix$inline x)))
        (ctrex-rule-p new-x))
      :rule-classes :rewrite)

    Theorem: ctrex-rule-fix-when-ctrex-rule-p

    (defthm ctrex-rule-fix-when-ctrex-rule-p
      (implies (ctrex-rule-p x)
               (equal (ctrex-rule-fix x) x)))

    Function: ctrex-rule-equiv$inline

    (defun ctrex-rule-equiv$inline (x y)
      (declare (xargs :guard (and (ctrex-rule-p x)
                                  (ctrex-rule-p y))))
      (equal (ctrex-rule-fix x)
             (ctrex-rule-fix y)))

    Theorem: ctrex-rule-equiv-is-an-equivalence

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

    Theorem: ctrex-rule-equiv-implies-equal-ctrex-rule-fix-1

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

    Theorem: ctrex-rule-fix-under-ctrex-rule-equiv

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

    Theorem: equal-of-ctrex-rule-fix-1-forward-to-ctrex-rule-equiv

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

    Theorem: equal-of-ctrex-rule-fix-2-forward-to-ctrex-rule-equiv

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

    Theorem: ctrex-rule-equiv-of-ctrex-rule-fix-1-forward

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

    Theorem: ctrex-rule-equiv-of-ctrex-rule-fix-2-forward

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