def wf.go

bend-ml-bpe-tokenizer@0.1.3.0 · main.bend:161

import bend-ml-bpe-tokenizer@0.1.3.0/main.bend as BendMlBpeTokenizer
import Base

161# well-formed table: no id repeats
162def wf.go(todo: List<&2, Rule>, +done: List<&2, Rule>) -> Bool:
163  match todo:
164    case Nil{}:
165      True{}
166    case Con{Rule{+i, +a, +b}, rest}:
167      Bool.and(Bool.not(has(done, i)), wf.go(rest, Rule{i, a, b} <> done))

Uses (6)

Used by (4)