• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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-syntactic-checker-binders
          • Binder
          • Fancy-ev
          • Def-fgl-program
          • Bind-var
          • Add-fgl-brewrites
          • Def-fgl-rewrite
          • Narrow-equiv
          • Def-fgl-branch-merge
            • Add-fgl-rewrites
            • Fgl-interp-obj
            • Fgl-prog2
            • Collect-cmr-rewrites-for-formula-name
            • Syntax-bind
            • Fgl-time
            • Assume
            • Add-fgl-binder-meta
            • Add-fgl-primitive
            • Add-fgl-meta
            • Add-fgl-branch-merges
            • Cmr::rewritelist->lhses
            • Remove-fgl-brewrites
            • Remove-fgl-branch-merges
            • Lhses->branch-function-syms
            • Enable-execution
            • Abort-rewrite
            • Syntax-interp
            • Remove-fgl-rewrites
            • Lhses->leading-function-syms
            • Remove-fgl-primitive
            • Remove-fgl-binder-meta
            • If!
            • Disable-execution
            • Remove-fgl-meta
            • Fgl-time-fn
            • Disable-definition
            • Def-fgl-brewrite
          • 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
          • 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
    • Fgl-rewrite-rules

    Def-fgl-branch-merge

    Define a rule for FGL to use in merging IF branches

    Usage:

    (fgl::def-fgl-branch-merge my-branch-merge-rule
       (implies (and (syntaxp (integerp m))
                     (integerp m))
                (equal (if cond (logcons b n) m)
                       (logcons (if cond b (logcar m))
                                (if cond n (logcdr m)))))
     :hints ...)

    This form creates an ACL2 theorem with :rule-classes nil and installs it in a table that FGL references when attempting to merge branches of an IF term.

    Branch merge rules work similarly to normal rewrite rules, except that:

    • the LHS must be of the form: (if <var> <then-term> <else-term>)
    • each rule is indexed by the function symbol of the then-term, so then-term must be a function call.

    Definitions and Theorems

    Function: def-fgl-branch-merge-fn

    (defun
     def-fgl-branch-merge-fn
     (name body hints otf-flg)
     (cons
      'progn
      (cons
           (cons 'defthmd
                 (cons name
                       (cons body
                             (cons ':hints
                                   (cons hints
                                         (cons ':otf-flg
                                               (cons otf-flg 'nil)))))))
           (cons (cons 'add-fgl-branch-merge
                       (cons name 'nil))
                 'nil))))