• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
        • Ethereum
        • Yul
        • Zcash
        • ACL2-programming-language
          • Primitive-functions
            • Eval-intern-in-package-of-symbol
            • Eval-pkg-witness
            • Eval-pkg-imports
            • Primitive-function-namep
            • Primitive-function-arity
            • Eval-if
            • Eval-bad-atom<=
            • Eval-<
              • Eval-coerce
              • Eval-complex
              • Eval-binary-+
              • Eval-binary-*
              • Eval-equal
              • Eval-cons
              • Eval-symbol-package-name
              • Eval-complex-rationalp
              • Eval-unary-/
              • Eval-symbol-name
              • Eval-denominator
              • Eval-code-char
              • Eval-unary--
              • Eval-realpart
              • Eval-rationalp
              • Eval-numerator
              • Eval-integerp
              • Eval-imagpart
              • Eval-characterp
              • Eval-char-code
              • Eval-ACL2-numberp
              • Eval-symbolp
              • Eval-stringp
              • Eval-consp
              • Eval-cdr
              • Eval-car
            • Translated-terms
            • Values
            • Evaluation
            • Program-equivalence
            • Functions
            • Packages
            • Programs
            • Interpreter
            • Evaluation-states
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Primitive-functions

    Eval-<

    Evaluation semantics of <.

    Signature
    (eval-< x y) → result
    Arguments
    x — Guard (valuep x).
    y — Guard (valuep y).
    Returns
    result — Type (valuep result).

    Definitions and Theorems

    Function: eval-<

    (defun eval-< (x y)
      (declare (xargs :guard (and (valuep x) (valuep y))))
      (let ((__function__ 'eval-<))
        (declare (ignorable __function__))
        (lift-value (if (and (value-case-rational x)
                             (value-case-rational y))
                        (< (value-rational->get x)
                           (value-rational->get y))
                      (let ((x1 (if (value-case x :number)
                                    (value-number->get x)
                                  0))
                            (y1 (if (value-case y :number)
                                    (value-number->get y)
                                  0)))
                        (or (< (realpart x1) (realpart y1))
                            (and (equal (realpart x1) (realpart y1))
                                 (< (imagpart x1) (imagpart y1)))))))))

    Theorem: valuep-of-eval-<

    (defthm valuep-of-eval-<
      (b* ((result (eval-< x y)))
        (valuep result))
      :rule-classes :rewrite)

    Theorem: eval-<-of-value-fix-x

    (defthm eval-<-of-value-fix-x
      (equal (eval-< (value-fix x) y)
             (eval-< x y)))

    Theorem: eval-<-value-equiv-congruence-on-x

    (defthm eval-<-value-equiv-congruence-on-x
      (implies (value-equiv x x-equiv)
               (equal (eval-< x y) (eval-< x-equiv y)))
      :rule-classes :congruence)

    Theorem: eval-<-of-value-fix-y

    (defthm eval-<-of-value-fix-y
      (equal (eval-< x (value-fix y))
             (eval-< x y)))

    Theorem: eval-<-value-equiv-congruence-on-y

    (defthm eval-<-value-equiv-congruence-on-y
      (implies (value-equiv y y-equiv)
               (equal (eval-< x y) (eval-< x y-equiv)))
      :rule-classes :congruence)