• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
      • 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-floor-ss-aux
            • Bfr-integer-length-s1
              • Bfr-mod-ss-aux
              • Bfr-logapp-russ
              • Bfr-sign-abs-not-s
              • Bfr-ash-ss
              • Bfr-+-ss
              • Bfr-truncate-ss
              • Bfr-logapp-nus-aux
              • Bfr-ite-bss-fn-aux
              • Bfr-rem-ss
              • Bfr-mod-ss
              • Bfr-logbitp-n2v
              • Bfr-logapp-nus
              • Bfr-logapp-nss
              • Bfr-ite-bvv-fn-aux
              • Bfr-<-=-ss
              • Bfr-*-ss
              • Bfr-logxor-ss
              • Bfr-logior-ss
              • Bfr-logeqv-ss
              • Bfr-logand-ss
              • Bfr-ite-bvv-fn
              • Bfr-ite-bss-fn
              • Bfr-floor-ss
              • Bfr-expt-su
              • Bfr-logtail-ns
              • Bfr-loghead-nu
              • Bfr-loghead-ns
              • Bfr-logext-ns
              • Bfr-integer-length-s
              • Syntactically-true-p
              • Int-set-sign
              • Bfr-unary-minus-s
              • Bfr-lognot-s
              • Bfr-=-ss
              • Bfr-<-ss
              • Bfr-abs-s
              • Syntactically-zero-p
              • Bfr-=-uu
              • S-take
              • Integer-length-bound-s
              • Bfr-sign-s
              • Non-int-fix
              • Maybe-integer
              • All-nil
            • 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
        • 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
    • Symbolic-arithmetic

    Bfr-integer-length-s1

    Signature
    (bfr-integer-length-s1 offset x) → (mv not-done ilen)
    Arguments
    offset — Guard (posp offset).
    x — Guard (true-listp x).
    Returns
    ilen — Type (true-listp ilen).

    Definitions and Theorems

    Function: bfr-integer-length-s1

    (defun bfr-integer-length-s1 (offset x)
      (declare (xargs :guard (and (posp offset) (true-listp x))))
      (let ((__function__ 'bfr-integer-length-s1))
        (declare (ignorable __function__))
        (b* (((mv first rest end) (first/rest/end x))
             (offset (lposfix offset))
             ((when end) (mv nil nil))
             ((mv changed res)
              (bfr-integer-length-s1 (1+ offset)
                                     rest))
             ((when (eq changed t)) (mv t res))
             (change (bfr-xor first (car rest))))
          (mv (bfr-or changed change)
              (bfr-ite-bss changed res
                           (bfr-ite-bss change (i2v offset)
                                        nil))))))

    Theorem: true-listp-of-bfr-integer-length-s1.ilen

    (defthm true-listp-of-bfr-integer-length-s1.ilen
      (b* (((mv ?not-done ?ilen)
            (bfr-integer-length-s1 offset x)))
        (true-listp ilen))
      :rule-classes :type-prescription)

    Theorem: bfr-integer-length-s1-correct

    (defthm bfr-integer-length-s1-correct
      (b* (((mv not-done ilen)
            (bfr-integer-length-s1 offset x)))
        (and (equal (bfr-eval not-done env)
                    (and (not (equal (bfr-list->s x env) 0))
                         (not (equal (bfr-list->s x env) -1))))
             (equal (bfr-list->s ilen env)
                    (if (or (equal (bfr-list->s x env) 0)
                            (equal (bfr-list->s x env) -1))
                        0
                      (+ -1 (pos-fix offset)
                         (integer-length (bfr-list->s x env))))))))

    Theorem: bfr-integer-length-s1-deps

    (defthm bfr-integer-length-s1-deps
     (b* (((mv not-done ilen)
           (bfr-integer-length-s1 offset x)))
       (implies (and (not (pbfr-list-depends-on varname param x)))
                (and (not (pbfr-depends-on varname param not-done))
                     (not (pbfr-list-depends-on varname param ilen))))))