prover.hoon 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  1. /= compute-table /common/table/prover/compute
  2. /= memory-table /common/table/prover/memory
  3. /= * /common/zeke
  4. /= nock-common /common/nock-common
  5. ::
  6. ::TODO shouldn't need all of this but its useful to keep here for now
  7. ::while we're figuring out how to turn all tables off or on in general
  8. => :* stark-engine
  9. nock-common=nock-common
  10. compute-table=compute-table
  11. memory-table=memory-table
  12. ==
  13. ~% %stark-prover ..stark-engine-jet-hook ~
  14. |%
  15. +$ prove-result (each =proof err=prove-err)
  16. +$ prove-err $%([%too-big heights=(list @)])
  17. +$ prover-output [=proof deep-codeword=fpoly]
  18. :: +prove: prove the Nock computation [s f]
  19. ::
  20. ::
  21. :: .override: an optional list of which tables should be computed and constraints
  22. :: checked. this is for debugging use only, it should always be ~ in production.
  23. :: to use it for debugging, pass in the same list of tables to both +prove
  24. :: and +verify. these are the tables that will be computed - all others will
  25. :: be ignored. you do not need to worry about sorting it in the correct order, that
  26. :: happens automatically.
  27. ++ prove
  28. ~/ %prove
  29. |= $: header=noun-digest:tip5
  30. nonce=noun-digest:tip5
  31. pow-len=@
  32. override=(unit (list term))
  33. ==
  34. ^- prove-result
  35. =/ [s=* f=*] (puzzle-nock header nonce pow-len)
  36. =/ [prod=* return=fock-return] (fink:fock [s f])
  37. (generate-proof header nonce pow-len s f prod return override)
  38. ::
  39. :: generate-proof is the main body of the prover.
  40. ++ generate-proof
  41. :: Disabled jet hint for now, under development.
  42. :: ~/ %generate-proof
  43. |= $: header=noun-digest:tip5
  44. nonce=noun-digest:tip5
  45. pow-len=@
  46. s=*
  47. f=*
  48. prod=*
  49. return=fock-return
  50. override=(unit (list term))
  51. ==
  52. ^- prove-result
  53. =| =proof :: the proof stream
  54. =. proof (~(push proof-stream proof) [%puzzle header nonce pow-len prod])
  55. ::
  56. :: build tables
  57. ::~& %building-tables
  58. =/ tables=(list table-dat)
  59. (build-table-dats return override)
  60. ::
  61. :: check that the tables have correct base width. Comment this out for production.
  62. ::?: %+ levy tables
  63. :: |= t=table-dat
  64. :: !=(step.p.p.t base-width.p.t)
  65. :: ~& %widths-mismatch
  66. :: ~|("prove: mismatch between table full widths and actual widths" !!)
  67. ::
  68. =/ num-tables (lent tables)
  69. =. table-names (turn tables |=(t=table-dat name.p.t))
  70. =/ heights=(list @)
  71. %+ turn tables
  72. |= t=table-dat
  73. =/ len len.array.p.p.t
  74. ?:(=(len 0) 0 (bex (xeb (dec len))))
  75. ::~& heights+heights
  76. ::
  77. =. proof (~(push proof-stream proof) [%heights heights])
  78. =/ pre=preprocess-0 prep.stark-config
  79. ::
  80. =/ clc ~(. calc heights cd.pre)
  81. =* num-colinearity-tests=@ num-colinearity-tests:fri:clc
  82. =* fri-domain-len=@ init-domain-len:fri:clc
  83. ::
  84. :: convert the base columns to marys, this is a temporary preprocessing step until
  85. :: we change the table struct to contain a mary rather than a (list fpoly)
  86. ::
  87. :: think of each mary as a list of the table's rows
  88. =/ [base-marys=(list mary) width=@]
  89. %^ spin tables
  90. 0
  91. |=([t=table-dat width=@] [p.p.t (add width base-width.p.t)])
  92. =/ base=codeword-commitments
  93. (compute-codeword-commitments base-marys fri-domain-len width)
  94. =. proof (~(push proof-stream proof) [%m-root h.q.merk-heap.base])
  95. ::
  96. :: generate first round of randomness
  97. =/ rng ~(prover-fiat-shamir proof-stream proof)
  98. ::
  99. :: get coefficients for table extensions, extend tables
  100. :: round one challenges: a, b, c, ..., α
  101. =^ chals-rd1=(list belt) rng (belts:rng num-chals-rd1:chal)
  102. ::
  103. :: extension columns: list or mary? probably should be a list
  104. ::
  105. :: build extension columns
  106. =/ table-exts=(list table-mary)
  107. %+ turn tables
  108. |= t=table-dat
  109. ^- table-mary
  110. (extend:q.t p.t chals-rd1 return)
  111. =. tables
  112. %+ turn
  113. (zip-up tables table-exts)
  114. |= [t=table-dat ext=table-mary]
  115. ^- table-dat
  116. :_ [q.t r.t]
  117. (weld-exts:tlib p.t ext)
  118. ::
  119. :: check that the tables have correct num of ext cols. Comment this out for production.
  120. ::
  121. ::?: %+ levy (zip-up tables table-exts)
  122. ::|= [table=table-dat ext=table-mary]
  123. ::!=(step.p.ext ext-width.p.table)
  124. ::~& %widths-mismatch
  125. ::~|("prove: mismatch between table ext widths and actual ext widths" !!)
  126. ::~& %ext-cols
  127. ::
  128. :: convert the ext columns to marys
  129. ::
  130. :: think of each mary as a list of the table's rows
  131. =/ [ext-marys=(list mary) width=@]
  132. %^ spin table-exts
  133. 0
  134. |=([t=table-mary width=@] [p.t (add width ext-width.t)])
  135. ::
  136. =/ ext=codeword-commitments
  137. (compute-codeword-commitments ext-marys fri-domain-len width)
  138. =. proof (~(push proof-stream proof) [%m-root h.q.merk-heap.ext])
  139. ::
  140. :: reseed the rng
  141. =. rng ~(prover-fiat-shamir proof-stream proof)
  142. ::
  143. :: get coefficients for table extensions, extend tables
  144. :: round two challenges: β, z
  145. =^ chals-rd2=(list belt) rng (belts:rng num-chals-rd2:chal)
  146. =/ challenges (weld chals-rd1 chals-rd2)
  147. =/ chal-map=(map @ belt)
  148. (make-challenge-map:chal challenges s f)
  149. ::
  150. :: build mega-extension columns
  151. =/ table-mega-exts=(list table-mary)
  152. (build-mega-extend tables challenges return)
  153. ::~& %tables-built
  154. =. tables
  155. %+ turn (zip-up tables table-mega-exts)
  156. |= [t=table-dat mega-ext=table-mary]
  157. ^- table-dat
  158. :_ [q.t r.t]
  159. (weld-exts:tlib p.t mega-ext)
  160. ::
  161. :: check that the tables have correct num of ext cols. Comment this out for production.
  162. ::~& >> %check-mega-ext-cols
  163. ::?: %+ levy (zip-up tables table-mega-exts)
  164. ::|= [table=table-dat mext=table-mary]
  165. ::!=(step.p.mext mega-ext-width.p.table)
  166. ::~& %widths-mismatch
  167. ::~|("prove: mismatch between table ext widths and actual ext widths" !!)
  168. ::
  169. :: convert the mega-ext columns to marys
  170. ::
  171. :: think of each mary as a list of the table's rows
  172. =/ [mega-ext-marys=(list mary) width=@]
  173. %^ spin table-mega-exts
  174. 0
  175. |= [t=table-mary width=@]
  176. [p.t (add width mega-ext-width.t)]
  177. =/ mega-ext=codeword-commitments
  178. (compute-codeword-commitments mega-ext-marys fri-domain-len width)
  179. ::
  180. :: get terminal values for use in permutation/evaluation arguments
  181. =/ dyn-map=(map @ bpoly)
  182. %- ~(gas by *(map @ bpoly))
  183. %+ iturn tables
  184. |= [i=@ t=table-dat]
  185. [i (terminal:q.t p.t)]
  186. ::
  187. :: weld terminals from each table together
  188. =/ terminals=bpoly
  189. %+ roll (range (lent tables))
  190. |= [i=@ acc=bpoly]
  191. (~(weld bop acc) (~(got by dyn-map) i))
  192. :: send terminals to verifier
  193. =. proof (~(push proof-stream proof) terms+terminals)
  194. :: reseed the rng
  195. =. rng ~(prover-fiat-shamir proof-stream proof)
  196. ::
  197. ::
  198. ::
  199. :: This chunk of code plugs all the rows into the constraints to check if they really do
  200. :: evaluate to 0. Verifying the proof also checks this and is much faster, but this code
  201. :: is useful if you are debugging constraints. Keep it commented out unless you need it.
  202. :: It should never be run in production.
  203. ::
  204. ::?> %+ levy (zip-up (range (lent tables)) tables)
  205. :: |= [i=@ t=table-dat]
  206. :: %- (test:zkvm-debug p.t s f)
  207. :: [challenges (~(got by dyn-map) i) r.t]
  208. ::~& %passed-tests
  209. ::
  210. =/ num-extra-constraints=@
  211. %+ roll (range num-tables)
  212. |= [i=@ acc=@]
  213. =/ cs (~(got by count-map.pre) i)
  214. ;: add
  215. acc
  216. boundary.cs
  217. row.cs
  218. transition.cs
  219. terminal.cs
  220. extra.cs
  221. ==
  222. ::
  223. =/ total-cols=@
  224. %+ roll tables
  225. |= [[p=table-mary *] sum=@]
  226. (add sum step:p.p)
  227. ::
  228. :: The constraints take variables for a full row plus the following row. So to evaluate them
  229. :: the trace polys are not enough. We need to compose each trace poly with f(X)=g*X to create
  230. :: polys that will give the value of the following row. Then we weld these second-row polys
  231. :: to the original polys to get the double trace polys. These can then be used to compose with
  232. :: the constraints and evaluate at the DEEP challenge later on.
  233. ::~& %transposing-table
  234. :: TODO: we already transposed the tables when we interpolated the polynomials and we should
  235. :: just reuse that. But that requires changing the interface to the interpolation functions.
  236. =/ marys=(list table-mary)
  237. %+ turn tables
  238. |=(t=table-dat p.t)
  239. =/ transposed-tables=(list mary)
  240. %+ turn marys
  241. |= =table-mary
  242. (transpose-bpolys p.table-mary)
  243. ::
  244. ::~& %composing-trace-polys
  245. :: each mary is a list of a table's columns, interpolated to polys
  246. =/ trace-polys
  247. %+ turn (zip-up polys.base (zip-up polys.ext polys.mega-ext))
  248. |= [bm=mary em=mary mem=mary]
  249. ^- mary
  250. (~(weld ave bm) (~(weld ave em) mem))
  251. ::
  252. =/ second-row-trace-polys=(list mary)
  253. %+ turn transposed-tables
  254. |= polys=mary
  255. %- zing-bpolys
  256. %+ turn (range len.array.polys)
  257. |= i=@
  258. =/ bp=bpoly (~(snag-as-bpoly ave polys) i)
  259. (bp-ifft (bp-shift-by-unity bp 1))
  260. ::
  261. ::~& %appending-first-and-second-row-trace-polys
  262. ::
  263. =/ tworow-trace-polys=(list mary)
  264. %^ zip
  265. trace-polys
  266. second-row-trace-polys
  267. |= [t-poly=mary s-poly=mary]
  268. (~(weld ave t-poly) s-poly)
  269. ::
  270. ::
  271. :: Compute trace and tworow-trace polynomials in eval form over a 4*d root of unity
  272. :: (where d is the lowest power of 2 greater than the max degree of the constraints)
  273. ::~& %extending-trace-polys
  274. ::
  275. :: TODO: Save these variables in the preprocess step
  276. =/ max-constraint-degree (get-max-constraint-degree cd.pre)
  277. =/ ntt-len
  278. %- bex %- xeb %- dec
  279. (get-max-constraint-degree cd.pre)
  280. =/ max-height=@
  281. %- bex %- xeb %- dec
  282. (roll heights max)
  283. =/ tworow-trace-polys-eval=(list bpoly)
  284. %+ iturn tworow-trace-polys
  285. |= [i=@ polys=mary]
  286. (precompute-ntts polys max-height ntt-len)
  287. ::
  288. ::
  289. :: compute extra composition poly
  290. =/ omicrons-belt
  291. %+ turn tables
  292. |= [t=table-mary *]
  293. ~(omicron quot t)
  294. =/ omicrons-bpoly=bpoly (init-bpoly omicrons-belt)
  295. =/ omicrons-fpoly=fpoly
  296. (init-fpoly (turn omicrons-belt lift))
  297. =^ extra-comp-weights=bpoly rng
  298. =^ belt-list rng (belts:rng (mul 2 num-extra-constraints))
  299. [(init-bpoly belt-list) rng]
  300. =/ extra-composition-chals=(map @ bpoly)
  301. %- ~(gas by *(map @ bpoly))
  302. =- -<
  303. %+ roll (range num-tables)
  304. |= [i=@ acc=(list [@ bpoly]) num=@]
  305. =/ cs (~(got by count-map.pre) i)
  306. =/ num-extra-constraints=@
  307. ;: add
  308. boundary.cs
  309. row.cs
  310. transition.cs
  311. terminal.cs
  312. extra.cs
  313. ==
  314. :_ (add num (mul 2 num-extra-constraints))
  315. [[i (~(swag bop extra-comp-weights) num (mul 2 num-extra-constraints))] acc]
  316. ::~& %computing-extra-composition-poly
  317. =/ extra-composition-poly=bpoly
  318. %- compute-composition-poly
  319. :* omicrons-bpoly
  320. heights
  321. tworow-trace-polys-eval
  322. constraint-map.pre
  323. count-map.pre
  324. extra-composition-chals
  325. chal-map
  326. dyn-map
  327. %.y
  328. ==
  329. =. proof
  330. (~(push proof-stream proof) [%poly extra-composition-poly])
  331. =. rng ~(prover-fiat-shamir proof-stream proof)
  332. =^ extra-comp-eval-point rng $:felt:rng
  333. ::
  334. :: compute extra trace evals
  335. ::~& %evaluating-trace-at-new-comp-eval-point
  336. =/ extra-trace-evaluations=fpoly
  337. %- init-fpoly
  338. %- zing
  339. %+ turn tworow-trace-polys
  340. |= polys=mary
  341. %+ turn (range len.array.polys)
  342. |= i=@
  343. =/ b=bpoly (~(snag-as-bpoly ave polys) i)
  344. (bpeval-lift b extra-comp-eval-point)
  345. ::
  346. =. proof
  347. (~(push proof-stream proof) [%evals extra-trace-evaluations])
  348. ::
  349. :: send mega extension columns to verifier
  350. =. proof (~(push proof-stream proof) [%m-root h.q.merk-heap.mega-ext])
  351. :: reseed the rng
  352. =/ rng ~(prover-fiat-shamir proof-stream proof)
  353. ::
  354. :: compute the Composition Polynomial
  355. :: This polynomial composes the trace polynomials with the constraints, takes quotients
  356. :: over the rows where the constraint should be zero, adjusts the degree so they all
  357. :: have the same maximal degree, and combines them into one big random linear combination.
  358. ::
  359. :: compute weights used in linear combination of composition polynomial
  360. =/ num-constraints=@
  361. %+ roll (range num-tables)
  362. |= [i=@ acc=@]
  363. =/ cs (~(got by count-map.pre) i)
  364. ;: add
  365. acc
  366. boundary.cs
  367. row.cs
  368. transition.cs
  369. terminal.cs
  370. ==
  371. =^ comp-weights=bpoly rng
  372. =^ belt-list rng (belts:rng (mul 2 num-constraints))
  373. [(init-bpoly belt-list) rng]
  374. ::
  375. =/ composition-chals=(map @ bpoly)
  376. %- ~(gas by *(map @ bpoly))
  377. =- -<
  378. %+ roll (range num-tables)
  379. |= [i=@ acc=(list [@ bpoly]) num=@]
  380. =/ cs (~(got by count-map.pre) i)
  381. =/ num-constraints=@
  382. ;: add
  383. boundary.cs
  384. row.cs
  385. transition.cs
  386. terminal.cs
  387. ==
  388. :_ (add num (mul 2 num-constraints))
  389. [[i (~(swag bop comp-weights) num (mul 2 num-constraints))] acc]
  390. ::
  391. ::~& %computing-composition-poly
  392. =/ composition-poly=bpoly
  393. %- compute-composition-poly
  394. :* omicrons-bpoly
  395. heights
  396. tworow-trace-polys-eval
  397. constraint-map.pre
  398. count-map.pre
  399. composition-chals
  400. chal-map
  401. dyn-map
  402. %.n
  403. ==
  404. ::
  405. :: decompose composition polynomial into one polynomial for each degree of the
  406. :: constraints. If the max degree of the constraints is D, then this will produce
  407. :: D polynomials each of degree table-height.
  408. ::~& %decomposing-composition-poly
  409. =/ num-composition-pieces (get-max-constraint-degree cd.pre)
  410. ::
  411. =/ composition-pieces=(list bpoly)
  412. (bp-decompose composition-poly num-composition-pieces)
  413. ::
  414. :: turn composition pieces into codewords
  415. ::~& %computing-composition-codewords
  416. =/ composition-codewords=mary
  417. %- zing-bpolys
  418. %+ turn composition-pieces
  419. |= poly=bpoly
  420. (bp-coseword poly g fri-domain-len)
  421. =/ composition-codeword-array=mary
  422. (transpose-bpolys composition-codewords)
  423. =/ composition-merk=(pair @ merk-heap:merkle)
  424. (bp-build-merk-heap:merkle composition-codeword-array)
  425. =. proof
  426. (~(push proof-stream proof) [%comp-m h.q.composition-merk num-composition-pieces])
  427. ::
  428. ::
  429. ::
  430. ::
  431. :: reseed the rng
  432. =. rng ~(prover-fiat-shamir proof-stream proof)
  433. ::
  434. :: compute DEEP challenge point from extension field
  435. =^ deep-challenge=felt rng
  436. =^ deep-candidate rng $:felt:rng
  437. =/ n fri-domain-len:clc
  438. =/ exp-offset (lift (bpow generator:stark-engine n))
  439. |-
  440. =/ exp-deep-can (fpow deep-candidate n)
  441. ?. ?|(=(exp-deep-can f1) =(exp-deep-can exp-offset))
  442. [deep-candidate rng]
  443. =^ felt rng $:felt:rng
  444. $(deep-candidate felt)
  445. ::~& %evaluating-trace-at-deep-challenge
  446. ::
  447. :: trace-evaluations: list of evaluations of interpolated column polys and
  448. :: shifted column polys at deep point, grouped in order by tables
  449. =/ trace-evaluations=fpoly
  450. %- init-fpoly
  451. %- zing
  452. %+ turn tworow-trace-polys
  453. |= polys=mary
  454. %+ turn (range len.array.polys)
  455. |= i=@
  456. =/ b=bpoly (~(snag-as-bpoly ave polys) i)
  457. (bpeval-lift b deep-challenge)
  458. ::
  459. ::~& %evaluating-pieces-at-deep-challenge
  460. =/ composition-pieces-fpoly (turn composition-pieces bpoly-to-fpoly)
  461. =/ composition-piece-evaluations=fpoly
  462. =/ c (fpow deep-challenge num-composition-pieces)
  463. %- init-fpoly
  464. %+ turn composition-pieces-fpoly
  465. |=(poly=fpoly (fpeval poly c))
  466. ::
  467. =. proof
  468. (~(push proof-stream proof) [%evals trace-evaluations])
  469. =. proof
  470. (~(push proof-stream proof) [%evals composition-piece-evaluations])
  471. ::
  472. :: reseed the rng
  473. =. rng ~(prover-fiat-shamir proof-stream proof)
  474. ::
  475. :: compute weights used in linear combination of deep polynomial. These
  476. :: are from the extension field.
  477. =^ deep-weights=fpoly rng
  478. =^ felt-list rng
  479. %- felts:rng
  480. (add (mul 4 total-cols) max-constraint-degree)
  481. [(init-fpoly felt-list) rng]
  482. =/ all-evals (~(weld fop trace-evaluations) extra-trace-evaluations)
  483. ::~& %computing-deep-poly
  484. =/ deep-poly=fpoly
  485. %- compute-deep
  486. :* trace-polys
  487. all-evals
  488. composition-pieces-fpoly
  489. composition-piece-evaluations
  490. deep-weights
  491. omicrons-fpoly
  492. deep-challenge
  493. extra-comp-eval-point
  494. ==
  495. ::
  496. :: create DEEP codeword and push to proof
  497. ::~& %computing-deep-codeword
  498. =/ deep-codeword=fpoly
  499. (coseword deep-poly (lift g) fri-domain-len)
  500. ::
  501. =^ fri-indices=(list @) proof
  502. (prove:fri:clc deep-codeword proof)
  503. ::
  504. ::
  505. ::~& %opening-codewords
  506. =. proof
  507. %^ zip-roll (range num-spot-checks) fri-indices
  508. |= [[i=@ idx=@] proof=_proof]
  509. ::
  510. :: base trace codewords
  511. =/ elem=mary
  512. (~(change-step ave (~(snag-as-mary ave codewords.base) idx)) 1)
  513. =/ axis (index-to-axis:merkle p.merk-heap.base idx)
  514. =/ opening=merk-proof:merkle
  515. (build-merk-proof:merkle q.merk-heap.base axis)
  516. =. proof
  517. %- ~(push proof-stream proof)
  518. m-pathbf+[(tail elem) path.opening]
  519. ::
  520. :: ext trace codewords
  521. =. elem
  522. (~(change-step ave (~(snag-as-mary ave codewords.ext) idx)) 1)
  523. =. axis (index-to-axis:merkle p.merk-heap.ext idx)
  524. =. opening
  525. (build-merk-proof:merkle q.merk-heap.ext axis)
  526. =. proof
  527. %- ~(push proof-stream proof)
  528. m-pathbf+[(tail elem) path.opening]
  529. ::
  530. :: mega-ext trace codewords
  531. =. elem
  532. (~(change-step ave (~(snag-as-mary ave codewords.mega-ext) idx)) 1)
  533. =. axis (index-to-axis:merkle p.merk-heap.mega-ext idx)
  534. =. opening
  535. (build-merk-proof:merkle q.merk-heap.mega-ext axis)
  536. =. proof
  537. %- ~(push proof-stream proof)
  538. m-pathbf+[(tail elem) path.opening]
  539. ::
  540. :: piece codewords
  541. =. elem
  542. (~(change-step ave (~(snag-as-mary ave composition-codeword-array) idx)) 1)
  543. =. axis (index-to-axis:merkle p.composition-merk idx)
  544. =. opening (build-merk-proof:merkle q.composition-merk axis)
  545. %- ~(push proof-stream proof)
  546. m-pathbf+[(tail elem) path.opening]
  547. ::
  548. ::~& %finished-proof
  549. [%& %0 objects.proof ~ 0]
  550. ::
  551. ::
  552. ++ build-table-dats
  553. ::~/ %build-table-dats
  554. |= [return=fock-return override=(unit (list term))]
  555. ^- (list table-dat)
  556. %- sort
  557. :_ td-order
  558. %+ turn ?~ override :: check to see if we only want to use certain tables
  559. gen-table-names:nock-common
  560. u.override
  561. |= name=term
  562. =/ t-funcs
  563. ~| "table-funcs do not exist for {<name>}"
  564. (~(got by table-funcs-map) name)
  565. =/ v-funcs
  566. ~| "verifier-funcs do not exist for {<name>}"
  567. (~(got by all-verifier-funcs-map:nock-common) name)
  568. =/ tm=table-mary (build:t-funcs return)
  569. [(pad:t-funcs tm) t-funcs v-funcs]
  570. ::
  571. ++ table-funcs-map
  572. ~+
  573. ^- (map term table-funcs)
  574. %- ~(gas by *(map term table-funcs))
  575. :~ :- name:static:common:compute-table
  576. funcs:compute-table
  577. :- name:static:common:memory-table
  578. funcs:memory-table
  579. ==
  580. ++ build-mega-extend
  581. ~/ %build-mega-extend
  582. |= [tables=(list table-dat) chals=(list belt) return=fock-return]
  583. ^- (list table-mary)
  584. %+ turn tables
  585. |= t=table-dat
  586. ^- table-mary
  587. (mega-extend:q.t p.t chals return)
  588. --