Scanning the visited string for an accepting record #
⚠️ Unreviewed by Bolton
The last step of the search is a scan of the visited string that ORs the
accepting-record test of
Complexitylib.Classes.Containments.Internal.CodeAccept over its records. It is
the scan of Complexitylib.Classes.Containments.Internal.BlockMember with a
different test, so its correctness comes straight from anyStepPair.
Two rulers travel in the state: the block ruler, which the test slices a record
with, and the rewind ruler, which says how long to drive the output head left.
The record width is 2(k+2)+1 block rulers, so it need not be carried.
Main definitions #
Complexity.acceptPack,Complexity.acceptStep— the packed scanComplexity.acceptScan— its verdict
Main results #
Complexity.acceptStep_pack,Complexity.acceptStep_iterate— packed is unpackedComplexity.acceptScan_eq_true_iff— what the scan decidesComplexity.acceptStep_mem_FP,Complexity.acceptScanFn_mem_FP— both are polynomial-time
The packed scan #
The packed accept-scan state: the two rulers, then the flag and the rest.
Equations
- Complexity.acceptPack R ruler flag rest = Complexity.pair (Complexity.pair R ruler) (Complexity.pair flag rest)
Instances For
The unpacked step the packed one performs.
Equations
- Complexity.acceptPairStep k qcode R ruler = Complexity.anyStepPair (Complexity.wideRuler (Complexity.codeBlocks k) R) (Complexity.acceptFlag qcode R ruler)
Instances For
The packed step is the unpacked step.
The packed iteration is the unpacked one.
The verdict #
Does any record of V pass the accepting test?
Equations
- Complexity.acceptScan k qcode R ruler V = Complexity.pairFst (Complexity.pairSnd ((Complexity.acceptStep k qcode)^[V.length] (Complexity.acceptPack R ruler [false] V)))