StorageWitness.balanced: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/proofs/storage_witness.bend as StorageWitness Lines 25-33 of stelliferous@0.0.2.0/proofs/storage_witness.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/proofs/storage_witness.bend&start_line=25&end_line=33 import Base import stelliferous@0.0.2.0/proofs/storage_tree_model.bend as Tree import stelliferous@0.0.2.0/proofs/storage_shape.bend as Shape def balanced(-Element: Data,depth: Nat,-storage: Array,witness: Witness(Element,depth,storage)) -> Shape.Balanced(Element,depth,Tree.reflect(Element,storage)): match depth witness: case 0n Leaf{value,owner}: %Equal.sym(Array,storage,ALeaf{value},owner) : Shape.Balanced(Element,0n,Tree.reflect(Element,_)) Unit{} case 1n+ +rest Node{left,right,owner,left_balanced,right_balanced}: %Equal.sym(Array,storage,ANode{left,right},owner) : Shape.Balanced(Element,1n+rest,Tree.reflect(Element,_)) Shape.Both{balanced(Element,rest,left,left_balanced),balanced(Element,rest,right,right_balanced)} Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array 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=Unit https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/proofs/storage_shape.bend&name=Balanced https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/proofs/storage_shape.bend&name=Both https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/proofs/storage_tree_model.bend&name=reflect https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/proofs/storage_witness.bend&name=LeafWitness https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/proofs/storage_witness.bend&name=NodeWitness https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/proofs/storage_witness.bend&name=Witness