• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
          • Simplify-defun
          • Isodata
          • Tailrec
          • Schemalg
            • Schemalg-implementation
              • Schemalg-event-generation
                • Schemalg-gen-everything
                • Schemalg-gen-x-z1...zm
                • Schemalg-gen-old-if-new
                • Schemalg-gen-equal-algo
                • Schemalg-gen-algo-divconq-list-0-1-2
                • Schemalg-gen-algo-correct-divconq-list-0-1-2
                • Schemalg-gen-algo-correct-divconq-list-0-1
                • Schemalg-gen-spec-2
                  • Schemalg-gen-algo-correct-divconq-oset-0-1
                  • Schemalg-gen-algo-correct
                  • Schemalg-gen-algo-divconq-oset-0-1
                  • Schemalg-gen-spec-1-divconq-oset-0-1
                  • Schemalg-gen-spec-1-divconq-list-0-1
                  • Schemalg-gen-algo-divconq-list-0-1
                  • Schemalg-gen-algo
                  • Schemalg-gen-spec-1
                  • Schemalg-gen-spec-1-divconq-list-0-1-2
                  • Schemalg-gen-spec-0
                  • Schemalg-gen-spec-0-divconq-oset-0-1
                  • Schemalg-gen-spec-0-divconq-list-0-1-2
                  • Schemalg-gen-spec-0-divconq-list-0-1
                  • Schemalg-gen-new
                  • Schemalg-gen-?f1...?fp
                  • Schemalg-gen-x-z1...zm-aux
                • Schemalg-fn
                • Schemalg-macro-definition
                • Schemalg-input-processing
              • Schemalg-divconq-oset-0-1
              • Schemalg-divconq-list-0-1
            • Restrict
            • Expdata
            • Casesplit
            • Simplify-term
            • 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
    • Schemalg-event-generation

    Schemalg-gen-spec-2

    Generate the function spec-2[?h].

    Signature
    (schemalg-gen-spec-2 schema spec-2 
                         spec-2-enable old x-x1...xn x-a1...am 
                         x y iorel ?h verify-guards wrld) 
     
      → 
    (mv local-event exported-event)
    Arguments
    schema — Guard (keywordp schema).
    spec-2 — Guard (symbolp spec-2).
    spec-2-enable — Guard (booleanp spec-2-enable).
    old — Guard (symbolp old).
    x-x1...xn — Guard (symbol-listp x-x1...xn).
    x-a1...am — Guard (pseudo-term-listp x-a1...am).
    x — Guard (symbolp x).
    y — Guard (symbolp y).
    iorel — Guard (pseudo-lambdap iorel).
    ?h — Guard (symbolp ?h).
    verify-guards — Guard (booleanp verify-guards).
    wrld — Guard (plist-worldp wrld).
    Returns
    local-event — A pseudo-event-formp.
    exported-event — A pseudo-event-formp.

    Definitions and Theorems

    Function: schemalg-gen-spec-2

    (defun schemalg-gen-spec-2
           (schema spec-2
                   spec-2-enable old x-x1...xn x-a1...am
                   x y iorel ?h verify-guards wrld)
     (declare (xargs :guard (and (keywordp schema)
                                 (symbolp spec-2)
                                 (booleanp spec-2-enable)
                                 (symbolp old)
                                 (symbol-listp x-x1...xn)
                                 (pseudo-term-listp x-a1...am)
                                 (symbolp x)
                                 (symbolp y)
                                 (pseudo-lambdap iorel)
                                 (symbolp ?h)
                                 (booleanp verify-guards)
                                 (plist-worldp wrld))))
     (let ((__function__ 'schemalg-gen-spec-2))
      (declare (ignorable __function__))
      (case schema
       (:divconq-list-0-1
            (prog2$ (raise "Internal error: schema is ~x0." schema)
                    (mv '(irrelevant) '(irrelevant))))
       (:divconq-list-0-1-2
        (b*
         ((cdr-x-x1...xn (loop$ for var in x-x1...xn collect
                                (if (eq var x) (list 'cdr var) var)))
          (car-x-a1...am (loop$ for term in x-a1...am collect
                                (if (eq term x) (list 'car term) term)))
          (iorel-term1
               (apply-term iorel (append cdr-x-x1...xn (list y))))
          (??h-call (cons ?h
                          (append car-x-a1...am (cons y 'nil))))
          (iorel-term2 (apply-term iorel
                                   (append x-x1...xn (list ?h-call))))
          (iorel-term1 (untranslate iorel-term1 t wrld))
          (iorel-term2 (untranslate iorel-term2 t wrld)))
         (evmac-generate-soft-defun-sk2
          spec-2
          :formals nil
          :guard t
          :body
          (cons
           'forall
           (cons
            (append x-x1...xn (cons y 'nil))
            (cons
             (cons
              'impliez
              (cons
               (cons
                'and
                (cons (cons 'consp (cons x 'nil))
                      (cons (cons 'consp
                                  (cons (cons 'cdr (cons x 'nil)) 'nil))
                            (cons iorel-term1 'nil))))
               (cons iorel-term2 'nil)))
             'nil)))
          :verify-guards verify-guards
          :enable spec-2-enable
          :guard-hints
          (cons (cons '"Goal"
                      (cons ':use
                            (cons (cons ':guard-theorem (cons old 'nil))
                                  'nil)))
                'nil))))
       (:divconq-oset-0-1
            (prog2$ (raise "Internal error: schema is ~x0." schema)
                    (mv '(irrelevant) '(irrelevant))))
       (t (prog2$ (raise "Internal error: unknown schema ~x0."
                         schema)
                  (mv '(irrelevant) '(irrelevant)))))))