Documentation

Examples.Language.ProductLists

Ordinary products in linked lists #

Product constructors and matches compose actual field-chain operations. The source contracts retain shared tails and old array contents; ordinary proofs use Lean lists. These contracts do not supply list RAM-input encodings or complete caller time bounds.

Ordinary arguments and the actual result observed in their real source heaps. This interface does not assert the existence of a total mathematical model.

Equations
  • One or more equations did not get rendered due to their size.
Instances For

    Actual imported function bodies with their internal calls relocated.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      Fold an actual source invocation back to its named ordinary-argument observation.

      Automatic correspondence for the same generated source function, without a machine budget.

      theorem Complexity.Examples.ProductLists.Linked.naturalPair_contract_iff_triple (pre✝ : ℕ × ℕ → Language.Heap → Prop) (post✝ : ℕ × ℕ → Language.Heap → Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat) → Language.Heap → Prop) :
      naturalPair_contract pre✝ post✝ ↔ ∀ (head : ℕ × ℕ) (initialHeap : Language.Heap), ⦃fun (currentHeap : Language.Heap) => { down := currentHeap = initialHeap ∧ pre✝ head initialHeap }⦄ naturalPair head ⦃(fun (value : Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) (finalHeap : Language.Heap) => { down := post✝ head initialHeap value finalHeap }, fun (x : Language.Fault) (x_1 : Language.Heap) => { down := False }, PUnit.unit)⦄

      Prove the ordinary-parameter source contract with a total-correctness triple for the same action. The ghost initial heap equals the actual entry heap; successful results use the actual final heap, and faults are excluded.

      @[reducible, inline]

      Signature-preserving positions of this imported source program.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        @[reducible, inline]

        This named source function's index in its declared signature table.

        Equations
        Instances For
          theorem Complexity.Examples.ProductLists.Linked.Operations.productList4.uncons_eq (roots : Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) :
          uncons roots = have leftRoot := roots.1; have rightRoot := roots.2; do let first ← unconsNat.uncons leftRoot let second ← unconsNat.uncons rightRoot match first with | none => pure none | some payload => match second with | none => pure none | some payload_1 => have operand := payload.1; have operand_1 := payload_1.1; have operand := (operand, operand_1); have operand_2 := payload.2; have operand_3 := payload_1.2; have operand_4 := (operand_2, operand_3); have operand := (operand, operand_4); pure (some operand)

          One source-body equation in ordinary monadic notation; named callees remain opaque.

          The named function's actual independently interpreted source body.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            The named function's actual independently interpreted source body.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              Successful execution observes the native result in its actual final heap and retains every previously represented immutable list.

              Successful execution observes the native result in its actual final heap and retains every previously represented immutable list.

              @[reducible, inline]

              Budget-free total correctness with ordinary source parameters and relational initial/final heap postconditions. This is the existing source function contract.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Ordinary arguments and the actual result observed in their real source heaps. This interface does not assert the existence of a total mathematical model.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For

                  The named function's actual partial source action, with ordinary typed arguments and an explicitly supplied shared heap.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For

                    Apply a supplied source contract with ordinary named arguments and its actual returned value and final heap. No callee body or new contract is inferred.

                    The named function's actual partial source action, with ordinary typed arguments and an explicitly supplied shared heap.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      @[reducible, inline]

                      Signatures of the functions added by this source declaration.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For

                        The source contract is equivalent to ordinary curried preconditions and successful result/heap postconditions, including termination and absence of faults.

                        @[reducible, inline]

                        Budget-free total correctness with ordinary source parameters and relational initial/final heap postconditions. This is the existing source function contract.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          theorem Complexity.Examples.ProductLists.Linked.Operations.productList3.cons_contract_iff_triple (pre✝ : (ℕ × ℕ) × Bool × ℕ → (Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat) → Language.Heap → Prop) (post✝ : (ℕ × ℕ) × Bool × ℕ → (Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat) → Language.Heap → (Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat) → Language.Heap → Prop) :
                          cons_contract pre✝ post✝ ↔ ∀ (value : (ℕ × ℕ) × Bool × ℕ) (roots : (Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) (initialHeap : Language.Heap), ⦃fun (currentHeap : Language.Heap) => { down := currentHeap = initialHeap ∧ pre✝ value roots initialHeap }⦄ cons value roots ⦃(fun (value_1 : (Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) (finalHeap : Language.Heap) => { down := post✝ value roots initialHeap value_1 finalHeap }, fun (x : Language.Fault) (x_1 : Language.Heap) => { down := False }, PUnit.unit)⦄

                          Prove the ordinary-parameter source contract with a total-correctness triple for the same action. The ghost initial heap equals the actual entry heap; successful results use the actual final heap, and faults are excluded.

                          Ordinary mathematical function generated from the same represented source block.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            @[reducible, inline]

                            Signature-preserving positions of this imported source program.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              @[reducible, inline]

                              The complete signature tables retained from imported source programs.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                @[reducible, inline]

                                The actual declared argument environment, constructed from ordinary source parameters. This is proof-side parameter transport, not an additional runtime operation.

                                Equations
                                Instances For

                                  Added function bodies already typed against the complete linked table.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    @[reducible, inline]

                                    The source program's declared first-order signatures.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For

                                      Actual imported function bodies with their internal calls relocated.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For

                                        The named function's actual partial source action, with ordinary typed arguments and an explicitly supplied shared heap.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For

                                          Actual imported function bodies with their internal calls relocated.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For

                                            Ordinary arguments and the actual result observed in their real source heaps. This interface does not assert the existence of a total mathematical model.

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              @[reducible, inline]

                                              Apply a predicate, postcondition or bound with ordinary source parameters to the actual argument environment. No new contract or execution is introduced.

                                              Equations
                                              Instances For

                                                Prove the ordinary-parameter source contract with a total-correctness triple for the same action. The ghost initial heap equals the actual entry heap; successful results use the actual final heap, and faults are excluded.

                                                theorem Complexity.Examples.ProductLists.Linked.Operations.productList1.uncons_spec {pre✝ : Language.Env [((Language.Ty.node Language.CellTy.bool).option.prod (Language.Ty.node Language.CellTy.nat).option).prod (Language.Ty.node Language.CellTy.nat).option] → Language.Heap → Prop} {post✝ : Language.Env [((Language.Ty.node Language.CellTy.bool).option.prod (Language.Ty.node Language.CellTy.nat).option).prod (Language.Ty.node Language.CellTy.nat).option] → Language.Heap → Option (((Bool × ℕ) × ℕ) × (Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.nat)) → Language.Heap → Prop} :

                                                Apply a supplied source contract with ordinary named arguments and its actual returned value and final heap. No callee body or new contract is inferred.

                                                @[reducible, inline]

                                                The source program's declared first-order signatures.

                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For

                                                  The source contract is equivalent to ordinary curried preconditions and successful result/heap postconditions, including termination and absence of faults.

                                                  The source contract is equivalent to ordinary curried preconditions and successful result/heap postconditions, including termination and absence of faults.

                                                  theorem Complexity.Examples.ProductLists.Linked.Operations.productList5.uncons_rel (values✝ : List ((ℕ × ℕ) × ℤ)) (roots : Language.Value (((Language.Ty.node Language.CellTy.nat).option.prod (Language.Ty.node Language.CellTy.nat).option).prod ((Language.Ty.node Language.CellTy.bool).option.prod (Language.Ty.node Language.CellTy.nat).option))) (heap✝ : Language.Heap) :
                                                  (((((Language.Representation.list Language.CellTy.nat).prod (Language.Representation.list Language.CellTy.nat)).comap Language.Representation.listUnzip).prod (((Language.Representation.list Language.CellTy.bool).prod (Language.Representation.list Language.CellTy.nat)).comap (Language.Representation.intEquiv.listEquivOfEquiv.toEmbedding.trans Language.Representation.listUnzip))).comap Language.Representation.listUnzip).Rel values✝ roots heap✝ → ∃ (returned : Option (((ℕ × ℕ) × Bool × ℕ) × (Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat))) (finish : Language.Heap), uncons roots heap✝ = Part.some (Except.ok returned, finish) ∧ (((Language.Representation.ofEmbedding ((Function.Embedding.refl ℕ).prodMap (Function.Embedding.refl ℕ))).prod Language.Representation.int).prod (((((Language.Representation.list Language.CellTy.nat).prod (Language.Representation.list Language.CellTy.nat)).comap Language.Representation.listUnzip).prod (((Language.Representation.list Language.CellTy.bool).prod (Language.Representation.list Language.CellTy.nat)).comap (Language.Representation.intEquiv.listEquivOfEquiv.toEmbedding.trans Language.Representation.listUnzip))).comap Language.Representation.listUnzip)).option.Rel (Option.map (fun (head : (ℕ × ℕ) × ℤ) => (head, values✝.tail)) values✝.head?) returned finish ∧ heap✝.ShapeExtends finish

                                                  Ordinary arguments and the actual result observed in their real source heaps. This interface does not assert the existence of a total mathematical model.

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For
                                                    theorem Complexity.Examples.ProductLists.Linked.Operations.productList0.cons_rel (head✝ : ℤ × ℕ) (values✝ : List (ℤ × ℕ)) (value : Language.Value ((Language.Ty.bool.prod Language.Ty.nat).prod Language.Ty.nat)) (roots : Language.Value (((Language.Ty.node Language.CellTy.bool).option.prod (Language.Ty.node Language.CellTy.nat).option).prod (Language.Ty.node Language.CellTy.nat).option)) (heap✝ : Language.Heap) :
                                                    theorem Complexity.Examples.ProductLists.Linked.Operations.productList1.uncons_eq (roots : (Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.nat)) :
                                                    uncons roots = have leftRoot := roots.1; have rightRoot := roots.2; do let first ← Language.List.Prod.Operations.unconsBoolNat leftRoot let second ← unconsNat.uncons rightRoot match first with | none => pure none | some payload => match second with | none => pure none | some payload_1 => have operand := payload.1; have operand_1 := payload_1.1; have operand := (operand, operand_1); have operand_2 := payload.2; have operand_3 := payload_1.2; have operand_4 := (operand_2, operand_3); have operand := (operand, operand_4); pure (some operand)

                                                    One source-body equation in ordinary monadic notation; named callees remain opaque.

                                                    Automatic correspondence for the same generated source function, without a machine budget.

                                                    The finite table of actual named source bodies.

                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For
                                                      theorem Complexity.Examples.ProductLists.Linked.Operations.productList0.cons_spec {pre✝ : Language.Env [(Language.Ty.bool.prod Language.Ty.nat).prod Language.Ty.nat, ((Language.Ty.node Language.CellTy.bool).option.prod (Language.Ty.node Language.CellTy.nat).option).prod (Language.Ty.node Language.CellTy.nat).option] → Language.Heap → Prop} {post✝ : Language.Env [(Language.Ty.bool.prod Language.Ty.nat).prod Language.Ty.nat, ((Language.Ty.node Language.CellTy.bool).option.prod (Language.Ty.node Language.CellTy.nat).option).prod (Language.Ty.node Language.CellTy.nat).option] → Language.Heap → (Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.nat) → Language.Heap → Prop} :

                                                      Apply a supplied source contract with ordinary named arguments and its actual returned value and final heap. No callee body or new contract is inferred.

                                                      The named function's actual partial source action, with ordinary typed arguments and an explicitly supplied shared heap.

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        @[reducible, inline]

                                                        Signatures of the functions added by this source declaration.

                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For
                                                          theorem Complexity.Examples.ProductLists.Linked.Operations.productList3.cons_rel (head✝ : (ℕ × ℕ) × ℤ) (values✝ : List ((ℕ × ℕ) × ℤ)) (value : Language.Value ((Language.Ty.nat.prod Language.Ty.nat).prod (Language.Ty.bool.prod Language.Ty.nat))) (roots : Language.Value (((Language.Ty.node Language.CellTy.nat).option.prod (Language.Ty.node Language.CellTy.nat).option).prod ((Language.Ty.node Language.CellTy.bool).option.prod (Language.Ty.node Language.CellTy.nat).option))) (heap✝ : Language.Heap) :
                                                          theorem Complexity.Examples.ProductLists.Linked.Operations.productList1.uncons_rel (values✝ : List (ℤ × ℕ)) (roots : Language.Value (((Language.Ty.node Language.CellTy.bool).option.prod (Language.Ty.node Language.CellTy.nat).option).prod (Language.Ty.node Language.CellTy.nat).option)) (heap✝ : Language.Heap) :
                                                          @[reducible, inline]

                                                          Signature-preserving positions of this imported source program.

                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Instances For
                                                            Equations
                                                            • One or more equations did not get rendered due to their size.
                                                            Instances For
                                                              @[reducible, inline]

                                                              Budget-free total correctness with ordinary source parameters and relational initial/final heap postconditions. This is the existing source function contract.

                                                              Equations
                                                              • One or more equations did not get rendered due to their size.
                                                              Instances For

                                                                Automatic correspondence for the same generated source function, without a machine budget.

                                                                @[reducible, inline]

                                                                Signature-preserving positions of this imported source program.

                                                                Equations
                                                                • One or more equations did not get rendered due to their size.
                                                                Instances For
                                                                  theorem Complexity.Examples.ProductLists.Linked.nested_eq (head : (ℕ × ℕ) × Bool × ℕ) :
                                                                  nested head = have operand := none; have operand_1 := none; have operand := (operand, operand_1); have operand_2 := none; have operand_3 := none; have operand_4 := (operand_2, operand_3); have operand := (operand, operand_4); do let values ← Operations.productList3.cons head operand let listParts ← Operations.productList5.uncons values match listParts with | none => have operand := none; have operand_5 := none; have operand := (operand, operand_5); have operand_6 := none; have operand_7 := none; have operand_8 := (operand_6, operand_7); pure (operand, operand_8) | some payload => have first := payload.1; have rest := payload.2; do let sourceResult ← Operations.productList3.cons first rest pure sourceResult

                                                                  One source-body equation in ordinary monadic notation; named callees remain opaque.

                                                                  @[reducible, inline]

                                                                  Signature-preserving positions of this imported source program.

                                                                  Equations
                                                                  • One or more equations did not get rendered due to their size.
                                                                  Instances For
                                                                    theorem Complexity.Examples.ProductLists.Linked.Operations.productList5.uncons_contract_iff_triple (pre✝ : (Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat) → Language.Heap → Prop) (post✝ : (Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat) → Language.Heap → Option (((ℕ × ℕ) × Bool × ℕ) × (Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) → Language.Heap → Prop) :

                                                                    Prove the ordinary-parameter source contract with a total-correctness triple for the same action. The ghost initial heap equals the actual entry heap; successful results use the actual final heap, and faults are excluded.

                                                                    @[reducible, inline]

                                                                    Signatures of the functions added by this source declaration.

                                                                    Equations
                                                                    • One or more equations did not get rendered due to their size.
                                                                    Instances For
                                                                      theorem Complexity.Examples.ProductLists.Linked.headOr_eq (values : (Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.nat)) (fallback : (Bool × ℕ) × ℕ) :
                                                                      headOr values fallback = do let listParts ← Operations.productList1.uncons values match listParts with | none => pure fallback | some payload => have head := payload.1; have tail := payload.2; pure head

                                                                      One source-body equation in ordinary monadic notation; named callees remain opaque.

                                                                      @[reducible, inline]

                                                                      Apply a predicate, postcondition or bound with ordinary source parameters to the actual argument environment. No new contract or execution is introduced.

                                                                      Equations
                                                                      Instances For

                                                                        The named function's actual partial source action, with ordinary typed arguments and an explicitly supplied shared heap.

                                                                        Equations
                                                                        • One or more equations did not get rendered due to their size.
                                                                        Instances For
                                                                          @[reducible, inline]

                                                                          Budget-free total correctness with ordinary source parameters and relational initial/final heap postconditions. This is the existing source function contract.

                                                                          Equations
                                                                          • One or more equations did not get rendered due to their size.
                                                                          Instances For

                                                                            Successful execution observes the native result in its actual final heap and retains every previously represented immutable list.

                                                                            Apply a supplied source contract with ordinary named arguments and its actual returned value and final heap. No callee body or new contract is inferred.

                                                                            Equations
                                                                            • One or more equations did not get rendered due to their size.
                                                                            Instances For
                                                                              @[reducible, inline]

                                                                              Budget-free total correctness with ordinary source parameters and relational initial/final heap postconditions. This is the existing source function contract.

                                                                              Equations
                                                                              • One or more equations did not get rendered due to their size.
                                                                              Instances For
                                                                                @[reducible, inline]

                                                                                Signature-preserving positions of this imported source program.

                                                                                Equations
                                                                                • One or more equations did not get rendered due to their size.
                                                                                Instances For

                                                                                  Apply a supplied source contract with ordinary named arguments and its actual returned value and final heap. No callee body or new contract is inferred.

                                                                                  Prove the ordinary-parameter source contract with a total-correctness triple for the same action. The ghost initial heap equals the actual entry heap; successful results use the actual final heap, and faults are excluded.

                                                                                  @[reducible, inline]

                                                                                  This named source function's index in its declared signature table.

                                                                                  Equations
                                                                                  Instances For
                                                                                    @[reducible, inline]

                                                                                    Signatures of the functions added by this source declaration.

                                                                                    Equations
                                                                                    • One or more equations did not get rendered due to their size.
                                                                                    Instances For

                                                                                      Prove the ordinary-parameter source contract with a total-correctness triple for the same action. The ghost initial heap equals the actual entry heap; successful results use the actual final heap, and faults are excluded.

                                                                                      Actual imported function bodies with their internal calls relocated.

                                                                                      Equations
                                                                                      • One or more equations did not get rendered due to their size.
                                                                                      Instances For
                                                                                        theorem Complexity.Examples.ProductLists.Linked.Operations.productList3.cons_spec {pre✝ : Language.Env [(Language.Ty.nat.prod Language.Ty.nat).prod (Language.Ty.bool.prod Language.Ty.nat), ((Language.Ty.node Language.CellTy.nat).option.prod (Language.Ty.node Language.CellTy.nat).option).prod ((Language.Ty.node Language.CellTy.bool).option.prod (Language.Ty.node Language.CellTy.nat).option)] → Language.Heap → Prop} {post✝ : Language.Env [(Language.Ty.nat.prod Language.Ty.nat).prod (Language.Ty.bool.prod Language.Ty.nat), ((Language.Ty.node Language.CellTy.nat).option.prod (Language.Ty.node Language.CellTy.nat).option).prod ((Language.Ty.node Language.CellTy.bool).option.prod (Language.Ty.node Language.CellTy.nat).option)] → Language.Heap → (Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat) → Language.Heap → Prop} :

                                                                                        Apply a supplied source contract with ordinary named arguments and its actual returned value and final heap. No callee body or new contract is inferred.

                                                                                        @[reducible, inline]

                                                                                        Apply a predicate, postcondition or bound with ordinary source parameters to the actual argument environment. No new contract or execution is introduced.

                                                                                        Equations
                                                                                        Instances For
                                                                                          Equations
                                                                                          • One or more equations did not get rendered due to their size.
                                                                                          Instances For
                                                                                            theorem Complexity.Examples.ProductLists.Linked.Operations.productList5.uncons_total_iff (pre✝ : (Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat) → Language.Heap → Prop) (post✝ : (Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat) → Language.Heap → Option (((ℕ × ℕ) × Bool × ℕ) × (Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) → Language.Heap → Prop) :

                                                                                            The source contract is equivalent to ordinary curried preconditions and successful result/heap postconditions, including termination and absence of faults.

                                                                                            theorem Complexity.Examples.ProductLists.Linked.Operations.productList3.cons_rel_preserving (head✝ : (ℕ × ℕ) × ℤ) (values✝ : List ((ℕ × ℕ) × ℤ)) (value : Language.Value ((Language.Ty.nat.prod Language.Ty.nat).prod (Language.Ty.bool.prod Language.Ty.nat))) (roots : Language.Value (((Language.Ty.node Language.CellTy.nat).option.prod (Language.Ty.node Language.CellTy.nat).option).prod ((Language.Ty.node Language.CellTy.bool).option.prod (Language.Ty.node Language.CellTy.nat).option))) (heap✝ : Language.Heap) :

                                                                                            The finite table of actual named source bodies.

                                                                                            Equations
                                                                                            • One or more equations did not get rendered due to their size.
                                                                                            Instances For
                                                                                              @[reducible, inline]

                                                                                              Signature-preserving positions of this imported source program.

                                                                                              Equations
                                                                                              • One or more equations did not get rendered due to their size.
                                                                                              Instances For
                                                                                                @[reducible, inline]

                                                                                                Signature-preserving positions of this imported source program.

                                                                                                Equations
                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                Instances For
                                                                                                  @[reducible, inline]

                                                                                                  Budget-free total correctness with ordinary source parameters and relational initial/final heap postconditions. This is the existing source function contract.

                                                                                                  Equations
                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                  Instances For

                                                                                                    Added function bodies already typed against the complete linked table.

                                                                                                    Equations
                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                    Instances For

                                                                                                      The named function's actual partial source action, with ordinary typed arguments and an explicitly supplied shared heap.

                                                                                                      Equations
                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                      Instances For

                                                                                                        Ordinary arguments and the actual result observed in their real source heaps. This interface does not assert the existence of a total mathematical model.

                                                                                                        Equations
                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                        Instances For

                                                                                                          One source-body equation in ordinary monadic notation; named callees remain opaque.

                                                                                                          @[reducible, inline]

                                                                                                          Budget-free total correctness with ordinary source parameters and relational initial/final heap postconditions. This is the existing source function contract.

                                                                                                          Equations
                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                          Instances For

                                                                                                            Automatic correspondence for the same generated source function, without a machine budget.

                                                                                                            Fold an actual source invocation back to its named ordinary-argument observation.

                                                                                                            @[reducible, inline]

                                                                                                            The complete signature tables retained from imported source programs.

                                                                                                            Equations
                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                            Instances For

                                                                                                              Actual imported function bodies with their internal calls relocated.

                                                                                                              Equations
                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                              Instances For
                                                                                                                @[reducible, inline]

                                                                                                                Budget-free total correctness with ordinary source parameters and relational initial/final heap postconditions. This is the existing source function contract.

                                                                                                                Equations
                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                Instances For

                                                                                                                  Prove the ordinary-parameter source contract with a total-correctness triple for the same action. The ghost initial heap equals the actual entry heap; successful results use the actual final heap, and faults are excluded.

                                                                                                                  Ordinary mathematical function generated from the same represented source block.

                                                                                                                  Equations
                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                  Instances For
                                                                                                                    theorem Complexity.Examples.ProductLists.Linked.Operations.productList3.cons_total_iff (pre✝ : (ℕ × ℕ) × Bool × ℕ → (Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat) → Language.Heap → Prop) (post✝ : (ℕ × ℕ) × Bool × ℕ → (Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat) → Language.Heap → (Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat) → Language.Heap → Prop) :

                                                                                                                    The source contract is equivalent to ordinary curried preconditions and successful result/heap postconditions, including termination and absence of faults.

                                                                                                                    Added function bodies already typed against the complete linked table.

                                                                                                                    Equations
                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                    Instances For
                                                                                                                      Equations
                                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                                      Instances For
                                                                                                                        @[reducible, inline]

                                                                                                                        The actual declared argument environment, constructed from ordinary source parameters. This is proof-side parameter transport, not an additional runtime operation.

                                                                                                                        Equations
                                                                                                                        Instances For
                                                                                                                          @[reducible, inline]

                                                                                                                          Signature-preserving positions of this imported source program.

                                                                                                                          Equations
                                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                                          Instances For
                                                                                                                            @[reducible, inline]

                                                                                                                            Signatures of the functions added by this source declaration.

                                                                                                                            Equations
                                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                                            Instances For

                                                                                                                              Apply a supplied source contract with ordinary named arguments and its actual returned value and final heap. No callee body or new contract is inferred.

                                                                                                                              @[reducible, inline]

                                                                                                                              The source program's declared first-order signatures.

                                                                                                                              Equations
                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                              Instances For

                                                                                                                                Added function bodies already typed against the complete linked table.

                                                                                                                                Equations
                                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                                Instances For
                                                                                                                                  @[reducible, inline]

                                                                                                                                  The actual declared argument environment, constructed from ordinary source parameters. This is proof-side parameter transport, not an additional runtime operation.

                                                                                                                                  Equations
                                                                                                                                  Instances For

                                                                                                                                    The finite table of actual named source bodies.

                                                                                                                                    Equations
                                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                                    Instances For

                                                                                                                                      The named function's actual independently interpreted source body.

                                                                                                                                      Equations
                                                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                                                      Instances For

                                                                                                                                        The finite table of actual named source bodies.

                                                                                                                                        Equations
                                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                                        Instances For
                                                                                                                                          theorem Complexity.Examples.ProductLists.Linked.Operations.productList5.uncons_eq (roots : (Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) :
                                                                                                                                          uncons roots = have leftRoot := roots.1; have rightRoot := roots.2; do let first ← productList4.uncons leftRoot let second ← Language.List.Prod.Operations.unconsBoolNat rightRoot match first with | none => pure none | some payload => match second with | none => pure none | some payload_1 => have operand := payload.1; have operand_1 := payload_1.1; have operand := (operand, operand_1); have operand_2 := payload.2; have operand_3 := payload_1.2; have operand_4 := (operand_2, operand_3); have operand := (operand, operand_4); pure (some operand)

                                                                                                                                          One source-body equation in ordinary monadic notation; named callees remain opaque.

                                                                                                                                          @[reducible, inline]

                                                                                                                                          This named source function's index in its declared signature table.

                                                                                                                                          Equations
                                                                                                                                          Instances For
                                                                                                                                            @[reducible, inline]

                                                                                                                                            Apply a predicate, postcondition or bound with ordinary source parameters to the actual argument environment. No new contract or execution is introduced.

                                                                                                                                            Equations
                                                                                                                                            Instances For

                                                                                                                                              Successful execution observes the native result in its actual final heap and retains every previously represented immutable list.

                                                                                                                                              Fold an actual source invocation back to its named ordinary-argument observation.

                                                                                                                                              Fold an actual source invocation back to its named ordinary-argument observation.

                                                                                                                                              The named function's actual partial source action, with ordinary typed arguments and an explicitly supplied shared heap.

                                                                                                                                              Equations
                                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                                              Instances For
                                                                                                                                                theorem Complexity.Examples.ProductLists.Linked.Operations.productList2.cons_eq (head : ℕ × ℕ) (roots : Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) :
                                                                                                                                                cons head roots = have leftHead := head.1; have rightHead := head.2; have leftTail := roots.1; have rightTail := roots.2; do let first ← consNat.cons leftHead leftTail let second ← consNat.cons rightHead rightTail pure (first, second)

                                                                                                                                                One source-body equation in ordinary monadic notation; named callees remain opaque.

                                                                                                                                                @[reducible, inline]

                                                                                                                                                The complete signature tables retained from imported source programs.

                                                                                                                                                Equations
                                                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                                                Instances For
                                                                                                                                                  theorem Complexity.Examples.ProductLists.Linked.Operations.consNat.cons_rel_preserving (head✝ : ℕ) (values✝ : List ℕ) (tail✝ : Option (Language.NodeRef Language.CellTy.nat)) (heap✝ : Language.Heap) :
                                                                                                                                                  (Language.Representation.list Language.CellTy.nat).Rel values✝ tail✝ heap✝ → ∃ (returned : Option (Language.NodeRef Language.CellTy.nat)) (finish : Language.Heap), cons head✝ tail✝ heap✝ = Part.some (Except.ok returned, finish) ∧ (Language.Representation.list Language.CellTy.nat).Rel (head✝ :: values✝) returned finish ∧ heap✝.ShapeExtends finish ∧ Language.Buffer.PreservesContents heap✝ finish
                                                                                                                                                  Equations
                                                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                                                  Instances For

                                                                                                                                                    Automatic correspondence for the same generated source function, without a machine budget.

                                                                                                                                                    Ordinary mathematical function generated from the same represented source block.

                                                                                                                                                    Equations
                                                                                                                                                    Instances For
                                                                                                                                                      @[reducible, inline]

                                                                                                                                                      Apply a predicate, postcondition or bound with ordinary source parameters to the actual argument environment. No new contract or execution is introduced.

                                                                                                                                                      Equations
                                                                                                                                                      Instances For
                                                                                                                                                        @[reducible, inline]

                                                                                                                                                        Signature-preserving positions of this imported source program.

                                                                                                                                                        Equations
                                                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                                                        Instances For
                                                                                                                                                          @[reducible, inline]

                                                                                                                                                          Signatures of the functions added by this source declaration.

                                                                                                                                                          Equations
                                                                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                                                                          Instances For
                                                                                                                                                            theorem Complexity.Examples.ProductLists.Linked.naturalPair_eq (head : ℕ × ℕ) :
                                                                                                                                                            naturalPair head = have operand := none; have operand_1 := none; have operand := (operand, operand_1); do let sourceResult ← Operations.productList2.cons head operand pure sourceResult

                                                                                                                                                            One source-body equation in ordinary monadic notation; named callees remain opaque.

                                                                                                                                                            The source contract is equivalent to ordinary curried preconditions and successful result/heap postconditions, including termination and absence of faults.

                                                                                                                                                            theorem Complexity.Examples.ProductLists.Linked.singleton_contract_iff_triple (pre✝ : (Bool × ℕ) × ℕ → Language.Heap → Prop) (post✝ : (Bool × ℕ) × ℕ → Language.Heap → (Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.nat) → Language.Heap → Prop) :
                                                                                                                                                            singleton_contract pre✝ post✝ ↔ ∀ (head : (Bool × ℕ) × ℕ) (initialHeap : Language.Heap), ⦃fun (currentHeap : Language.Heap) => { down := currentHeap = initialHeap ∧ pre✝ head initialHeap }⦄ singleton head ⦃(fun (value : (Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.nat)) (finalHeap : Language.Heap) => { down := post✝ head initialHeap value finalHeap }, fun (x : Language.Fault) (x_1 : Language.Heap) => { down := False }, PUnit.unit)⦄

                                                                                                                                                            Prove the ordinary-parameter source contract with a total-correctness triple for the same action. The ghost initial heap equals the actual entry heap; successful results use the actual final heap, and faults are excluded.

                                                                                                                                                            @[reducible, inline]

                                                                                                                                                            Budget-free total correctness with ordinary source parameters and relational initial/final heap postconditions. This is the existing source function contract.

                                                                                                                                                            Equations
                                                                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                                                                            Instances For

                                                                                                                                                              Successful execution observes the native result in its actual final heap and retains every previously represented immutable list.

                                                                                                                                                              @[reducible, inline]

                                                                                                                                                              The actual declared argument environment, constructed from ordinary source parameters. This is proof-side parameter transport, not an additional runtime operation.

                                                                                                                                                              Equations
                                                                                                                                                              Instances For

                                                                                                                                                                Apply a supplied source contract with ordinary named arguments and its actual returned value and final heap. No callee body or new contract is inferred.

                                                                                                                                                                @[reducible, inline]

                                                                                                                                                                This named source function's index in its declared signature table.

                                                                                                                                                                Equations
                                                                                                                                                                Instances For
                                                                                                                                                                  theorem Complexity.Examples.ProductLists.Linked.naturalPair_total_iff (pre✝ : ℕ × ℕ → Language.Heap → Prop) (post✝ : ℕ × ℕ → Language.Heap → Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat) → Language.Heap → Prop) :
                                                                                                                                                                  naturalPair_contract pre✝ post✝ ↔ ∀ (head : ℕ × ℕ) (initialHeap : Language.Heap), pre✝ head initialHeap → ∃ (value : Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) (finalHeap : Language.Heap), naturalPair head initialHeap = Part.some (Except.ok value, finalHeap) ∧ post✝ head initialHeap value finalHeap

                                                                                                                                                                  The source contract is equivalent to ordinary curried preconditions and successful result/heap postconditions, including termination and absence of faults.

                                                                                                                                                                  theorem Complexity.Examples.ProductLists.Linked.prepend_action_rel_native_preserving (head : ℤ × ℕ) (tail : List (ℤ × ℕ)) (head_source✝ : Language.Value ((Language.Ty.bool.prod Language.Ty.nat).prod Language.Ty.nat)) (tail_source✝ : Language.Value (((Language.Ty.node Language.CellTy.bool).option.prod (Language.Ty.node Language.CellTy.nat).option).prod (Language.Ty.node Language.CellTy.nat).option)) (initialHeap✝ : Language.Heap) :

                                                                                                                                                                  Successful execution observes the native result in its actual final heap and retains every previously represented immutable list.

                                                                                                                                                                  The finite table of actual named source bodies.

                                                                                                                                                                  Equations
                                                                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                                                                  Instances For

                                                                                                                                                                    The source contract is equivalent to ordinary curried preconditions and successful result/heap postconditions, including termination and absence of faults.

                                                                                                                                                                    theorem Complexity.Examples.ProductLists.Linked.prepend_spec {pre✝ : Language.Env [(Language.Ty.bool.prod Language.Ty.nat).prod Language.Ty.nat, ((Language.Ty.node Language.CellTy.bool).option.prod (Language.Ty.node Language.CellTy.nat).option).prod (Language.Ty.node Language.CellTy.nat).option] → Language.Heap → Prop} {post✝ : Language.Env [(Language.Ty.bool.prod Language.Ty.nat).prod Language.Ty.nat, ((Language.Ty.node Language.CellTy.bool).option.prod (Language.Ty.node Language.CellTy.nat).option).prod (Language.Ty.node Language.CellTy.nat).option] → Language.Heap → (Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.nat) → Language.Heap → Prop} :

                                                                                                                                                                    Apply a supplied source contract with ordinary named arguments and its actual returned value and final heap. No callee body or new contract is inferred.

                                                                                                                                                                    @[reducible, inline]

                                                                                                                                                                    The source program's declared first-order signatures.

                                                                                                                                                                    Equations
                                                                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                                                                    Instances For
                                                                                                                                                                      @[reducible, inline]

                                                                                                                                                                      Budget-free total correctness with ordinary source parameters and relational initial/final heap postconditions. This is the existing source function contract.

                                                                                                                                                                      Equations
                                                                                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                                                                                      Instances For

                                                                                                                                                                        Successful execution observes the native result in its actual final heap and retains every previously represented immutable list.

                                                                                                                                                                        theorem Complexity.Examples.ProductLists.Linked.Operations.productList5.uncons_spec {pre✝ : Language.Env [((Language.Ty.node Language.CellTy.nat).option.prod (Language.Ty.node Language.CellTy.nat).option).prod ((Language.Ty.node Language.CellTy.bool).option.prod (Language.Ty.node Language.CellTy.nat).option)] → Language.Heap → Prop} {post✝ : Language.Env [((Language.Ty.node Language.CellTy.nat).option.prod (Language.Ty.node Language.CellTy.nat).option).prod ((Language.Ty.node Language.CellTy.bool).option.prod (Language.Ty.node Language.CellTy.nat).option)] → Language.Heap → Option (((ℕ × ℕ) × Bool × ℕ) × (Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) → Language.Heap → Prop} :

                                                                                                                                                                        Apply a supplied source contract with ordinary named arguments and its actual returned value and final heap. No callee body or new contract is inferred.

                                                                                                                                                                        Added function bodies already typed against the complete linked table.

                                                                                                                                                                        Equations
                                                                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                                                                        Instances For
                                                                                                                                                                          Equations
                                                                                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                                                                                          Instances For
                                                                                                                                                                            @[reducible, inline]

                                                                                                                                                                            Signature-preserving positions of this imported source program.

                                                                                                                                                                            Equations
                                                                                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                                                                                            Instances For
                                                                                                                                                                              @[reducible, inline]

                                                                                                                                                                              Signature-preserving positions of this imported source program.

                                                                                                                                                                              Equations
                                                                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                                                                              Instances For
                                                                                                                                                                                theorem Complexity.Examples.ProductLists.Linked.Operations.productList5.uncons_rel_preserving (values✝ : List ((ℕ × ℕ) × ℤ)) (roots : Language.Value (((Language.Ty.node Language.CellTy.nat).option.prod (Language.Ty.node Language.CellTy.nat).option).prod ((Language.Ty.node Language.CellTy.bool).option.prod (Language.Ty.node Language.CellTy.nat).option))) (heap✝ : Language.Heap) :
                                                                                                                                                                                (((((Language.Representation.list Language.CellTy.nat).prod (Language.Representation.list Language.CellTy.nat)).comap Language.Representation.listUnzip).prod (((Language.Representation.list Language.CellTy.bool).prod (Language.Representation.list Language.CellTy.nat)).comap (Language.Representation.intEquiv.listEquivOfEquiv.toEmbedding.trans Language.Representation.listUnzip))).comap Language.Representation.listUnzip).Rel values✝ roots heap✝ → ∃ (returned : Option (((ℕ × ℕ) × Bool × ℕ) × (Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat))) (finish : Language.Heap), uncons roots heap✝ = Part.some (Except.ok returned, finish) ∧ (((Language.Representation.ofEmbedding ((Function.Embedding.refl ℕ).prodMap (Function.Embedding.refl ℕ))).prod Language.Representation.int).prod (((((Language.Representation.list Language.CellTy.nat).prod (Language.Representation.list Language.CellTy.nat)).comap Language.Representation.listUnzip).prod (((Language.Representation.list Language.CellTy.bool).prod (Language.Representation.list Language.CellTy.nat)).comap (Language.Representation.intEquiv.listEquivOfEquiv.toEmbedding.trans Language.Representation.listUnzip))).comap Language.Representation.listUnzip)).option.Rel (Option.map (fun (head : (ℕ × ℕ) × ℤ) => (head, values✝.tail)) values✝.head?) returned finish ∧ heap✝.ShapeExtends finish ∧ Language.Buffer.PreservesContents heap✝ finish

                                                                                                                                                                                Added function bodies already typed against the complete linked table.

                                                                                                                                                                                Equations
                                                                                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                                                                                Instances For
                                                                                                                                                                                  @[reducible, inline]

                                                                                                                                                                                  The source program's declared first-order signatures.

                                                                                                                                                                                  Equations
                                                                                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                                                                                  Instances For
                                                                                                                                                                                    @[reducible, inline]

                                                                                                                                                                                    The source program's declared first-order signatures.

                                                                                                                                                                                    Equations
                                                                                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                                                                                    Instances For
                                                                                                                                                                                      @[reducible, inline]

                                                                                                                                                                                      Signature-preserving positions of this imported source program.

                                                                                                                                                                                      Equations
                                                                                                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                                                                                                      Instances For
                                                                                                                                                                                        @[reducible, inline]

                                                                                                                                                                                        Apply a predicate, postcondition or bound with ordinary source parameters to the actual argument environment. No new contract or execution is introduced.

                                                                                                                                                                                        Equations
                                                                                                                                                                                        Instances For

                                                                                                                                                                                          Prove the ordinary-parameter source contract with a total-correctness triple for the same action. The ghost initial heap equals the actual entry heap; successful results use the actual final heap, and faults are excluded.

                                                                                                                                                                                          Ordinary mathematical function generated from the same represented source block.

                                                                                                                                                                                          Equations
                                                                                                                                                                                          Instances For
                                                                                                                                                                                            theorem Complexity.Examples.ProductLists.Linked.retain_eq (input : (Language.Buffer Language.CellTy.bool × Language.Buffer Language.CellTy.nat) × ℕ) :
                                                                                                                                                                                            retain input = have values := input.1; have index := input.2; have operand := (true, 0); do let selected ← Language.Buffer.Prod.GetD.getBoolNat values index operand have operand : (Bool × ℕ) × ℕ := (selected, index) have operand_1 : Option (Language.NodeRef Language.CellTy.bool) := none have operand_2 : Option (Language.NodeRef Language.CellTy.nat) := none have operand_3 : Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat) := (operand_1, operand_2) have operand_4 : Option (Language.NodeRef Language.CellTy.nat) := none have operand_5 : (Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.nat) := (operand_3, operand_4) let list ← Operations.productList0.cons operand operand_5 let listParts ← Operations.productList1.uncons list match listParts with | none => pure (true, 0) | some payload => have head := payload.1; have tail := payload.2; have operand := head.2; have operand_6 := head.1; do let sourceResult ← Language.Buffer.Prod.GetD.getBoolNat values operand operand_6 pure sourceResult

                                                                                                                                                                                            One source-body equation in ordinary monadic notation; named callees remain opaque.

                                                                                                                                                                                            Added function bodies already typed against the complete linked table.

                                                                                                                                                                                            Equations
                                                                                                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                                                                                                            Instances For
                                                                                                                                                                                              @[reducible, inline]

                                                                                                                                                                                              Signature-preserving positions of this imported source program.

                                                                                                                                                                                              Equations
                                                                                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                                                                                              Instances For
                                                                                                                                                                                                @[reducible, inline]

                                                                                                                                                                                                Signature-preserving positions of this imported source program.

                                                                                                                                                                                                Equations
                                                                                                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                Instances For
                                                                                                                                                                                                  theorem Complexity.Examples.ProductLists.Linked.headOr_action_rel_native_preserving (values : List (ℤ × ℕ)) (fallback : ℤ × ℕ) (values_source✝ : Language.Value (((Language.Ty.node Language.CellTy.bool).option.prod (Language.Ty.node Language.CellTy.nat).option).prod (Language.Ty.node Language.CellTy.nat).option)) (fallback_source✝ : Language.Value ((Language.Ty.bool.prod Language.Ty.nat).prod Language.Ty.nat)) (initialHeap✝ : Language.Heap) :

                                                                                                                                                                                                  Successful execution observes the native result in its actual final heap and retains every previously represented immutable list.

                                                                                                                                                                                                  Fold an actual source invocation back to its named ordinary-argument observation.

                                                                                                                                                                                                  Prove the ordinary-parameter source contract with a total-correctness triple for the same action. The ghost initial heap equals the actual entry heap; successful results use the actual final heap, and faults are excluded.

                                                                                                                                                                                                  theorem Complexity.Examples.ProductLists.Linked.Operations.consNat.cons_rel (head✝ : ℕ) (values✝ : List ℕ) (tail✝ : Option (Language.NodeRef Language.CellTy.nat)) (heap✝ : Language.Heap) :
                                                                                                                                                                                                  (Language.Representation.list Language.CellTy.nat).Rel values✝ tail✝ heap✝ → ∃ (returned : Option (Language.NodeRef Language.CellTy.nat)) (finish : Language.Heap), cons head✝ tail✝ heap✝ = Part.some (Except.ok returned, finish) ∧ (Language.Representation.list Language.CellTy.nat).Rel (head✝ :: values✝) returned finish ∧ heap✝.ShapeExtends finish
                                                                                                                                                                                                  @[reducible, inline]

                                                                                                                                                                                                  Apply a predicate, postcondition or bound with ordinary source parameters to the actual argument environment. No new contract or execution is introduced.

                                                                                                                                                                                                  Equations
                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                    @[reducible, inline]

                                                                                                                                                                                                    Signature-preserving positions of this imported source program.

                                                                                                                                                                                                    Equations
                                                                                                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                    Instances For

                                                                                                                                                                                                      The named function's actual partial source action, with ordinary typed arguments and an explicitly supplied shared heap.

                                                                                                                                                                                                      Equations
                                                                                                                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                      Instances For

                                                                                                                                                                                                        Ordinary arguments and the actual result observed in their real source heaps. This interface does not assert the existence of a total mathematical model.

                                                                                                                                                                                                        Equations
                                                                                                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                          @[reducible, inline]

                                                                                                                                                                                                          The complete signature tables retained from imported source programs.

                                                                                                                                                                                                          Equations
                                                                                                                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                          Instances For

                                                                                                                                                                                                            Ordinary mathematical function generated from the same represented source block.

                                                                                                                                                                                                            Equations
                                                                                                                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                              theorem Complexity.Examples.ProductLists.Linked.prepend_action_rel_native (head : ℤ × ℕ) (tail : List (ℤ × ℕ)) (head_source✝ : Language.Value ((Language.Ty.bool.prod Language.Ty.nat).prod Language.Ty.nat)) (tail_source✝ : Language.Value (((Language.Ty.node Language.CellTy.bool).option.prod (Language.Ty.node Language.CellTy.nat).option).prod (Language.Ty.node Language.CellTy.nat).option)) (initialHeap✝ : Language.Heap) :

                                                                                                                                                                                                              Successful execution observes the native result in its actual final heap and retains every previously represented immutable list.

                                                                                                                                                                                                              @[reducible, inline]

                                                                                                                                                                                                              Signatures of the functions added by this source declaration.

                                                                                                                                                                                                              Equations
                                                                                                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                              Instances For
                                                                                                                                                                                                                theorem Complexity.Examples.ProductLists.Linked.retain_contract_iff_triple (pre✝ : (Language.Buffer Language.CellTy.bool × Language.Buffer Language.CellTy.nat) × ℕ → Language.Heap → Prop) (post✝ : (Language.Buffer Language.CellTy.bool × Language.Buffer Language.CellTy.nat) × ℕ → Language.Heap → Bool × ℕ → Language.Heap → Prop) :
                                                                                                                                                                                                                retain_contract pre✝ post✝ ↔ ∀ (input : (Language.Buffer Language.CellTy.bool × Language.Buffer Language.CellTy.nat) × ℕ) (initialHeap : Language.Heap), ⦃fun (currentHeap : Language.Heap) => { down := currentHeap = initialHeap ∧ pre✝ input initialHeap }⦄ retain input ⦃(fun (value : Bool × ℕ) (finalHeap : Language.Heap) => { down := post✝ input initialHeap value finalHeap }, fun (x : Language.Fault) (x_1 : Language.Heap) => { down := False }, PUnit.unit)⦄

                                                                                                                                                                                                                Prove the ordinary-parameter source contract with a total-correctness triple for the same action. The ghost initial heap equals the actual entry heap; successful results use the actual final heap, and faults are excluded.

                                                                                                                                                                                                                theorem Complexity.Examples.ProductLists.Linked.Operations.productList0.cons_eq (value : (Bool × ℕ) × ℕ) (roots : (Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.nat)) :
                                                                                                                                                                                                                cons value roots = have leftHead := value.1; have rightHead := value.2; have leftTail := roots.1; have rightTail := roots.2; do let first ← Language.List.Prod.Operations.consBoolNat leftHead leftTail let second ← consNat.cons rightHead rightTail pure (first, second)

                                                                                                                                                                                                                One source-body equation in ordinary monadic notation; named callees remain opaque.

                                                                                                                                                                                                                Prove the ordinary-parameter source contract with a total-correctness triple for the same action. The ghost initial heap equals the actual entry heap; successful results use the actual final heap, and faults are excluded.

                                                                                                                                                                                                                theorem Complexity.Examples.ProductLists.Linked.Operations.productList1.uncons_rel_preserving (values✝ : List (ℤ × ℕ)) (roots : Language.Value (((Language.Ty.node Language.CellTy.bool).option.prod (Language.Ty.node Language.CellTy.nat).option).prod (Language.Ty.node Language.CellTy.nat).option)) (heap✝ : Language.Heap) :

                                                                                                                                                                                                                The finite table of actual named source bodies.

                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                Instances For

                                                                                                                                                                                                                  Ordinary mathematical function generated from the same represented source block.

                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                                    theorem Complexity.Examples.ProductLists.Linked.Operations.productList0.cons_rel_preserving (head✝ : ℤ × ℕ) (values✝ : List (ℤ × ℕ)) (value : Language.Value ((Language.Ty.bool.prod Language.Ty.nat).prod Language.Ty.nat)) (roots : Language.Value (((Language.Ty.node Language.CellTy.bool).option.prod (Language.Ty.node Language.CellTy.nat).option).prod (Language.Ty.node Language.CellTy.nat).option)) (heap✝ : Language.Heap) :
                                                                                                                                                                                                                    theorem Complexity.Examples.ProductLists.Linked.singleton_eq (head : (Bool × ℕ) × ℕ) :
                                                                                                                                                                                                                    singleton head = have operand := none; have operand_1 := none; have operand := (operand, operand_1); have operand_2 := none; have operand := (operand, operand_2); do let sourceResult ← Operations.productList0.cons head operand pure sourceResult

                                                                                                                                                                                                                    One source-body equation in ordinary monadic notation; named callees remain opaque.

                                                                                                                                                                                                                    Automatic correspondence for the same generated source function, without a machine budget.

                                                                                                                                                                                                                    The named function's actual partial source action, with ordinary typed arguments and an explicitly supplied shared heap.

                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                      theorem Complexity.Examples.ProductLists.Linked.retain_total_iff (pre✝ : (Language.Buffer Language.CellTy.bool × Language.Buffer Language.CellTy.nat) × ℕ → Language.Heap → Prop) (post✝ : (Language.Buffer Language.CellTy.bool × Language.Buffer Language.CellTy.nat) × ℕ → Language.Heap → Bool × ℕ → Language.Heap → Prop) :
                                                                                                                                                                                                                      retain_contract pre✝ post✝ ↔ ∀ (input : (Language.Buffer Language.CellTy.bool × Language.Buffer Language.CellTy.nat) × ℕ) (initialHeap : Language.Heap), pre✝ input initialHeap → ∃ (value : Bool × ℕ) (finalHeap : Language.Heap), retain input initialHeap = Part.some (Except.ok value, finalHeap) ∧ post✝ input initialHeap value finalHeap

                                                                                                                                                                                                                      The source contract is equivalent to ordinary curried preconditions and successful result/heap postconditions, including termination and absence of faults.

                                                                                                                                                                                                                      theorem Complexity.Examples.ProductLists.Linked.Operations.productList3.cons_eq (value : (ℕ × ℕ) × Bool × ℕ) (roots : (Option (Language.NodeRef Language.CellTy.nat) × Option (Language.NodeRef Language.CellTy.nat)) × Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) :
                                                                                                                                                                                                                      cons value roots = have leftHead := value.1; have rightHead := value.2; have leftTail := roots.1; have rightTail := roots.2; do let first ← productList2.cons leftHead leftTail let second ← Language.List.Prod.Operations.consBoolNat rightHead rightTail pure (first, second)

                                                                                                                                                                                                                      One source-body equation in ordinary monadic notation; named callees remain opaque.

                                                                                                                                                                                                                      The named function's actual partial source action, with ordinary typed arguments and an explicitly supplied shared heap.

                                                                                                                                                                                                                      Equations
                                                                                                                                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                      Instances For
                                                                                                                                                                                                                        @[reducible, inline]

                                                                                                                                                                                                                        Apply a predicate, postcondition or bound with ordinary source parameters to the actual argument environment. No new contract or execution is introduced.

                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                          @[reducible, inline]

                                                                                                                                                                                                                          Apply a predicate, postcondition or bound with ordinary source parameters to the actual argument environment. No new contract or execution is introduced.

                                                                                                                                                                                                                          Equations
                                                                                                                                                                                                                          Instances For
                                                                                                                                                                                                                            @[reducible, inline]

                                                                                                                                                                                                                            The complete signature tables retained from imported source programs.

                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                              @[reducible, inline]

                                                                                                                                                                                                                              Apply a predicate, postcondition or bound with ordinary source parameters to the actual argument environment. No new contract or execution is introduced.

                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                              Instances For

                                                                                                                                                                                                                                Fold an actual source invocation back to its named ordinary-argument observation.

                                                                                                                                                                                                                                The finite table of actual named source bodies.

                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                Instances For

                                                                                                                                                                                                                                  Apply a supplied source contract with ordinary named arguments and its actual returned value and final heap. No callee body or new contract is inferred.

                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                                                    theorem Complexity.Examples.ProductLists.singleton_correct :
                                                                                                                                                                                                                                    singleton.Correct (fun (x : ℤ × ℕ) => True) fun (head : ℤ × ℕ) (result : List (ℤ × ℕ)) => result = [head]
                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                      theorem Complexity.Examples.ProductLists.naturalPair_correct :
                                                                                                                                                                                                                                      naturalPair.Correct (fun (x : ℕ × ℕ) => True) fun (head : ℕ × ℕ) (result : List (ℕ × ℕ)) => result = [head]
                                                                                                                                                                                                                                      Equations
                                                                                                                                                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                      Instances For
                                                                                                                                                                                                                                        theorem Complexity.Examples.ProductLists.nested_correct :
                                                                                                                                                                                                                                        nested.Correct (fun (x : (ℕ × ℕ) × ℤ) => True) fun (head : (ℕ × ℕ) × ℤ) (result : List ((ℕ × ℕ) × ℤ)) => result = [head]
                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                          theorem Complexity.Examples.ProductLists.retain_correct :
                                                                                                                                                                                                                                          retain.Correct (fun (x : Array ℤ × ℕ) => True) fun (input : Array ℤ × ℕ) (result : ℤ) => result = input.1.getD input.2 (-1)

                                                                                                                                                                                                                                          A constant bound inferred from the real three-node constructor and its wrapper instructions. Readiness, ranges and capacity are separate premises.

                                                                                                                                                                                                                                          Equations
                                                                                                                                                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                          Instances For