Streaming first-match search on Boolean words #
The width is a runtime unary natural. The test receives the retained context and one Boolean
word, and the search retains at most one matching word. The implementation uses BooleanFold;
the list of all words occurs only in the correctness specification.
This supplies the unrestricted representative scan of [OAI26f], Lemma 3.2, printed p. 23. In that application the test checks measurements, without the fixed-bit restriction used in the second scan. This module does not implement that second scan or the counting algorithm.
Main definitions #
Cslib.GenericRAM.BooleanSearch.run: first matching word, ornone.Cslib.GenericRAM.BooleanSearch.runPrefix: the complete state after a prefix of the traversal.Cslib.GenericRAM.BooleanSearch.certificate: native search from a supplied native test.
Main results #
Cslib.GenericRAM.BooleanSearch.run_eq_find?: equality with the existing enumeration's search.Cslib.GenericRAM.BooleanSearch.run_eq_none_iff,Cslib.GenericRAM.BooleanSearch.run_some: completeness and soundness.Cslib.GenericRAM.BooleanSearch.length_prefix_le: complete live-state bound at every prefix.Cslib.GenericRAM.BooleanSearch.exists_computableInO: traversal-proportional time and polynomial workspace when the test has polynomial resource bounds.
References #
- OpenAI, The Exponential Time Hypothesis is False, Lemma 3.2, pp. 22–23.
Every prefix retains the original context and the first match among the visited words. The list on the right is specification-only, not a stored traversal history.
Certify the captured search step with an arbitrary native test. The outer branch skips the test when a word has already been found; the decoder's bit word is converted to the agreed list encoding before invoking the test.
Instances For
A polynomial native test gives a polynomial step in the complete captured input encoding. This does not assert polynomial time for the exponential traversal.
One fixed native machine searches all runtime widths and contexts. Its independently charged time and space bounds are those of the binary streaming iterator, including count preparation, initialization, decoding, the selected test calls and output projection.
Instances For
Search with independent bounds on the reachable visits. The bounds R and Q need not be
polynomial; the traversal count multiplies time only. All fixed preparation and state costs are
included in the polynomial overhead.
Search with arbitrary, independent bounds on the original test. Only the fixed traversal
machinery is polynomial: T and S are any uniform bounds over the candidates of the runtime
width. Exponentially many visits multiply time, while their workspace is reused.
With a polynomial test, search takes the traversal count times polynomial overhead and only polynomial charged workspace. The two polynomials and the realizing machine are fixed before the runtime context and width. In particular, the traversal count does not enter space.