• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • 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
        • 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
          • Symbolic-arithmetic
          • Bfr
            • Bfr-eval
            • Bfrstate
            • Bfr->aignet-lit
            • Bfr-p
            • Bounded-lit-fix
              • Bfr-list-fix
              • Aignet-lit->bfr
              • Variable-g-bindings
              • Bfr-listp$
              • Bfrstate>=
              • Bfr-listp-witness
              • Fgl-object-bindings-bfrlist
              • Bfr-set-var
              • Bfr-negate
              • Bfr-fix
              • Fgl-bfr-object-bindings-p
              • Bfr-mode
              • Bfr-mode-is
              • Lbfr-case
              • Bfrstate-case
              • Bfrstate-mode-is
              • Lbfr-mode-is
              • Bfr-mode-p
            • Fgl-interpreter-state
        • 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
    • Bfr

    Bounded-lit-fix

    Signature
    (bounded-lit-fix x bound) → new-x
    Arguments
    x — Guard (satlink::litp x).
    bound — Guard (natp bound).
    Returns
    new-x — Type (satlink::litp new-x).

    Definitions and Theorems

    Function: bounded-lit-fix$inline

    (defun bounded-lit-fix$inline (x bound)
      (declare (xargs :guard (and (satlink::litp x) (natp bound))))
      (declare (xargs :guard (<= (satlink::lit->var x) bound)))
      (let ((__function__ 'bounded-lit-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (if (<= (satlink::lit->var x) (nfix bound))
                 (satlink::lit-fix x)
               (satlink::make-lit 0 (satlink::lit->neg x)))
             :exec x)))

    Theorem: litp-of-bounded-lit-fix

    (defthm litp-of-bounded-lit-fix
      (b* ((new-x (bounded-lit-fix$inline x bound)))
        (satlink::litp new-x))
      :rule-classes :type-prescription)

    Theorem: bound-of-bounded-lit-fix

    (defthm bound-of-bounded-lit-fix
      (b* ((?new-x (bounded-lit-fix$inline x bound)))
        (<= (satlink::lit->var new-x)
            (nfix bound)))
      :rule-classes :linear)

    Theorem: bounded-lit-fix-when-bounded

    (defthm bounded-lit-fix-when-bounded
      (b* ((?new-x (bounded-lit-fix$inline x bound)))
        (implies (<= (satlink::lit->var x) (nfix bound))
                 (equal new-x (satlink::lit-fix x)))))

    Theorem: bounded-lit-fix$inline-of-lit-fix-x

    (defthm bounded-lit-fix$inline-of-lit-fix-x
      (equal (bounded-lit-fix$inline (satlink::lit-fix x)
                                     bound)
             (bounded-lit-fix$inline x bound)))

    Theorem: bounded-lit-fix$inline-lit-equiv-congruence-on-x

    (defthm bounded-lit-fix$inline-lit-equiv-congruence-on-x
      (implies (satlink::lit-equiv x x-equiv)
               (equal (bounded-lit-fix$inline x bound)
                      (bounded-lit-fix$inline x-equiv bound)))
      :rule-classes :congruence)

    Theorem: bounded-lit-fix$inline-of-nfix-bound

    (defthm bounded-lit-fix$inline-of-nfix-bound
      (equal (bounded-lit-fix$inline x (nfix bound))
             (bounded-lit-fix$inline x bound)))

    Theorem: bounded-lit-fix$inline-nat-equiv-congruence-on-bound

    (defthm bounded-lit-fix$inline-nat-equiv-congruence-on-bound
      (implies (acl2::nat-equiv bound bound-equiv)
               (equal (bounded-lit-fix$inline x bound)
                      (bounded-lit-fix$inline x bound-equiv)))
      :rule-classes :congruence)