fillList inserts the boxes with stars, with their values, into the trie of a tile (pruned encodings)
ProvedLight.Sec4.fillList_specLet be a program of the light language whose procedure number is the body of fillList, and in which the routines nineFirst, nineNext, starFirst, horner, insert and sumTen meet their specifications for the limits . Then fillList meets its specification for :
consider a tile with encodings (functions on the leaves, strings of symbols) stored at , a trie area of cells at holding the trie array whose length is in the cell , two scratch strings of cells, and a number of stars . Assume the surroundings of the tile are valid (in particular , the products of the two encodings at the leaves with at most nines, multiplied by , and fit in a word, and the areas lie in order in memory), the root of the tile's trie is nonzero, the trie array represents the tries in which the boxes with fewer than stars of this tile are already stored, and there is room for cells per new box. Then for every depth with , ends within
steps, where is the number of boxes with stars; afterwards the trie area holds the array obtained by inserting each of these boxes with its value (for the product read from the two encodings; for the sum of the ten values of the boxes with one star fewer, by the recurrence of Lemma 29), and nothing changes outside the trie area, the cell and the two scratch strings.
The only reads of the encodings are at leaves with at most nines, so the routine is correct for pruned encodings, which are wrong elsewhere.
“Procedure meets its specification within steps” means: called at any depth allowed by the hypothesis, with the given argument values and a memory satisfying the precondition, the body of terminates within steps without violating the limits, and the returned value and final memory satisfy the postcondition.
Formalization Note The statement is P[Proc.fillList]? = some fillListBody → NineFirstSpec lim P → NineNextSpec lim P → StarFirstSpec lim P → HornerSpec lim P → InsertSpec lim P → SumTenSpec lim P → FillListSpecP lim P.
/- Copyright (c) 2026 Anthropic, PBC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. SPDX-License-Identifier: Apache-2.0 -/ -- Generated by skeleton subtraction from the ThreeSumApsp library at commit 27a2fa4bab32. import Definitions.Def_APSP299791_Defs5 set_option autoImplicit false set_option relaxedAutoImplicit false open ThreeSumApsp open Light open Light.Sec4 open ThreeSumApsp.Spec open FillList
theorem Light.Sec4.fillList_spec {lim : Limits} {P : Program} (hP : P[Proc.fillList]? = some fillListBody)
(hFirst : NineFirstSpec lim P) (hNext : NineNextSpec lim P) (hStar : StarFirstSpec lim P)
(hHorner : HornerSpec lim P) (hInsert : InsertSpec lim P) (hBox : SumTenSpec lim P) :
FillListSpecP lim P := by sorry