def stored_value

bendtorch-core@0.1.0.0 · src/tensor/read_contract.bend:112

import bendtorch-core@0.1.0.0/src/tensor/read_contract.bend as ReadContract
import Base
import bendtorch-core@0.1.0.0/src/storage/main.bend as Storage
import bendtorch-core@0.1.0.0/src/storage/LAWS.bend as StorageLaws
import bendtorch-core@0.1.0.0/src/tensor/lifecycle.bend as Lifecycle

112def stored_value(storage: Storage.Storage, +other: U32, -expected: F32,
113  read: {StorageLaws.read(storage, other) == Done{expected} : Result<&2, &2, Storage.Error, F32>}) ->
114  {Lifecycle.read_value(Storage.get(storage, other)) == Some{expected} : Maybe<&2, F32>}:
115  Equal.trans(Maybe<&2, F32>, Lifecycle.read_value(Storage.get(storage, other)), storage_value(StorageLaws.read(storage, other)), Some{expected},
116    storage_pair_value(Storage.get(storage, other)),
117    Equal.cong(Result<&2, &2, Storage.Error, F32>, Maybe<&2, F32>, storage_value, StorageLaws.read(storage, other), Done{expected}, read))

Uses (13)

Used by (12)