CloneContract.clone_written: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/clone_contract.bend as CloneContract Lines 150-157 of bendtorch-core@0.1.0.0/src/tensor/clone_contract.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/clone_contract.bend&start_line=150&end_line=157 import Base import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape import bendtorch-core@0.1.0.0/src/storage/LAWS.bend as StorageLaws import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core import bendtorch-core@0.1.0.0/src/tensor/observation.bend as Observation import bendtorch-core@0.1.0.0/src/tensor/read_contract.bend as Reads import bendtorch-core@0.1.0.0/src/tensor/write_contract.bend as Writes def clone_written(+shape: Shape.Shape, +fill: F32, +index: U32, +value: F32, +other: U32, -expected: F32, inside: {Nat.is_lt(U32.to_nat(other), Shape.logical_numel(Shape.dimensions(shape))) == True{} : Bool}, picked: {Writes.written_pick(shape, index, value, other, fill) == expected : F32}) -> {Observation.clone_written_first(shape, index, value, other, Core.new(shape, fill)) == Some{expected} : Maybe<&2, F32>}: Reads.new_lift(shape, fill, result => {Observation.clone_written_first(shape, index, value, other, result) == Some{expected} : Maybe<&2, F32>}, valid => Equal.trans(Maybe<&2, F32>, Observation.clone_written_first(shape, index, value, other, Done{Core.TTensor{StorageLaws.created(Shape.count(shape), fill), valid}}), Some{Writes.written_pick(shape, index, value, other, fill)}, Some{expected}, first_written_done(shape, fill, valid, index, value, other, inside), Equal.cong(F32, Maybe<&2, F32>, number => Some{number}, Writes.written_pick(shape, index, value, other, fill), expected, picked))) Uses (20): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.cong https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.trans https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=Shape https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=count https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=dimensions https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=logical_numel https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/storage/LAWS.bend&name=created https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/clone_contract.bend&name=first_written_done https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/core.bend&name=Tensor https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/core.bend&name=new https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/observation.bend&name=clone_written_first https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/read_contract.bend&name=new_lift https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/write_contract.bend&name=written_pick