• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
      • Gl
        • Term-level-reasoning
          • G-call
          • Def-gl-boolean-constraint
          • Gl-set-uninterpreted
          • Def-glcp-ctrex-rewrite
          • Def-gl-rewrite
          • Def-gl-branch-merge
          • Glmc
          • Other-resources
          • Optimization
            • Term-level-reasoning
              • G-call
              • Def-gl-boolean-constraint
              • Gl-set-uninterpreted
              • Def-glcp-ctrex-rewrite
              • Def-gl-rewrite
              • Def-gl-branch-merge
              • Def-gl-param-thm
              • Case-splitting
              • Modes
              • Memory-management
              • Preferred-definitions
              • Custom-symbolic-counterparts
              • Redundant-recursion
              • Alternate-definitions
              • Gl-param-thm
            • Reference
            • Debugging
            • Basic-tutorial
          • Witness-cp
          • Ccg
          • Install-not-normalized
          • Rewrite$
          • Fgl
          • 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
      • Reference
      • Term-level-reasoning

      Def-gl-branch-merge

      Define a rule for GL to use in merging IF branches

      Usage:

      (gl::def-gl-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 GL 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-gl-branch-merge-fn

      (defun def-gl-branch-merge-fn (name body hints otf-flg)
       (cons
        'progn
        (cons
         (cons
          'defthm
          (cons
           name
           (cons
               body
               (cons ':hints
                     (cons hints
                           (cons ':otf-flg
                                 (cons otf-flg '(:rule-classes nil))))))))
         (cons (cons 'add-gl-branch-merge
                     (cons name 'nil))
               'nil))))