• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
          • Simplify-defun
          • Isodata
          • Tailrec
          • Schemalg
          • Restrict
          • Expdata
          • Casesplit
          • Simplify-term
            • Simplify-term-examples
            • Simplify-defun-sk
            • Parteval
            • Solve
            • Wrap-output
            • Propagate-iso
            • Simplify
            • Finite-difference
            • Drop-irrelevant-params
            • Copy-function
            • Lift-iso
            • Rename-params
            • Utilities
            • Simplify-term-programmatic
            • Simplify-defun-sk-programmatic
            • Simplify-defun-programmatic
            • Simplify-defun+
            • Common-options
            • Common-concepts
          • Error-checking
          • Fty-extensions
          • Isar
          • Kestrel-utilities
          • Set
          • Soft
          • C
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • 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
    • Simplify-term

    Simplify-term-examples

    Examples illustrating simplify-term.

    The examples below are deliberately quite trivial, in order to show how simplify-term behaves with some keyword arguments. For all those examples, we assume that the following event has already been evaluated.

    (defun f (x) (+ 3 -3 (car x)))

    The results in the log below are intended to follow clearly from the keyword arguments supplied in the respective invocations of simplify-term, which we invoke here with simplify.

    ACL2 !>(simplify (f (cons y z))
                     :disable (car-cons)
                     :thm-enable nil)
    (DEFTHMD SIMPLIFY-TERM-THM
             (EQUAL (F (CONS Y Z))
                    (IF (ACL2-NUMBERP (CAR (CONS Y Z)))
                        (CAR (CONS Y Z))
                        0)))
    ACL2 !>(simplify (f (cons y z))
                     :thm-name f1
                     :assumptions ((natp y)))
    (DEFTHM F1 (IMPLIES (NATP Y) (EQUAL (F (CONS Y Z)) Y)))
    ACL2 !>(simplify (f (cons (+ 7 y) z))
                     :thm-name f2
                     :untranslate nil)
    (DEFTHM F2 (EQUAL (F (CONS (+ 7 Y) Z)) (BINARY-+ '7 Y)))
    ACL2 !>