• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
          • Syntax-for-tools
          • Atc
            • Atc-implementation
              • Atc-abstract-syntax
              • Atc-pretty-printer
                • Pprint-expressions
                • Pprint-expr
                • Expr-grade
                  • Expr-grade-fix
                  • Expr-grade-case
                  • Expr-gradep
                    • Expr-grade-equiv
                    • Expr-grade-kind
                    • Expr-grade-xor
                    • Expr-grade-unary
                    • Expr-grade-top
                    • Expr-grade-shift
                    • Expr-grade-relational
                    • Expr-grade-primary
                    • Expr-grade-postfix
                    • Expr-grade-multiplicative
                    • Expr-grade-logical-or
                    • Expr-grade-logical-and
                    • Expr-grade-ior
                    • Expr-grade-equality
                    • Expr-grade-conditional
                    • Expr-grade-cast
                    • Expr-grade-assignment
                    • Expr-grade-and
                    • Expr-grade-additive
                  • Pprint-obj-declor
                  • Expr-grade-<=
                  • Binop-expected-grades
                  • Pprint-obj-declon
                  • Expr->grade
                  • Pprint-tyspecseq
                  • Pprint-tag-declon
                  • Pprint-struct-declon-list
                  • Pprint-fun-declor
                  • Pprint-file
                  • Pprint-stmt
                  • Pprint-struct-declon
                  • Pprint-obj-adeclor
                  • Pprint-initer
                  • Pprint-fun-declon
                  • Pprint-indent
                  • Pprint-hex-const
                  • Pprint-fileset
                  • Pprint-dec-const
                  • Pprinted-lines-to-file
                  • Pprint-tyname
                  • Pprint-param-declon-list
                  • Pprint-oct-const
                  • Pprint-iconst-length
                  • Pprint-iconst
                  • Pprint-const
                  • Expr-grade-index
                  • Pprint-param-declon
                  • Pprint-label
                  • Pprint-ident-list
                  • Pprint-binop
                  • Pprint-fundef
                  • Pprint-file-to-filesystem
                  • Pprint-ext-declon-list
                  • Pprint-unop
                  • Pprint-line
                  • Pprint-ident
                  • Pprint-ext-declon
                  • Pprint-comma-sep
                  • Pprint-transunit
                  • Pprint-one-line
                  • Pprinted-lines-to-channel
                  • Pprint-one-line-blank
                  • Pprint-line-blank
                • Atc-event-and-code-generation
                • Fty-pseudo-term-utilities
                • Atc-term-recognizers
                • Atc-input-processing
                • Atc-shallow-embedding
                • Atc-process-inputs-and-gen-everything
                • Atc-table
                • Atc-fn
                • Atc-pretty-printing-options
                • Atc-types
                • Atc-macro-definition
              • Atc-tutorial
            • Language
            • Representation
            • Transformation-tools
            • Insertion-sort
            • Pack
          • 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
    • 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) :assignment)
                    (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) :logical-or)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x) :logical-and)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x) :ior)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x) :xor)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x) :and)
                    (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) :relational)
                    (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) :cast)
                    (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)