def ASet.Facts

bend-ml-tensor-array@0.1.19.0 · main.bend:1947

import bend-ml-tensor-array@0.1.19.0/main.bend as BendMlTensorArray
import Base

1947# ASet.Facts: what one pass over the tree a proves, for any n, j, v, z (n need not be a's real size):
1948# 1. Array.size(a) is the pair (a, ASet.sz(a));
1949# 2. the pair the write's descent returns is (the written array, the old value);
1950# 3. Array.size of the written array is the pair (written array, its sz);
1951# 4. the written array has a's sz;
1952# 5. reading the written array along the same path gives v;
1953# 6. the pair the read returns is (its first component, its second).
1954def ASet.Facts(-T: Data, -a: Array<T>, -n: U32, -j: U32, -v: T, -z: Bool) -> Type:
1955  {(a, ASet.sz(T, a)) == Array.size(T, a) : Array<T> & U32} & {(ASet.NA(T, a, n, j, v, z), Pair.snd(Array<T>, T, ASet.G(T, a, n, j, v, z))) == ASet.G(T, a, n, j, v, z) : Array<T> & T} & {(ASet.NA(T, a, n, j, v, z), ASet.sz(T, ASet.NA(T, a, n, j, v, z))) == Array.size(T, ASet.NA(T, a, n, j, v, z)) : Array<T> & U32} & {ASet.sz(T, ASet.NA(T, a, n, j, v, z)) == ASet.sz(T, a) : U32} & {Pair.snd(Array<T>, T, ASet.K(T, a, n, j, v, z)) == v : T} & {(Pair.fst(Array<T>, T, ASet.K(T, a, n, j, v, z)), Pair.snd(Array<T>, T, ASet.K(T, a, n, j, v, z))) == ASet.K(T, a, n, j, v, z) : Array<T> & T} & Unit

Uses (13)

Used by (6)