• 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
            • Schemalg-implementation
              • Schemalg-event-generation
              • 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-implementation

    Schemalg-fn

    Check redundancy, process the inputs, and generate the event.

    Signature
    (schemalg-fn old schema schema? 
                 list-input list-input? oset-input 
                 oset-input? cdr-output cdr-output? 
                 tail-output tail-output? fvar-0-name 
                 fvar-0-name? fvar-1-name fvar-1-name? 
                 fvar-2-name fvar-2-name? algo-name 
                 algo-enable spec-0-name spec-0-name? 
                 spec-0-enable spec-0-enable? 
                 spec-1-name spec-1-name? spec-1-enable 
                 spec-1-enable? spec-2-name spec-2-name? 
                 spec-2-enable spec-2-enable? 
                 equal-algo-name equal-algo-enable 
                 new-name new-enable old-if-new-name 
                 old-if-new-name? old-if-new-enable 
                 old-if-new-enable? verify-guards 
                 print show-only call ctx state) 
     
      → 
    (mv erp event state)
    Arguments
    schema? — Guard (booleanp schema?).
    list-input? — Guard (booleanp list-input?).
    oset-input? — Guard (booleanp oset-input?).
    cdr-output? — Guard (booleanp cdr-output?).
    tail-output? — Guard (booleanp tail-output?).
    fvar-0-name? — Guard (booleanp fvar-0-name?).
    fvar-1-name? — Guard (booleanp fvar-1-name?).
    fvar-2-name? — Guard (booleanp fvar-2-name?).
    spec-0-name? — Guard (booleanp spec-0-name?).
    spec-0-enable? — Guard (booleanp spec-0-enable?).
    spec-1-name? — Guard (booleanp spec-1-name?).
    spec-1-enable? — Guard (booleanp spec-1-enable?).
    spec-2-name? — Guard (booleanp spec-2-name?).
    spec-2-enable? — Guard (booleanp spec-2-enable?).
    old-if-new-name? — Guard (booleanp old-if-new-name?).
    old-if-new-enable? — Guard (booleanp old-if-new-enable?).
    call — Guard (pseudo-event-formp call).
    Returns
    event — A pseudo-event-formp.

    Definitions and Theorems

    Function: schemalg-fn

    (defun schemalg-fn (old schema schema?
                            list-input list-input? oset-input
                            oset-input? cdr-output cdr-output?
                            tail-output tail-output? fvar-0-name
                            fvar-0-name? fvar-1-name fvar-1-name?
                            fvar-2-name fvar-2-name? algo-name
                            algo-enable spec-0-name spec-0-name?
                            spec-0-enable spec-0-enable?
                            spec-1-name spec-1-name? spec-1-enable
                            spec-1-enable? spec-2-name spec-2-name?
                            spec-2-enable spec-2-enable?
                            equal-algo-name equal-algo-enable
                            new-name new-enable old-if-new-name
                            old-if-new-name? old-if-new-enable
                            old-if-new-enable? verify-guards
                            print show-only call ctx state)
      (declare (xargs :stobjs (state)))
      (declare (xargs :guard (and (booleanp schema?)
                                  (booleanp list-input?)
                                  (booleanp oset-input?)
                                  (booleanp cdr-output?)
                                  (booleanp tail-output?)
                                  (booleanp fvar-0-name?)
                                  (booleanp fvar-1-name?)
                                  (booleanp fvar-2-name?)
                                  (booleanp spec-0-name?)
                                  (booleanp spec-0-enable?)
                                  (booleanp spec-1-name?)
                                  (booleanp spec-1-enable?)
                                  (booleanp spec-2-name?)
                                  (booleanp spec-2-enable?)
                                  (booleanp old-if-new-name?)
                                  (booleanp old-if-new-enable?)
                                  (pseudo-event-formp call))))
      (let ((__function__ 'schemalg-fn))
        (declare (ignorable __function__))
        (b* ((encapsulate?
                  (previous-transformation-expansion call (w state)))
             ((when encapsulate?)
              (b* (((run-when show-only)
                    (cw "~x0~|" encapsulate?)))
                (cw "~%The transformation ~x0 is redundant.~%"
                    call)
                (value '(value-triple :invisible))))
             ((er (list old ??f x-x1...xn x-a1...am
                        & iorel x y ??g ??g0 ??g1 ??h ??f1...?fp
                        algo spec-0 spec-1 spec-2 equal-algo new
                        new-enable old-if-new old-if-new-enable
                        verify-guards names-to-avoid))
              (schemalg-process-inputs
                   old schema schema?
                   list-input list-input? oset-input
                   oset-input? cdr-output cdr-output?
                   tail-output tail-output? fvar-0-name
                   fvar-0-name? fvar-1-name fvar-1-name?
                   fvar-2-name fvar-2-name? algo-name
                   algo-enable spec-0-name spec-0-name?
                   spec-0-enable spec-0-enable?
                   spec-1-name spec-1-name? spec-1-enable
                   spec-1-enable? spec-2-name spec-2-name?
                   spec-2-enable spec-2-enable?
                   equal-algo-name equal-algo-enable
                   new-name new-enable old-if-new-name
                   old-if-new-name? old-if-new-enable
                   old-if-new-enable? verify-guards
                   print show-only ctx state))
             (event (schemalg-gen-everything
                         old ?f x-x1...xn x-a1...am
                         x y iorel schema ?g ?g0 ?g1 ?h algo
                         algo-enable spec-0 spec-0-enable spec-1
                         spec-1-enable spec-2 spec-2-enable
                         equal-algo equal-algo-enable new
                         new-enable old-if-new old-if-new-enable
                         verify-guards print show-only
                         call names-to-avoid (w state))))
          (value event))))