def set_checked_hit
bendtorch-core@0.1.0.0 · src/storage/api.bend:70
import bendtorch-core@0.1.0.0/src/storage/api.bend as Api
import Base
import bendtorch-core@0.1.0.0/src/storage/model.bend as Model
import bendtorch-core@0.1.0.0/src/storage/certificates.bend as Certificates
import bendtorch-core@0.1.0.0/src/storage/main.bend as Storage
import bendtorch-core@0.1.0.0/src/storage/arith.bend as Arith
70def set_checked_hit(+d: Nat, +n: Nat, -array: Array<F32>, +i: U32, +value: F32, allowed: Bool,
71 -decision: {allowed == Nat.is_lt(U32.to_nat(i), n) : Bool},
72 -balanced: Model.Balanced(F32, d, array), -valid: {Storage.bounds(d, n) == True{} : Bool},
73 yes: {True{} == allowed : Bool}, +fits: {Storage.bounds(d, n) == True{} : Bool},
74 +inside: {Nat.is_lt(U32.to_nat(i), n) == True{} : Bool}) ->
75 {Storage.set_checked(d, n, array, i, value, allowed, decision, balanced, valid) ==
76 (Storage.Owned{d, n, Array.set(F32, array, i, value),
77 Certificates.set_result(F32, d, array, i, value, Array.set(F32, array, i, value), {==}, balanced), valid}, Done{Unit{}})
78 : Storage.Storage & Result<&2, &2, Storage.Error, Unit>}:
79 match allowed:
80 case True{}:
81 {==}
82 case False{}:
83 Empty.absurd({Storage.set_checked(d, n, array, i, value, False{}, decision, balanced, valid) ==
84 (Storage.Owned{d, n, Array.set(F32, array, i, value),
85 Certificates.set_result(F32, d, array, i, value, Array.set(F32, array, i, value), {==}, balanced), valid}, Done{Unit{}})
86 : Storage.Storage & Result<&2, &2, Storage.Error, Unit>}, Arith.clash_true(yes))