TraversalArrayRefinement.fold_refines_ordered_model: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/proofs/traversal_array_refinement.bend as TraversalArrayRefinement Lines 118-132 of stelliferous@0.0.2.0/proofs/traversal_array_refinement.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/proofs/traversal_array_refinement.bend&start_line=118&end_line=132 import Base import stelliferous@0.0.2.0/traversal_array.bend as Traversal import stelliferous@0.0.2.0/traversal_loop.bend as Loop import stelliferous@0.0.2.0/proofs/loop_projection.bend as Projection def fold_refines_ordered_model(~Reader: Type,~Model: Data,~Element: Data,~Accumulator: Data,~Context: Data, ~pack_reader: Model -> Reader,~read: Reader -> Context -> U32 -> Reader & Element, ~sample: Model -> Context -> U32 -> Element,~combine: Accumulator -> Element -> Accumulator, ~read_matches: @+reader: Model -> @+context: Context -> @+position: U32 -> {read(pack_reader(reader),context,position) == (pack_reader(reader),sample(reader,context,position)) : Reader & Element}, +count: Nat,+state: Traversal.State<&2,&2,Model,Accumulator,Context>) -> {Loop.run(~Traversal.State<&1,&2,Reader,Accumulator,Context>,~Traversal.fold_step(~Reader,~Element,~Accumulator,~Context,~read,~combine), count,represent_fold(~Reader,~Model,~Accumulator,~Context,~pack_reader,state)) == represent_fold(~Reader,~Model,~Accumulator,~Context,~pack_reader, Loop.run(~Traversal.State<&2,&2,Model,Accumulator,Context>,~model_fold_step(~Model,~Element,~Accumulator,~Context,~sample,~combine),count,state)) : Traversal.State<&1,&2,Reader,Accumulator,Context>}: Projection.iteration_refines_model(~Traversal.State<&1,&2,Reader,Accumulator,Context>,~Traversal.State<&2,&2,Model,Accumulator,Context>, ~Traversal.fold_step(~Reader,~Element,~Accumulator,~Context,~read,~combine),~model_fold_step(~Model,~Element,~Accumulator,~Context,~sample,~combine), ~represent_fold(~Reader,~Model,~Accumulator,~Context,~pack_reader), ~fold_step_refines_model(~Reader,~Model,~Element,~Accumulator,~Context,~pack_reader,~read,~sample,~combine,~read_matches),count,state) Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/proofs/loop_projection.bend&name=iteration_refines_model https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/proofs/traversal_array_refinement.bend&name=fold_step_refines_model https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/proofs/traversal_array_refinement.bend&name=model_fold_step https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/proofs/traversal_array_refinement.bend&name=represent_fold https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/traversal_array.bend&name=State https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/traversal_array.bend&name=fold_step https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/traversal_loop.bend&name=run