• 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
              • Check-expression-fns
              • Subtypep
              • Match-type
              • Check-product-update-expression
              • Get-builtin-function-in/out/pre-post
              • Check-sum-update-expression
              • Check-sum-field-expression
              • Check-strict-binary-expression
              • Check-lt/le/gt/ge-expression
              • Check-eq/ne-expression
              • Check-div/rem-expression
              • Check-add/sub/mul-expression
              • Align-let-vars-values
              • Check-iff-expression
              • Check-function-definition-top/nontop
              • Check-sum-construct-expression
              • Check-rem-expression
              • Check-mul-expression
              • Check-sub-expression
              • Check-div-expression
              • Check-add-expression
              • Check-ne-expression
              • Check-lt-expression
              • Check-le-expression
              • Check-gt-expression
              • Check-ge-expression
              • Check-eq-expression
              • Check-function-specifier
              • Type-result
              • Check-product-construct-expression
              • Supremum-type
              • Check-call-expression
              • Check-product-field-expression
              • Check-function-definer
              • Make-subproof-obligations
                • Get-function-in/out/pre/post
                • Check-sum-test-expression
                • Match-field
                • Decompose-expression
                • Match-to-target
                • Check-unary-expression
                • Max-supertype
                • Match-type-list
                • Check-minus-expression
                • Check-type-definition
                • Check-not-expression
                • Check-type-product
                • Match-field-list
                • Check-type-subset
                • Check-type-definition-in-recursion
                • Align-let-vars-values-aux
                • Non-trivial-proof-obligation
                • Check-type-recursion
                • Check-function-specification
                • Check-toplevel
                • Supremum-type-list
                • Check-component-expression
                • Check-branch-list
                • Check-function-recursion
                • Check-function-definition
                • Binding
                • Check-function-header
                • Check-function-definition-list
                • Check-type-definition-list-in-recursion
                • Check-theorem
                • Check-nonstrict-binary-expression
                • Context-add-variables
                • Decompose-expression-aux
                • Check-alternative
                • Check-multi-expression
                • Check-type-sum
                • Check-type
                • Check-alternative-list
                • Context-add-condition
                • Check-type-definer
                • Check-transform
                • Check-variable
                • Check-transform-args
                • Check-toplevel-list
                • Context-add-condition-list
                • Check-if/when/unless-expression
                • Initializers-to-variable-substitution
                • Context-add-binding
                • Check-function-header-list
                • Context-add-toplevel
                • Ensure-single-type
                • Max-supertypes
                • Check-bind-expression
                • Check-type-list
                • Check-literal
                • Literal-type
                • Check-expression-list
                • Variable-context
                • Check-cond-expression
                • Check-branch
                • Args-without-defaults
                • Check-expression
                • *builtin-function-names*
                • Function-called-in
              • Abstract-syntax
              • Outcome
              • Abstract-syntax-operations
              • 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
    • Static-semantics

    Make-subproof-obligations

    Create the obligations for a chain of subtypes.

    Signature
    (make-subproof-obligations variables hypotheses restrictions expr) 
      → 
    obligs
    Arguments
    variables — Guard (typed-variable-listp variables).
    hypotheses — Guard (obligation-hyp-listp hypotheses).
    restrictions — Guard (expression-listp restrictions).
    expr — Guard (expressionp expr).
    Returns
    obligs — Type (proof-obligation-listp obligs).

    This is used by match-type: see the documentation of that function for background.

    This function takes as inputs (i) the typed variables in context, (ii) the hypotheses in context, and (iii) the sequence of expressions that define the restrictions of each subtype in the chain, from the supremum of match-type's source and destination types down to the destination type, in the same order. This function returns as output a list of proof obligations, one for each of the expression in (iii) above: the obligation has that expression as conclusion, and as hypotheses has the ones in (ii) above, augmented by all the preceding type restriction expressions.

    Definitions and Theorems

    Function: make-subproof-obligations

    (defun make-subproof-obligations
           (variables hypotheses restrictions expr)
     (declare (xargs :guard (and (typed-variable-listp variables)
                                 (obligation-hyp-listp hypotheses)
                                 (expression-listp restrictions)
                                 (expressionp expr))))
     (let ((__function__ 'make-subproof-obligations))
      (declare (ignorable __function__))
      (cond
       ((endp restrictions) nil)
       (t
        (let
         ((oblig? (non-trivial-proof-obligation
                       variables hypotheses (car restrictions)
                       expr))
          (r-obligs
           (make-subproof-obligations
              variables
              (append
                   (obligation-hyp-list-fix hypotheses)
                   (list (obligation-hyp-condition (car restrictions))))
              (cdr restrictions)
              expr)))
         (append oblig? r-obligs))))))

    Theorem: proof-obligation-listp-of-make-subproof-obligations

    (defthm proof-obligation-listp-of-make-subproof-obligations
      (b*
        ((obligs
              (make-subproof-obligations variables
                                         hypotheses restrictions expr)))
        (proof-obligation-listp obligs))
      :rule-classes :rewrite)

    Theorem: make-subproof-obligations-of-typed-variable-list-fix-variables

    (defthm
         make-subproof-obligations-of-typed-variable-list-fix-variables
     (equal
          (make-subproof-obligations (typed-variable-list-fix variables)
                                     hypotheses restrictions expr)
          (make-subproof-obligations variables
                                     hypotheses restrictions expr)))

    Theorem: make-subproof-obligations-typed-variable-list-equiv-congruence-on-variables

    (defthm
     make-subproof-obligations-typed-variable-list-equiv-congruence-on-variables
     (implies
       (typed-variable-list-equiv variables variables-equiv)
       (equal (make-subproof-obligations
                   variables hypotheses restrictions expr)
              (make-subproof-obligations variables-equiv
                                         hypotheses restrictions expr)))
     :rule-classes :congruence)

    Theorem: make-subproof-obligations-of-obligation-hyp-list-fix-hypotheses

    (defthm
        make-subproof-obligations-of-obligation-hyp-list-fix-hypotheses
     (equal
         (make-subproof-obligations variables
                                    (obligation-hyp-list-fix hypotheses)
                                    restrictions expr)
         (make-subproof-obligations variables
                                    hypotheses restrictions expr)))

    Theorem: make-subproof-obligations-obligation-hyp-list-equiv-congruence-on-hypotheses

    (defthm
     make-subproof-obligations-obligation-hyp-list-equiv-congruence-on-hypotheses
     (implies
      (obligation-hyp-list-equiv hypotheses hypotheses-equiv)
      (equal
        (make-subproof-obligations
             variables hypotheses restrictions expr)
        (make-subproof-obligations variables
                                   hypotheses-equiv restrictions expr)))
     :rule-classes :congruence)

    Theorem: make-subproof-obligations-of-expression-list-fix-restrictions

    (defthm
          make-subproof-obligations-of-expression-list-fix-restrictions
      (equal
           (make-subproof-obligations variables hypotheses
                                      (expression-list-fix restrictions)
                                      expr)
           (make-subproof-obligations variables
                                      hypotheses restrictions expr)))

    Theorem: make-subproof-obligations-expression-list-equiv-congruence-on-restrictions

    (defthm
     make-subproof-obligations-expression-list-equiv-congruence-on-restrictions
     (implies
      (expression-list-equiv restrictions restrictions-equiv)
      (equal
        (make-subproof-obligations
             variables hypotheses restrictions expr)
        (make-subproof-obligations variables
                                   hypotheses restrictions-equiv expr)))
     :rule-classes :congruence)

    Theorem: make-subproof-obligations-of-expression-fix-expr

    (defthm make-subproof-obligations-of-expression-fix-expr
     (equal
          (make-subproof-obligations variables hypotheses
                                     restrictions (expression-fix expr))
          (make-subproof-obligations variables
                                     hypotheses restrictions expr)))

    Theorem: make-subproof-obligations-expression-equiv-congruence-on-expr

    (defthm
          make-subproof-obligations-expression-equiv-congruence-on-expr
     (implies
      (expression-equiv expr expr-equiv)
      (equal
        (make-subproof-obligations
             variables hypotheses restrictions expr)
        (make-subproof-obligations variables
                                   hypotheses restrictions expr-equiv)))
     :rule-classes :congruence)