• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Riscv
      • Taspi
      • 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
        • Leo
          • Grammar
          • Early-version
            • Json2ast
            • Testing
            • Definition
              • Flattening
              • Abstract-syntax
              • Dynamic-semantics
              • Compilation
              • Static-semantics
              • Concrete-syntax
                • Pretty-printer
                  • Pprint-expression-algorithm
                  • Expr-grade
                    • Expr-grade-fix
                    • Expr-grade-case
                    • Expr-gradep
                      • Expr-grade-equiv
                      • Expr-grade-kind
                      • Expr-grade-unary
                      • Expr-grade-top
                      • Expr-grade-shift
                      • Expr-grade-primary
                      • Expr-grade-postfix
                      • Expr-grade-ordering
                      • Expr-grade-multiplicative
                      • Expr-grade-exponential
                      • Expr-grade-equality
                      • Expr-grade-disjunctive
                      • Expr-grade-conjunctive
                      • Expr-grade-conditional
                      • Expr-grade-bitwise-xor
                      • Expr-grade-bitwise-ior
                      • Expr-grade-bitwise-and
                      • Expr-grade-additive
                    • Pprint-expression
                    • Expr-grade-<=
                    • Binop-expected-grades
                    • Expr->grade
                    • Pprint-char
                    • Pprint-console
                    • Pprint-var/const-sort
                    • Pprint-indent
                    • Pprint-constdecl
                    • Pprint-vardecl
                    • Pprint-statement
                    • Pprint-type
                    • *binops-opcall-print-names*
                    • Pprint-programdecl
                    • Pprint-line
                    • Pprint-group-literal
                    • Pprint-funparam-list
                    • *unops-opcall-print-names*
                    • Pprint-literal
                    • Pprint-coordinate
                    • Pprint-char-list
                    • Pprint-bitsize-to-utype
                    • Pprint-bitsize-to-itype
                    • Expr-grade-index
                    • Pprint-unop
                    • Pprint-programid
                    • Pprint-importdecl
                    • Pprint-identifier
                    • Pprint-funparam
                    • Pprint-compdecl
                    • Pprint-binop
                    • Pprint-locator
                    • Pprint-compdecl-list
                    • Pprint-address
                    • Pprint-structdecl
                    • Pprint-natural
                    • Pprint-mappingdecl
                    • Pprint-integer
                    • Pprint-fundecl
                    • Pprint-comma-separated
                    • Pprint-boolean
                    • Pprint-annotation-list
                    • Pprint-topdecl-list
                    • Pprint-importdecl-list
                    • Pprint-topdecl
                    • Pprint-annotation
                    • Pprint-file
                    • Pprint-line-blank
                  • Grammar
                  • Lexing-and-parsing
                  • Input-pretty-printer
                  • Output-pretty-printer
                  • Unicode-characters
                  • Concrete-syntax-trees
                  • Symbols
                  • Keywords
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Expr-grade

    Expr-gradep

    Recognizer for expr-grade structures.

    Signature
    (expr-gradep x) → *

    Definitions and Theorems

    Function: expr-gradep

    (defun expr-gradep (x)
      (declare (xargs :guard t))
      (let ((__function__ 'expr-gradep))
        (declare (ignorable __function__))
        (and (consp x)
             (cond ((or (atom x) (eq (car x) :top))
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x) :conditional)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x) :disjunctive)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x) :conjunctive)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x) :equality)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x) :ordering)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x) :bitwise-xor)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x) :bitwise-ior)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x) :bitwise-and)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x) :shift)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x) :additive)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x) :multiplicative)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x) :exponential)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x) :unary)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x) :postfix)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   (t (and (eq (car x) :primary)
                           (and (true-listp (cdr x))
                                (eql (len (cdr x)) 0))
                           (b* nil t)))))))

    Theorem: consp-when-expr-gradep

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