• 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
                • Execution
                • Values
                • Dynamic-environments
                • Arithmetic-operations
                • Curve-parameterization
                • Shift-operations
                • Errors
                • Value-expressions
                • Locations
                  • Location
                    • Location-case
                    • Location-fix
                    • Location-count
                    • Location-equiv
                    • Locationp
                      • Location-tuple-comp
                      • Location-struct-comp
                      • Location-var
                      • Location-kind
                  • Input-execution
                  • Edwards-bls12-generator
                  • Equality-operations
                  • Logical-operations
                  • Program-execution
                  • Ordering-operations
                  • Bitwise-operations
                  • Literal-evaluation
                  • Type-maps-for-struct-components
                  • Output-execution
                  • Tuple-operations
                  • Struct-operations
                • Compilation
                • Static-semantics
                • Concrete-syntax
        • 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
    • Location

    Locationp

    Recognizer for location structures.

    Signature
    (locationp x) → *

    Definitions and Theorems

    Function: locationp

    (defun locationp (x)
      (declare (xargs :guard t))
      (let ((__function__ 'locationp))
        (declare (ignorable __function__))
        (and (consp x)
             (cond ((or (atom x) (eq (car x) :var))
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 1)
                         (b* ((name (std::da-nth 0 (cdr x))))
                           (identifierp name))))
                   ((eq (car x) :tuple-comp)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 2)
                         (b* ((tuple (std::da-nth 0 (cdr x)))
                              (index (std::da-nth 1 (cdr x))))
                           (and (locationp tuple) (natp index)))))
                   (t (and (eq (car x) :struct-comp)
                           (and (true-listp (cdr x))
                                (eql (len (cdr x)) 2))
                           (b* ((struct (std::da-nth 0 (cdr x)))
                                (name (std::da-nth 1 (cdr x))))
                             (and (locationp struct)
                                  (identifierp name)))))))))

    Theorem: consp-when-locationp

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