Documentation

Examples.Language.SignedLists

Ordinary integer lists with actual linked storage #

Constructors and matches use the same signed-node operations as their source contracts. Mathematical proofs mention ordinary lists; allocation and reads retain old array contents. These are source correctness statements, not complete caller RAM time bounds or a fixed list-input interface.

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
      theorem Complexity.Examples.SignedLists.Signed.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)) (fallback_source✝ : Language.Value (Language.Ty.bool.prod Language.Ty.nat)) (initialHeap✝ : Language.Heap) :
      (((Language.Representation.list Language.CellTy.bool).prod (Language.Representation.list Language.CellTy.nat)).comap (Language.Representation.intEquiv.listEquivOfEquiv.toEmbedding.trans Language.Representation.listUnzip)).Rel values values_source✝ initialHeap✝ → Language.Representation.int.Rel fallback fallback_source✝ initialHeap✝ → ∃ (returned : Language.Value (Language.Ty.bool.prod Language.Ty.nat)) (finish : Language.Heap), headOr values_source✝ fallback_source✝ initialHeap✝ = Part.some (Except.ok returned, finish) ∧ Language.Representation.int.Rel (headOr_model values fallback) returned finish ∧ (fun (finish : Language.Heap) => initialHeap✝.ShapeExtends finish ∧ Language.Buffer.PreservesContents initialHeap✝ finish) finish

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

      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]

          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.SignedLists.Signed.empty_total_iff (pre✝ : Unit → Language.Heap → Prop) (post✝ : Unit → Language.Heap → Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat) → Language.Heap → Prop) :
            empty_contract pre✝ post✝ ↔ ∀ (_unit : Unit) (initialHeap : Language.Heap), pre✝ _unit initialHeap → ∃ (value : Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) (finalHeap : Language.Heap), empty _unit initialHeap = Part.some (Except.ok value, finalHeap) ∧ post✝ _unit initialHeap value finalHeap

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

            @[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

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

              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.SignedLists.Signed.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) → 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)) (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

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

                  @[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

                    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

                      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.

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

                      theorem Complexity.Examples.SignedLists.Signed.headOr_total_iff (pre✝ : Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat) → Bool × ℕ → Language.Heap → Prop) (post✝ : Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat) → Bool × ℕ → Language.Heap → Bool × ℕ → Language.Heap → Prop) :
                      headOr_contract pre✝ post✝ ↔ ∀ (values : Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) (fallback : Bool × ℕ) (initialHeap : Language.Heap), pre✝ values fallback initialHeap → ∃ (value : Bool × ℕ) (finalHeap : Language.Heap), headOr values fallback initialHeap = Part.some (Except.ok value, finalHeap) ∧ post✝ values fallback initialHeap value finalHeap

                      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.

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

                      @[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
                        theorem Complexity.Examples.SignedLists.Signed.positive_contract_iff_triple (pre✝ : Unit → Language.Heap → Prop) (post✝ : Unit → Language.Heap → Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat) → Language.Heap → Prop) :
                        positive_contract pre✝ post✝ ↔ ∀ (_unit : Unit) (initialHeap : Language.Heap), ⦃fun (currentHeap : Language.Heap) => { down := currentHeap = initialHeap ∧ pre✝ _unit initialHeap }⦄ positive _unit ⦃(fun (value : Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) (finalHeap : Language.Heap) => { down := post✝ _unit 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.

                        Ordinary mathematical function generated from the same represented source block.

                        Equations
                        Instances For

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

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

                          Ordinary mathematical function generated from the same represented source block.

                          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.

                                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

                                  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

                                    The named function's actual independently interpreted source body.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      theorem Complexity.Examples.SignedLists.Signed.empty_contract_iff_triple (pre✝ : Unit → Language.Heap → Prop) (post✝ : Unit → Language.Heap → Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat) → Language.Heap → Prop) :
                                      empty_contract pre✝ post✝ ↔ ∀ (_unit : Unit) (initialHeap : Language.Heap), ⦃fun (currentHeap : Language.Heap) => { down := currentHeap = initialHeap ∧ pre✝ _unit initialHeap }⦄ empty _unit ⦃(fun (value : Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) (finalHeap : Language.Heap) => { down := post✝ _unit 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.

                                      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]

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

                                        Equations
                                        Instances For
                                          theorem Complexity.Examples.SignedLists.Signed.singleton_total_iff (pre✝ : Bool × ℕ → Language.Heap → Prop) (post✝ : Bool × ℕ → Language.Heap → Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat) → Language.Heap → Prop) :
                                          singleton_contract pre✝ post✝ ↔ ∀ (head : Bool × ℕ) (initialHeap : Language.Heap), pre✝ head initialHeap → ∃ (value : Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) (finalHeap : Language.Heap), singleton 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.

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

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

                                          @[reducible, inline]

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

                                          Equations
                                          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

                                              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

                                                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

                                                  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 actual declared argument environment, constructed from ordinary source parameters. This is proof-side parameter transport, not an additional runtime operation.

                                                  Equations
                                                  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
                                                      @[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
                                                        theorem Complexity.Examples.SignedLists.Signed.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.

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

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

                                                        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.SignedLists.Signed.singleton_eq (head : Bool × ℕ) :
                                                          singleton head = have operand := none; have operand_1 := none; have operand := (operand, operand_1); do let sourceResult ← Language.List.Prod.Operations.consBoolNat head operand pure sourceResult

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

                                                          @[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
                                                            @[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

                                                              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

                                                                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.

                                                                theorem Complexity.Examples.SignedLists.Signed.positive_eq (_unit : Unit) :
                                                                positive _unit = have operand := (false, 1); have operand_1 := none; have operand_2 := none; have operand_3 := (operand_1, operand_2); do let sourceResult ← Language.List.Prod.Operations.consBoolNat operand operand_3 pure sourceResult

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

                                                                theorem Complexity.Examples.SignedLists.Signed.headOr_action_rel_native (values : List ℤ) (fallback : ℤ) (values_source✝ : Language.Value ((Language.Ty.node Language.CellTy.bool).option.prod (Language.Ty.node Language.CellTy.nat).option)) (fallback_source✝ : Language.Value (Language.Ty.bool.prod Language.Ty.nat)) (initialHeap✝ : Language.Heap) :
                                                                (((Language.Representation.list Language.CellTy.bool).prod (Language.Representation.list Language.CellTy.nat)).comap (Language.Representation.intEquiv.listEquivOfEquiv.toEmbedding.trans Language.Representation.listUnzip)).Rel values values_source✝ initialHeap✝ → Language.Representation.int.Rel fallback fallback_source✝ initialHeap✝ → ∃ (returned : Language.Value (Language.Ty.bool.prod Language.Ty.nat)) (finish : Language.Heap), headOr values_source✝ fallback_source✝ initialHeap✝ = Part.some (Except.ok returned, finish) ∧ Language.Representation.int.Rel (headOr_model values fallback) returned finish ∧ (fun (finish : Language.Heap) => initialHeap✝.ShapeExtends finish) finish

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

                                                                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

                                                                  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]

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

                                                                    Equations
                                                                    Instances For

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

                                                                      @[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 actual declared argument environment, constructed from ordinary source parameters. This is proof-side parameter transport, not an additional runtime operation.

                                                                        Equations
                                                                        Instances For

                                                                          Ordinary mathematical function generated from the same represented source block.

                                                                          Equations
                                                                          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.

                                                                              @[reducible, inline]

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

                                                                              Equations
                                                                              Instances For

                                                                                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

                                                                                  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.

                                                                                  theorem Complexity.Examples.SignedLists.Signed.empty_eq (_unit : Unit) :
                                                                                  empty _unit = have operand := none; have operand_1 := none; pure (operand, operand_1)

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

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

                                                                                  @[reducible, inline]

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

                                                                                  Equations
                                                                                  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
                                                                                      theorem Complexity.Examples.SignedLists.Signed.headOr_eq (values : Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) (fallback : Bool × ℕ) :
                                                                                      headOr values fallback = do let listParts ← Language.List.Prod.Operations.unconsBoolNat 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.

                                                                                      The named function's actual independently interpreted source body.

                                                                                      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.

                                                                                        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]

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

                                                                                          Equations
                                                                                          Instances For

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

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

                                                                                            theorem Complexity.Examples.SignedLists.Signed.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 : Option (Language.NodeRef Language.CellTy.bool) := none have operand_1 : Option (Language.NodeRef Language.CellTy.nat) := none have operand : Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat) := (operand, operand_1) let list ← Language.List.Prod.Operations.consBoolNat selected operand let listParts ← Language.List.Prod.Operations.unconsBoolNat list match listParts with | none => pure (true, 0) | some payload => have head := payload.1; have tail := payload.2; do let sourceResult ← Language.Buffer.Prod.GetD.getBoolNat values index head pure sourceResult

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

                                                                                            @[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.

                                                                                              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
                                                                                                theorem Complexity.Examples.SignedLists.Signed.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.

                                                                                                @[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
                                                                                                  theorem Complexity.Examples.SignedLists.Signed.positive_total_iff (pre✝ : Unit → Language.Heap → Prop) (post✝ : Unit → Language.Heap → Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat) → Language.Heap → Prop) :
                                                                                                  positive_contract pre✝ post✝ ↔ ∀ (_unit : Unit) (initialHeap : Language.Heap), pre✝ _unit initialHeap → ∃ (value : Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) (finalHeap : Language.Heap), positive _unit initialHeap = Part.some (Except.ok value, finalHeap) ∧ post✝ _unit initialHeap value finalHeap

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

                                                                                                  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.SignedLists.Signed.headOr_contract_iff_triple (pre✝ : Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat) → Bool × ℕ → Language.Heap → Prop) (post✝ : Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat) → Bool × ℕ → Language.Heap → Bool × ℕ → Language.Heap → Prop) :
                                                                                                    headOr_contract pre✝ post✝ ↔ ∀ (values : Option (Language.NodeRef Language.CellTy.bool) × Option (Language.NodeRef Language.CellTy.nat)) (fallback : Bool × ℕ) (initialHeap : Language.Heap), ⦃fun (currentHeap : Language.Heap) => { down := currentHeap = initialHeap ∧ pre✝ values fallback initialHeap }⦄ headOr values fallback ⦃(fun (value : Bool × ℕ) (finalHeap : Language.Heap) => { down := post✝ values fallback 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
                                                                                                      @[reducible, inline]

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

                                                                                                      Equations
                                                                                                      Instances For

                                                                                                        The returned nodes observe the ordinary singleton, including negative heads.

                                                                                                        Equations
                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                        Instances For
                                                                                                          theorem Complexity.Examples.SignedLists.singleton_correct :
                                                                                                          singleton.Correct (fun (x : ℤ) => True) fun (head : ℤ) (result : List ℤ) => result = [head]

                                                                                                          Empty lists use absent roots, with no fictitious allocated node.

                                                                                                          Equations
                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                          Instances For
                                                                                                            theorem Complexity.Examples.SignedLists.empty_correct :
                                                                                                            empty.Correct (fun (x : Unit) => True) fun (x : Unit) (result : List ℤ) => result = []

                                                                                                            The declared result type determines the type of a positive numeric head.

                                                                                                            Equations
                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                            Instances For
                                                                                                              theorem Complexity.Examples.SignedLists.positive_correct :
                                                                                                              positive.Correct (fun (x : Unit) => True) fun (x : Unit) (result : List ℤ) => result = [1]

                                                                                                              Construction and decomposition preserve the original array observation.

                                                                                                              Equations
                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                              Instances For
                                                                                                                theorem Complexity.Examples.SignedLists.retain_correct :
                                                                                                                retain.Correct (fun (x : Array ℤ × ℕ) => True) fun (input : Array ℤ × ℕ) (result : ℤ) => result = input.1.getD input.2 (-1)