StorageRefinement.sequence_lookup_case: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/proofs/storage_refinement.bend as StorageRefinement Lines 295-313 of stelliferous@0.0.2.0/proofs/storage_refinement.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/proofs/storage_refinement.bend&start_line=295&end_line=313 import Base import stelliferous@0.0.2.0/proofs/storage_tree_model.bend as Tree import stelliferous@0.0.2.0/proofs/bounded_u32_arithmetic.bend as Arithmetic import stelliferous@0.0.2.0/proofs/u32_comparison.bend as Comparison def sequence_lookup_case(~Element: Data,+present: Bool,+length: U32,+tree: Tree.Tree,+index: U32, order: {U32.is_lt(index,length) == present : Bool}) -> {List.get(&2,Element,Tree.read_sequence(~Element,U32.to_nat(length),0,tree),U32.to_nat(index)) == Bool.pick(Maybe<&2,Element>,present,Some{Tree.read(Element,tree,index)},None{}) : Maybe<&2,Element>}: match present: case False{}: sequence_missing(~Element,U32.to_nat(length),0,tree,U32.to_nat(index), %Comparison.lt(index,length) : {_ == False{} : Bool} order) case True{}: %Arithmetic.native_roundtrip(index) : {List.get(&2,Element,Tree.read_sequence(~Element,U32.to_nat(length),0,tree),U32.to_nat(index)) == Some{Tree.read(Element,tree,_)} : Maybe<&2,Element>} %Arithmetic.add_zero_left(U32.from_nat(U32.to_nat(index))) : {List.get(&2,Element,Tree.read_sequence(~Element,U32.to_nat(length),0,tree),U32.to_nat(index)) == Some{Tree.read(Element,tree,_)} : Maybe<&2,Element>} sequence_element(~Element,U32.to_nat(length),0,tree,U32.to_nat(index), %Comparison.lt(index,length) : {_ == True{} : Bool} order) Uses (16): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.get https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.from_nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/proofs/bounded_u32_arithmetic.bend&name=add_zero_left https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/proofs/bounded_u32_arithmetic.bend&name=native_roundtrip https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/proofs/storage_refinement.bend&name=sequence_element https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/proofs/storage_refinement.bend&name=sequence_missing https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/proofs/storage_tree_model.bend&name=Tree https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/proofs/storage_tree_model.bend&name=read https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/proofs/storage_tree_model.bend&name=read_sequence https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/proofs/u32_comparison.bend&name=lt