Selecting an accepted candidate with oracle gates #
A selection round asks the oracle about N candidates side by side and keeps the word of the
first accepted candidate, or a default word when none is accepted. Each query word and each
candidate word is read from sources (Boolean.Source): input wires or constants. A word of
sources is a substitution, so it reads the word Boolean.substitute ρ x from the input x. So a
candidate can mix fixed bits, such as its own index, with input bits, such as a truth-table entry
or the output of an earlier round. The default word is read from sources too, so it can be made
correct for the inputs it reads.
Boolean.selectionRound src word dflt is this round as an oracle circuit that keeps its inputs
and appends the selected word. Its queries have length q. It has N oracle gates, all at oracle
depth one, and its other gates are a chain of multiplexers (Boolean.selectFirst). Rounds compose
with Circuit.accumulate, where each round reads the inputs and the words of all earlier rounds;
Boolean.eval_selectionRound has the shape that Circuit.eval_accumulate_block consumes.
The selected word is the first accepted candidate's, or the default when none is accepted
(Boolean.selectedWord_spec). In particular, a property of words that every accepted candidate
and the default satisfy holds for the selected word (Boolean.selectedWord_prop).
Main definitions #
Cslib.Circuits.Boolean.firstSel: the word of the first accepted candidate, or the default.Cslib.Circuits.Boolean.selectFirst: a De Morgan circuit computingfirstSelby multiplexers.Cslib.Circuits.Boolean.Source,Cslib.Circuits.Boolean.constLayer,Cslib.Circuits.Boolean.queryLayer: sources of words, the two constant gates, and oracle gates side by side.Cslib.Circuits.Boolean.selectionRound,Cslib.Circuits.Boolean.selectedWord: one selection round and the word it selects.
Main results #
Cslib.Circuits.Boolean.firstSel_spec,Cslib.Circuits.Boolean.firstSel_prop: the first accepted candidate, or the default.Cslib.Circuits.Boolean.eval_selectionRound,Cslib.Circuits.Boolean.selectedWord_spec,Cslib.Circuits.Boolean.selectedWord_prop: the semantics of a round.Cslib.Circuits.Boolean.size_selectionRound,Cslib.Circuits.Boolean.cost_program_selectionRound,Cslib.Circuits.Boolean.depthWith_selectionRound_le,Cslib.Circuits.Boolean.fanInAtMost_selectionRound: a round hasNoracle gates, oracle depth at most one and fan-in at mostmax q 2.
The first accepted candidate #
The first accepted candidate, or the default. Either some candidate is accepted and the selected word is that of the first accepted candidate, or none is and it is the default.
A property of words that the default and every accepted candidate's word have holds for the selected word.
The De Morgan circuit selecting the first accepted candidate: candidate i is accepted when
the input acc i is true, and its word is read from the inputs word i; the default word is read
from the inputs dflt. A chain of N multiplexers.
Sources, constants and oracle gates #
The wire carrying a source after constLayer.
The inputs followed by the constants false and true. Two gates.
After constLayer, the wire of a source carries the bit that the source reads.
N oracle gates side by side, on the output of constLayer: gate i asks about the word read
from the q sources src i.
One round #
One selection round. Candidate i is accepted when the oracle accepts the word read from
the sources src i. The round keeps its inputs and appends the word read from word i for the
first accepted candidate i, or the word read from dflt when none is accepted.
A round keeps its inputs and appends the selected word.
The word a round selects. Either the oracle accepts some candidate's query and the selected word is that of the first such candidate, or it accepts none and the selected word is the default.
A property of words that the default and every accepted candidate's word have holds for the word a round selects.