• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • Java
      • Riscv
      • Taspi
      • Bitcoin
      • Zcash
      • Des
      • X86isa
      • Sha-2
      • Yul
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
        • Primitive-functions
        • Translated-terms
        • Values
          • Value
          • Symbol-value
          • Lower-symbol
          • Lift-symbol-list
          • Symbol-value-option
          • Value-option
          • Lift-value
          • Lift-symbol
          • Value-rational->get
            • Value-integer->get
            • Value-case-rational
            • Value-case-integer
            • Value-symbol-list
            • Lower-value
            • Value-list-of
            • Value-list
            • Symbol-value-list
            • Symbol-value-set
            • Value-t
            • Value-nil
          • Evaluation
          • Program-equivalence
          • Functions
          • Packages
          • Programs
          • Interpreter
          • Evaluation-states
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Axe
        • Poseidon
        • Where-do-i-place-my-book
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Values

    Value-rational->get

    Return the ACL2 rational from its meta representation.

    Signature
    (value-rational->get x) → x-rational
    Arguments
    x — Guard (and (valuep x) (value-case-rational x)).
    Returns
    x-rational — Type (rationalp x-rational).

    The name of this function is analogous to the accessor value-number->get of the fixtype of values.

    Definitions and Theorems

    Function: value-rational->get

    (defun value-rational->get (x)
      (declare (xargs :guard (and (valuep x)
                                  (value-case-rational x))))
      (let ((__function__ 'value-rational->get))
        (declare (ignorable __function__))
        (if (mbt (value-case-rational (value-fix x)))
            (value-number->get (value-fix x))
          0)))

    Theorem: rationalp-of-value-rational->get

    (defthm rationalp-of-value-rational->get
      (b* ((x-rational (value-rational->get x)))
        (rationalp x-rational))
      :rule-classes :rewrite)

    Theorem: value-rational->get-of-value-fix-x

    (defthm value-rational->get-of-value-fix-x
      (equal (value-rational->get (value-fix x))
             (value-rational->get x)))

    Theorem: value-rational->get-value-equiv-congruence-on-x

    (defthm value-rational->get-value-equiv-congruence-on-x
      (implies (value-equiv x x-equiv)
               (equal (value-rational->get x)
                      (value-rational->get x-equiv)))
      :rule-classes :congruence)