CorePROOF.loop_certificate: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/core_PROOF.bend as CorePROOF Lines 974-988 of bendtorch-core@0.1.0.0/src/tensor/core_PROOF.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/core_PROOF.bend&start_line=974&end_line=988 import Base import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core import bendtorch-core@0.1.0.0/src/tensor/elementwise.bend as Elementwise def loop_certificate(fuel: Nat, +operation: Elementwise.Operation, +plan: Shape.BroadcastPlan, +cursor: Nat, -original_left: Core.Dynamic, -original_right: Core.Dynamic, state: Elementwise.State, -invariant: Elementwise.StateInvariant(operation, plan, original_left, original_right, cursor, state)) -> Elementwise.LoopCertificate: match fuel: case 0n: Elementwise.State{left, right, output} = state Elementwise.LoopCertificate{((left, right), Done{Core.Packed{Shape.output_shape(plan), output}}), {==}, %Equal.sym(Nat, Nat.add(cursor, 0n), cursor, add_zero_right(cursor)) : Elementwise.PrefixInvariant(operation, plan, original_left, original_right, _, Core.Packed{Shape.output_shape(plan), output}) invariant_prefix(operation, plan, original_left, original_right, cursor, left, right, output, invariant)} case 1n++remaining: loop_after_certificate(remaining, operation, plan, cursor, original_left, original_right, state, invariant, natural_certificate(operation, plan, cursor, state), state => invariant => loop_certificate(remaining, operation, plan, 1n+cursor, original_left, original_right, state, invariant)) Uses (17): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.sym https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=BroadcastPlan https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=output_shape https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/core.bend&name=Dynamic https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/core_PROOF.bend&name=add_zero_right https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/core_PROOF.bend&name=invariant_prefix https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/core_PROOF.bend&name=loop_after_certificate https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/core_PROOF.bend&name=natural_certificate https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/elementwise.bend&name=LoopCertificate https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/elementwise.bend&name=Operation https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/elementwise.bend&name=PrefixInvariant https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/elementwise.bend&name=State https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/elementwise.bend&name=StateInvariant