• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Pfcs
      • Wp-gen
      • Dimacs-reader
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Riscv
      • Bitcoin
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Poseidon
      • Where-do-i-place-my-book
      • Axe
      • Aleo
        • Aleobft
        • Aleovm
          • Circuits
          • Language
            • Grammar
            • Early-version
              • Abstract-syntax
                • Binary-op
                • Literal
                • Instruction
                  • Instructionp
                    • Instruction-fix
                    • Instruction-case
                    • Instruction-ternary
                    • Instruction-equiv
                    • Instruction-equal
                    • Instruction-commit
                    • Instruction-binary
                    • Instruction-unary
                    • Instruction-hash
                    • Instruction-cast
                    • Instruction-call
                    • Instruction-assert
                    • Instruction-kind
                  • Hash-op
                  • Literal-type
                  • Operand
                  • Unary-op
                  • Identifier
                  • Commit-op
                  • Mapping
                  • Function
                  • Programdef
                  • Finalize-type
                  • Closure
                  • Register-type
                  • Finalizer
                  • Value-type
                  • Record-type
                  • Command
                  • Plaintext-type
                  • Finalization-option
                  • Visibility
                  • Register
                  • Reference
                  • Programid
                  • Locator
                  • Finalization
                  • Entry-type
                  • Regaccess
                  • Program
                  • Interface-type
                  • Ident+ptype
                  • Ident+etype
                  • Function-output
                  • Finalize-output
                  • Finalize-input
                  • Closure-output
                  • Closure-input
                  • Assert-op
                  • Function-input
                  • Equal-op
                  • Finalize-command
                  • Ternary-op
                  • Import
                  • Ident+ptype-list
                  • Operand-list
                  • Ident+etype-list
                  • Programdef-list
                  • Instruction-list
                  • Import-list
                  • Identifier-list
                  • Function-output-list
                  • Function-input-list
                  • Finalize-output-list
                  • Finalize-input-list
                  • Command-list
                  • Closure-output-list
                  • Closure-input-list
                • Parser
                • Concrete-syntax
              • Concrete-syntax
          • Leo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Instruction

    Instructionp

    Recognizer for instruction structures.

    Signature
    (instructionp x) → *

    Definitions and Theorems

    Function: instructionp

    (defun instructionp (x)
      (declare (xargs :guard t))
      (let ((__function__ 'instructionp))
        (declare (ignorable __function__))
        (and (consp x)
             (cond ((or (atom x) (eq (car x) :unary))
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 3)
                         (b* ((op (std::da-nth 0 (cdr x)))
                              (arg (std::da-nth 1 (cdr x)))
                              (into (std::da-nth 2 (cdr x))))
                           (and (unary-opp op)
                                (operandp arg)
                                (registerp into)))))
                   ((eq (car x) :binary)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 4)
                         (b* ((op (std::da-nth 0 (cdr x)))
                              (arg1 (std::da-nth 1 (cdr x)))
                              (arg2 (std::da-nth 2 (cdr x)))
                              (into (std::da-nth 3 (cdr x))))
                           (and (binary-opp op)
                                (operandp arg1)
                                (operandp arg2)
                                (registerp into)))))
                   ((eq (car x) :ternary)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 5)
                         (b* ((op (std::da-nth 0 (cdr x)))
                              (arg1 (std::da-nth 1 (cdr x)))
                              (arg2 (std::da-nth 2 (cdr x)))
                              (arg3 (std::da-nth 3 (cdr x)))
                              (into (std::da-nth 4 (cdr x))))
                           (and (ternary-opp op)
                                (operandp arg1)
                                (operandp arg2)
                                (operandp arg3)
                                (registerp into)))))
                   ((eq (car x) :equal)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 4)
                         (b* ((op (std::da-nth 0 (cdr x)))
                              (arg1 (std::da-nth 1 (cdr x)))
                              (arg2 (std::da-nth 2 (cdr x)))
                              (into (std::da-nth 3 (cdr x))))
                           (and (equal-opp op)
                                (operandp arg1)
                                (operandp arg2)
                                (registerp into)))))
                   ((eq (car x) :assert)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 3)
                         (b* ((op (std::da-nth 0 (cdr x)))
                              (arg1 (std::da-nth 1 (cdr x)))
                              (arg2 (std::da-nth 2 (cdr x))))
                           (and (assert-opp op)
                                (operandp arg1)
                                (operandp arg2)))))
                   ((eq (car x) :commit)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 4)
                         (b* ((op (std::da-nth 0 (cdr x)))
                              (arg1 (std::da-nth 1 (cdr x)))
                              (arg2 (std::da-nth 2 (cdr x)))
                              (into (std::da-nth 3 (cdr x))))
                           (and (commit-opp op)
                                (operandp arg1)
                                (operandp arg2)
                                (registerp into)))))
                   ((eq (car x) :hash)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 3)
                         (b* ((op (std::da-nth 0 (cdr x)))
                              (arg (std::da-nth 1 (cdr x)))
                              (into (std::da-nth 2 (cdr x))))
                           (and (hash-opp op)
                                (operandp arg)
                                (registerp into)))))
                   ((eq (car x) :cast)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 3)
                         (b* ((args (std::da-nth 0 (cdr x)))
                              (into (std::da-nth 1 (cdr x)))
                              (as (std::da-nth 2 (cdr x))))
                           (and (operand-listp args)
                                (registerp into)
                                (register-typep as)))))
                   (t (and (eq (car x) :call)
                           (and (true-listp (cdr x))
                                (eql (len (cdr x)) 3))
                           (b* ((ref (std::da-nth 0 (cdr x)))
                                (args (std::da-nth 1 (cdr x)))
                                (into (std::da-nth 2 (cdr x))))
                             (and (referencep ref)
                                  (operand-listp args)
                                  (registerp into)))))))))

    Theorem: consp-when-instructionp

    (defthm consp-when-instructionp
      (implies (instructionp x) (consp x))
      :rule-classes :compound-recognizer)