• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
      • Gl
      • Witness-cp
      • Ccg
      • Install-not-normalized
      • Rewrite$
      • Removable-runes
      • Efficiency
      • Rewrite-bounds
      • Bash
      • Def-dag-measure
      • 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-interpreter-overview
        • Fgl-counterexamples
        • 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
        • Advanced-equivalence-checking-with-fgl
          • Solve-lane-by-lane-masked
          • Solve-lane-by-lane-masked+
          • Top-level-equal
            • Replace-equal-with-top-level-equal
          • Solve-lane-by-lane
          • Replace-equal-with-top-level-equal-rec
          • Lookup-previous-stack-frame-binding
          • Monolithic-sat-with-transforms
          • Ipasir-sat-limit100
        • Fgl-array-support
        • Fgl-internals
      • 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
    • Testing-utilities
    • Math
  • Advanced-equivalence-checking-with-fgl

Top-level-equal

An alias for EQUAL. Useful if you want to prove an equality in FGL using a particular strategy.

Signature
(top-level-equal x y) → *

Sometimes if you're proving an equivalence of two objects using FGL/SAT/bitblasting, it's advantageous to use a strategy other than just checking satisfiability of the negation of the top-level equivalence. For example, in proving the correctness of SIMD implementations where you're proving equivalence of two wide integers composed of packed arithmetic results, you might want to instead prove each of the lanes separately. We can use an FGL rewrite rule to rewrite the top-lvel equal call to an alias that has a rewriting strategy to solve it with this scheme. But we don't want to rewrite all calls of equal this way! Instead, we suggest an alternate strategy:

  • Locally introduce a rule rewriting (top-level-equal x y) to the function implementing your special solving strategy -- solve-lane-by-lane, for example.
  • Add a hint to your def-fgl-thm: :hints ('(:clause-processor replace-equal-with-top-level-equal))

The hint will replace only the equal call at the top level of your theorem with top-level-equal.

Definitions and Theorems

Function: top-level-equal

(defun top-level-equal (x y)
       (declare (xargs :guard t))
       (equal x y))

Subtopics

Replace-equal-with-top-level-equal
Clause processor that replaces the final call of equal in a theorem conclusion with top-level-equal.