• 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
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
        • Ethereum
        • Yul
        • Zcash
        • ACL2-programming-language
        • Prime-fields
        • Json
        • Syntheto
          • Process-syntheto-toplevel-fn
          • Translation
          • Language
            • Static-semantics
            • Abstract-syntax
            • Outcome
            • Abstract-syntax-operations
              • Subst-expression-fns
              • Field-list-to-typed-variable-list
              • Negate-expression
              • Get-function-definition-in-function-definitions
              • Get-function-definition
              • Get-type-definition-in-type-definitions
              • Get-type-definition
              • Get-function-specification
              • Get-type-subset
              • Get-alternative-product
              • Direct-supertype
              • Get-function-header-in-list
              • Equate-expression-lists
              • Get-field-type
              • Get-theorem
              • Get-defined-type-names-in-type-definitions
              • Disjoin-expressions
                • Conjoin-expressions
                • Get-type-product
                • Binary-op-nonstrictp
                • Get-type-sum
                • Get-defined-type-names
                • Equate-expressions
                • Field-to-typed-variable
                • Subst-expression
                • Binary-op-strictp
                • Initializer-list-from-flds-vals
                • Typed-variable-list->-expression-variable-list
                • Typed-variable-list->-expression
                • Variable-substitution
                • Local-variables
                • Identifier-list-names
                • Functions-called
                • Subst-expression-list
                • Subst-branch-list
                • Subst-branch
              • Outcome-list
              • Outcomes
            • Process-syntheto-toplevel
            • Shallow-embedding
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Abstract-syntax-operations

    Disjoin-expressions

    Disjoin a list of expressions.

    Signature
    (disjoin-expressions exprs) → disjoined-expression
    Arguments
    exprs — Guard (expression-listp exprs).
    Returns
    disjoined-expression — Type (expressionp disjoined-expression).

    Currently Syntheto's boolean disjunction operator is binary. Thus, to disjoin a list of expressions, we need to build a nest. If there are no expressions, we return the boolean literal for false. If there is one expression, we return it. If there are two or more expressions, we return a nest.

    Definitions and Theorems

    Function: disjoin-expressions

    (defun disjoin-expressions (exprs)
     (declare (xargs :guard (expression-listp exprs)))
     (let ((__function__ 'disjoin-expressions))
      (declare (ignorable __function__))
      (cond
           ((endp exprs)
            (expression-literal (literal-boolean nil)))
           ((endp (cdr exprs))
            (expression-fix (car exprs)))
           (t (make-expression-binary
                   :operator (binary-op-or)
                   :left-operand (car exprs)
                   :right-operand (disjoin-expressions (cdr exprs)))))))

    Theorem: expressionp-of-disjoin-expressions

    (defthm expressionp-of-disjoin-expressions
      (b* ((disjoined-expression (disjoin-expressions exprs)))
        (expressionp disjoined-expression))
      :rule-classes :rewrite)

    Theorem: disjoin-expressions-of-expression-list-fix-exprs

    (defthm disjoin-expressions-of-expression-list-fix-exprs
      (equal (disjoin-expressions (expression-list-fix exprs))
             (disjoin-expressions exprs)))

    Theorem: disjoin-expressions-expression-list-equiv-congruence-on-exprs

    (defthm
          disjoin-expressions-expression-list-equiv-congruence-on-exprs
      (implies (expression-list-equiv exprs exprs-equiv)
               (equal (disjoin-expressions exprs)
                      (disjoin-expressions exprs-equiv)))
      :rule-classes :congruence)