• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
        • Term-level-reasoning
        • Glmc
        • Other-resources
        • Optimization
        • Reference
          • Def-gl-thm
          • Shape-specs
          • Symbolic-objects
          • Gl-aside
          • Def-gl-param-thm
          • Symbolic-arithmetic
          • Bfr
          • Def-gl-boolean-constraint
          • Gl-mbe
          • Bvec
          • Flex-bindings
          • Auto-bindings
          • Gl-interp
          • Gl-set-uninterpreted
          • Def-gl-clause-processor
          • Def-glcp-ctrex-rewrite
          • ACL2::always-equal
          • Gl-hint
          • Def-gl-rewrite
          • Def-gl-branch-merge
            • Gl-force-check
            • Gl-concretize
            • Gl-assert
            • Gl-param-thm
            • Gl-simplify-satlink-mode
            • Gl-satlink-mode
            • Gl-bdd-mode
            • Gl-aig-bddify-mode
            • Gl-fraig-satlink-mode
          • Debugging
          • Basic-tutorial
        • Esim
        • Vl2014
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • 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))))