• 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
        • Syntax-for-tools
        • Atc
          • Atc-implementation
            • Atc-abstract-syntax
            • Atc-pretty-printer
              • Pprint-expressions
              • Pprint-expr
              • Expr-grade
              • 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
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Bitcoin
        • Riscv
        • 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
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Atc-pretty-printer

    Expr-grade-index

    Signature
    (expr-grade-index grade) → index
    Arguments
    grade — Guard (expr-gradep grade).
    Returns
    index — Type (natp index).

    Definitions and Theorems

    Function: expr-grade-index

    (defun expr-grade-index (grade)
      (declare (xargs :guard (expr-gradep grade)))
      (let ((__function__ 'expr-grade-index))
        (declare (ignorable __function__))
        (expr-grade-case grade
                         :top 16
                         :assignment 15
                         :conditional 14
                         :logical-or 13
                         :logical-and 12
                         :ior 11
                         :xor 10
                         :and 9
                         :equality 8
                         :relational 7
                         :shift 6
                         :additive 5
                         :multiplicative 4
                         :cast 3
                         :unary 2
                         :postfix 1
                         :primary 0)))

    Theorem: natp-of-expr-grade-index

    (defthm natp-of-expr-grade-index
      (b* ((index (expr-grade-index grade)))
        (natp index))
      :rule-classes :rewrite)

    Theorem: expr-grade-index-of-expr-grade-fix-grade

    (defthm expr-grade-index-of-expr-grade-fix-grade
      (equal (expr-grade-index (expr-grade-fix grade))
             (expr-grade-index grade)))

    Theorem: expr-grade-index-expr-grade-equiv-congruence-on-grade

    (defthm expr-grade-index-expr-grade-equiv-congruence-on-grade
      (implies (expr-grade-equiv grade grade-equiv)
               (equal (expr-grade-index grade)
                      (expr-grade-index grade-equiv)))
      :rule-classes :congruence)