• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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
        • C
        • Soft
        • Bv
        • Imp-language
        • Ethereum
        • Event-macros
        • Java
          • Atj
            • Atj-implementation
              • Atj-types
                • Atj-type-<=
                • Atj-function-type
                • Atj-type-to-jitype
                • Atj-type
                • Atj-function-type-of-min-input-types
                • Atj-type-top-join
                • Atj-atype
                • Atj-type-bottom-meet
                  • Atj-type-bottom-<=
                  • Atj-type-top-<=
                  • Atj-type-top-list-join
                  • Atj-type-bottom-list-<=
                  • Atj-type-top-list-<=
                  • Atj-type-bottom-list-meet
                  • Atj-type-list-<=
                  • Atj-type-to-pred
                  • Atj-maybe-function-type-info
                  • Atj-atype-<=
                  • Atj-maybe-function-type
                  • Atj-maybe-type
                  • Atj-type-to-keyword
                  • Atj-function-type-info
                  • Atj-type-list-join
                  • Atj-type-list-to-type
                  • Atj-type-list-<
                  • Atj-type-list-meet
                  • Atj-type-from-keyword
                  • Atj-function-type-of-min-input-types-aux
                  • Atj-type-<
                  • Atj-type-list-to-type-list-list
                  • Atj-number-of-results
                  • Atj-function-type-info-default
                  • Atj-type-to-pred-gen-mono-thms-2
                  • Atj-get-function-type-info-from-table
                  • Atj-get-function-type-info
                  • Atj-type-to-pred-gen-mono-thms-1
                  • Atj-type-to-pred-gen-mono-thm
                  • Atj-type-meet
                  • Atj-type-to-type-list
                  • Atj-type-list-to-jitype-list
                  • Atj-type-join
                  • Atj-type-of-value
                  • Atj-type-list-to-keyword-list
                  • Atj-type-semilattices
                  • Atj-type-to-pred-gen-mono-thms
                  • Atj-function-type-info->outputs
                  • Atj-function-type-list->outputs
                  • Atj-function-type-list->inputs
                  • Atj-type-list-from-keyword-list
                  • Atj-type-irrelevant
                  • Atj-symbol-type-alist
                  • Atj-type-list
                  • Atj-function-type-list
                  • Atj-type-list-list
                  • Atj-maybe-type-list
                  • Atj-function-type-info-table
                  • *atj-function-type-info-table-name*
                • Atj-java-primitive-array-model
                • Atj-java-abstract-syntax
                • Atj-input-processing
                • Atj-java-pretty-printer
                • Atj-code-generation
                • Atj-java-primitives
                • Atj-java-primitive-arrays
                • Atj-type-macros
                • Atj-java-syntax-operations
                • Atj-fn
                • Atj-library-extensions
                • Atj-java-input-types
                • Atj-test-structures
                • Aij-notions
                • Atj-macro-definition
              • Atj-tutorial
            • Aij
            • Language
          • Riscv
          • Bitcoin
          • Zcash
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Atj-types

    Atj-type-bottom-meet

    Greatest lower bound of two ATJ types or nils, with respect to the partial order atj-type-bottom-<=.

    Signature
    (atj-type-bottom-meet x y) → glb
    Arguments
    x — Guard (atj-maybe-typep x).
    y — Guard (atj-maybe-typep y).
    Returns
    glb — Type (atj-maybe-typep glb).

    As discussed in atj-type-bottom-<=, the addition of nil as bottom element of the partial order results in a meet semilattice.

    We define this operation by three cases: the first two are obvious, and the third one suffices because no element of the semilattice has more than one elements that are strictly larger.

    To validate this definition of greatest lower bound, we prove that the this operation indeed returns a lower bound that is greater than or equal to any other lower bound, i.e. that it returns the greatest lower bound.

    The commutativity, idempotence, and associativity of the join operation follows from these and the partial order properties, according to lattice theory. So we do not prove these properties explicitly here.

    Definitions and Theorems

    Function: atj-type-bottom-meet

    (defun atj-type-bottom-meet (x y)
      (declare (xargs :guard (and (atj-maybe-typep x)
                                  (atj-maybe-typep y))))
      (let ((__function__ 'atj-type-bottom-meet))
        (declare (ignorable __function__))
        (cond ((atj-type-bottom-<= x y)
               (atj-maybe-type-fix x))
              ((atj-type-bottom-<= y x)
               (atj-maybe-type-fix y))
              (t nil))))

    Theorem: atj-maybe-typep-of-atj-type-bottom-meet

    (defthm atj-maybe-typep-of-atj-type-bottom-meet
      (b* ((glb (atj-type-bottom-meet x y)))
        (atj-maybe-typep glb))
      :rule-classes :rewrite)

    Theorem: atj-type-bottom-meet-lower-bound-left

    (defthm atj-type-bottom-meet-lower-bound-left
      (atj-type-bottom-<= (atj-type-bottom-meet x y)
                          x))

    Theorem: atj-type-bottom-meet-lower-bound-right

    (defthm atj-type-bottom-meet-lower-bound-right
      (atj-type-bottom-<= (atj-type-bottom-meet x y)
                          y))

    Theorem: atj-type-bottom-meet-greatest

    (defthm atj-type-bottom-meet-greatest
      (implies (and (atj-type-bottom-<= z x)
                    (atj-type-bottom-<= z y))
               (atj-type-bottom-<= z (atj-type-bottom-meet x y))))

    Theorem: atj-type-bottom-meet-of-atj-maybe-type-fix-x

    (defthm atj-type-bottom-meet-of-atj-maybe-type-fix-x
      (equal (atj-type-bottom-meet (atj-maybe-type-fix x)
                                   y)
             (atj-type-bottom-meet x y)))

    Theorem: atj-type-bottom-meet-atj-maybe-type-equiv-congruence-on-x

    (defthm atj-type-bottom-meet-atj-maybe-type-equiv-congruence-on-x
      (implies (atj-maybe-type-equiv x x-equiv)
               (equal (atj-type-bottom-meet x y)
                      (atj-type-bottom-meet x-equiv y)))
      :rule-classes :congruence)

    Theorem: atj-type-bottom-meet-of-atj-maybe-type-fix-y

    (defthm atj-type-bottom-meet-of-atj-maybe-type-fix-y
      (equal (atj-type-bottom-meet x (atj-maybe-type-fix y))
             (atj-type-bottom-meet x y)))

    Theorem: atj-type-bottom-meet-atj-maybe-type-equiv-congruence-on-y

    (defthm atj-type-bottom-meet-atj-maybe-type-equiv-congruence-on-y
      (implies (atj-maybe-type-equiv y y-equiv)
               (equal (atj-type-bottom-meet x y)
                      (atj-type-bottom-meet x y-equiv)))
      :rule-classes :congruence)