• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • Riscv
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • 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
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • 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)