• 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
          • Defisar
            • Defisar-implementation
              • Keyword-fact-info-alistp
              • Defisar-assume
              • Defisar-derive
              • Defisar-commands
              • Fact-infop
              • Defisar-qed
              • Defisar-let
                • Defisar-derive-thm-hyps
                • Defisar-proof
                • Defisar-fn
                • Fact-info-listp
                • Fact-info-list->thm-name-list
                • Defisar-formula-to-hyps+concl
                • Defisar-macro-definition-synonym
                • Defisar-macro-definition
          • 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
    • Defisar-implementation

    Defisar-let

    Execute a :let command.

    Signature
    (defisar-let let-args bindings ctx state) 
      → 
    (mv erp new-bindings state)
    Arguments
    bindings — Guard (symbol-alistp bindings).
    Returns
    new-bindings — Type (symbol-alistp new-bindings), given (symbol-alistp bindings).

    A :let command takes exactly one argument, which must be a list of a variable symbol and a term. The variable symbol must not be already bound. We do no check he term here: we implicitly check it when the bound variable is used.

    Definitions and Theorems

    Function: defisar-let

    (defun defisar-let (let-args bindings ctx state)
      (declare (xargs :stobjs (state)))
      (declare (xargs :guard (symbol-alistp bindings)))
      (let ((__function__ 'defisar-let))
        (declare (ignorable __function__))
        (b* (((unless (tuplep 1 let-args))
              (er-soft+ ctx
                        t nil "Malformed :LET arguments ~x0."
                        let-args))
             (let-var+term (car let-args))
             ((unless (tuplep 2 let-var+term))
              (er-soft+ ctx t nil "Malformed :LET argument ~x0."
                        let-var+term))
             (let-var (first let-var+term))
             (let-term (second let-var+term))
             ((unless (symbolp let-var))
              (er-soft+ ctx t
                        nil "The variable ~x0 must be a symbol."
                        let-var))
             ((when (consp (assoc-eq let-var bindings)))
              (er-soft+ ctx t
                        nil "Duplicate variable ~x0." let-var)))
          (value (acons let-var let-term bindings)))))

    Theorem: symbol-alistp-of-defisar-let.new-bindings

    (defthm symbol-alistp-of-defisar-let.new-bindings
      (implies (symbol-alistp bindings)
               (b* (((mv ?erp ?new-bindings acl2::?state)
                     (defisar-let let-args bindings ctx state)))
                 (symbol-alistp new-bindings)))
      :rule-classes :rewrite)