• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
      • Ipasir
      • Aignet
        • Base-api
        • Aignet-construction
        • Representation
          • Aignet-impl
          • Node
            • Node-fix
            • Node-p
            • Node-equiv
            • Gate-node->fanin1
            • Gate-node->fanin0
            • Co-node->fanin
            • Stype
              • Nxst-node
              • Node->type
              • Node->regp
              • Xor-node
              • And-node
              • Po-node
              • Proper-node-p
              • Reg-node
              • Pi-node
              • Const-node
            • Network
            • Combinational-type
            • Stypep
            • Typecode
          • Aignet-copy-init
          • Aignet-simplify-marked-with-tracking
          • Aignet-cnf
          • Aignet-simplify-with-tracking
          • Aignet-complete-copy
          • Aignet-eval
          • Semantics
          • Aignet-transforms
          • Aignet-simplify-marked
          • Aignet-read-aiger
          • Aignet-write-aiger
          • Aignet-abc-interface
          • Utilities
        • Aig
        • Satlink
        • Truth
        • Ubdds
        • Bdd
        • Faig
        • Bed
        • 4v
      • Debugging
      • Projects
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Node

    Stype

    Get the kind (tag) of a node structure.

    Signature
    (stype x) → kind
    Arguments
    x — Guard (node-p x).

    Definitions and Theorems

    Function: stype$inline

    (defun stype$inline (x)
           (declare (xargs :guard (node-p x)))
           (let ((__function__ 'stype))
                (declare (ignorable __function__))
                (mbe :logic (cond ((or (atom x)
                                       (not (stypep (car x)))
                                       (eq (car x) :const))
                                   :const)
                                  ((eq (car x) :pi) :pi)
                                  ((eq (car x) :reg) :reg)
                                  ((eq (car x) :and) :and)
                                  ((eq (car x) :xor) :xor)
                                  ((eq (car x) :po) :po)
                                  ((eq (car x) :nxst) :nxst))
                     :exec (if (atom x)
                               :const (stype-fix (car x))))))

    Theorem: stype-possibilities

    (defthm
         stype-possibilities
         (or (equal (stype x) :const)
             (equal (stype x) :pi)
             (equal (stype x) :reg)
             (equal (stype x) :and)
             (equal (stype x) :xor)
             (equal (stype x) :po)
             (equal (stype x) :nxst))
         :rule-classes ((:forward-chaining :trigger-terms ((stype x)))))

    Theorem: stypep-of-stype

    (defthm stypep-of-stype (stypep (stype x)))

    Theorem: stype-not-const-implies-nonempty

    (defthm stype-not-const-implies-nonempty
            (implies (not (equal (stype (car x)) (const-stype)))
                     (consp x))
            :rule-classes
            ((:forward-chaining :trigger-terms ((stype (car x))))))