• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • 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-process-inputs
                • Schemalg-process-schema-inputs
                • Schemalg-process-divconq-list-0-1-2-inputs
                • Schemalg-process-divconq-oset-0-1-inputs
                • Schemalg-process-divconq-list-0-1-inputs
                • Schemalg-process-algo-name
                • Schemalg-process-oset-input
                • Schemalg-process-list-input
                • Schemalg-check-allowed-input
                  • Schemalg-process-tail-output
                  • Schemalg-process-cdr-output
                  • Schemalg-process-spec-2-name
                  • Schemalg-process-spec-1-name
                  • Schemalg-process-spec-0-name
                  • Schemalg-process-equal-algo-name
                  • Schemalg-process-fvar-2-name
                  • Schemalg-process-fvar-1-name
                  • Schemalg-process-fvar-0-name
                  • Schemalg-process-schema
                  • Schemalg-process-algo-name-aux
                  • *schemalg-schemas*
              • 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-input-processing

    Schemalg-check-allowed-input

    Check whether an input is allowed for the current schema.

    This macro produces a term, to be bound to (er &) in a b*, that checks whether, if an input is present, the keyword in the variable schema is among a list of allowed schemas. The input? argument must be the a variable that contains the boolean flag saying whether a certain input is present or not; the name of this variable must be the name of the input followed by a ?. The schemas-allowed arguments must be schemas for which the input is question may be present.

    Macro: schemalg-check-allowed-input

    (defmacro schemalg-check-allowed-input
              (input? &rest schemas-allowed)
     (declare (xargs :guard (and (symbolp input?)
                                 (keyword-listp schemas-allowed))))
     (cons
      'if
      (cons
       (cons
        'and
        (cons
         input?
         (cons
              (cons 'not
                    (cons (cons 'member-eq
                                (cons 'schema
                                      (cons (cons 'list schemas-allowed)
                                            'nil)))
                          'nil))
              'nil)))
       (cons
        (cons
         'er-soft+
         (cons
          'ctx
          (cons
           't
           (cons
            'nil
            (cons
             '"The ~x0 input can be present only if ~
                      the :SCHEMA input is ~v1, but that input is ~x2 instead."
             (cons
               (b*
                 ((input?-string (symbol-name input?))
                  (input-string (subseq input?-string
                                        0 (1- (length input?-string)))))
                 (intern input-string "KEYWORD"))
               (cons (cons 'list schemas-allowed)
                     '(schema))))))))
        '((value nil))))))