def tl.log

bend-osdev-gf@0.1.1.0 · PROOF.bend:7881

import bend-osdev-gf@0.1.1.0/PROOF.bend as PROOF
import Base
import bend-osdev-gf@0.1.1.0/gf.bend as G
import bend-osdev-gf@0.1.1.0/tables.bend as T
import bend-osdev-array@0.1.0.1/array.bend as A
import bend-osdev-array@0.1.0.1/LAWS.bend as AL
import bend-osdev-gf@0.1.1.0/proof_tab.bend as GT

7881# a logarithm through the table
7882def tl.log(+f: G.Gf8Field, +l: List<&2, U32>, +a: U32, +hl: {List.length(&2, U32, l) == A.Arrays.slots(8n) : Nat}, +hxa: {A.Arrays.nth(U32, l, A.Arrays.index(8n, G.Gf8.elt(a)), 0) == U32.from_nat(G.Gf8.log(f, a)) : U32}) -> {T.Gf8Tab.log(GT.gt.tab(f, l), a) == (GT.gt.tab(f, l), U32.from_nat(G.Gf8.log(f, a))) : T.Gf8Tab & U32}:
7883  %Equal.sym(Array<U32> & U32, Array.get(U32, A.Arrays.of_list(U32, 8n, l, 0), G.Gf8.elt(a)), (A.Arrays.of_list(U32, 8n, l, 0), A.Arrays.nth(U32, l, A.Arrays.index(8n, G.Gf8.elt(a)), 0)), AL.of_list_get(U32, 8n, l, 0, hl, GT.gt.hd8(), G.Gf8.elt(a))) : {T.gf8tab.log.fin(A.Arrays.of_list(U32, 9n, GT.gt.elist(510n, f, 0n), 0), _) == (GT.gt.tab(f, l), U32.from_nat(G.Gf8.log(f, a))) : T.Gf8Tab & U32}
7884  %Equal.sym(U32, A.Arrays.nth(U32, l, A.Arrays.index(8n, G.Gf8.elt(a)), 0), U32.from_nat(G.Gf8.log(f, a)), hxa) : {(T.Gf8Tab{A.Arrays.of_list(U32, 9n, GT.gt.elist(510n, f, 0n), 0), A.Arrays.of_list(U32, 8n, l, 0)}, _) == (GT.gt.tab(f, l), U32.from_nat(G.Gf8.log(f, a))) : T.Gf8Tab & U32}
7885  {==}

Uses (24)

Used by (2)