Documentation

Complexitylib.Models.TuringMachine.Oracle.Defs

Deterministic Boolean-oracle Turing machines -- definitions #

This module adds a dedicated query tape and a one-step Boolean-oracle query mechanism to the library's deterministic Turing-machine model. Local steps retain the named read-only input, read-write work, and output tapes. A query state instead reads the binary prefix currently delimited by the query-tape head, leaves every tape unchanged, and branches to one of two states according to the oracle answer.

The query cost convention is explicit: one oracle lookup is one machine step, while writing and positioning the query takes ordinary local steps. Query strings use cells 1, ..., head - 1; 1 is true and every other tape symbol is false. Constructions that need a canonical binary query should establish that those cells contain only 0 or 1.

@[reducible, inline]

A Boolean oracle answers one bit for every finite binary query string.

Equations
Instances For

    An oracle decides a language when its answer bit is its exact characteristic function on every finite query string.

    Equations
    Instances For

      Query string delimited by the query-tape head. Cells strictly between the left marker and the head are read in increasing order. The convention is total: only 1 maps to true; 0, blank, and the left marker map to false.

      Equations
      Instances For
        structure Complexity.OracleCfg (n : ) (Q : Type) :

        Configuration of an oracle TM with n ordinary work tapes and one dedicated read-write query tape.

        • state : Q

          Current finite-control state.

        • input : Tape

          Read-only input tape.

        • query : Tape

          Dedicated query tape.

        • work : Fin nTape

          Ordinary read-write work tapes.

        • output : Tape

          Read-write output tape.

        Instances For
          @[reducible, inline]
          abbrev Complexity.OracleCfg.init {Q : Type} {n : } (qstart : Q) (input : List Bool) :

          Initial oracle-machine configuration.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            def Complexity.OracleCfg.erase {n : } {Q : Type} (cfg : OracleCfg n Q) :
            Cfg n Q

            Forget the dedicated query tape.

            Equations
            Instances For

              One ordinary, non-query transition of an oracle TM.

              • nextState : Q

                Next finite-control state.

              • queryWrite : Γw

                Symbol written on the query tape.

              • workWrites : Fin nΓw

                Symbols written on the ordinary work tapes.

              • outputWrite : Γw

                Symbol written on the output tape.

              • inputDir : Dir3

                Input-head movement.

              • queryDir : Dir3

                Query-head movement.

              • workDirs : Fin nDir3

                Ordinary work-head movements.

              • outputDir : Dir3

                Output-head movement.

              Instances For
                structure Complexity.OracleTM (n : ) :

                A deterministic oracle TM with one dedicated query tape.

                If queryTransition q = some (yesState, noState), state q performs an oracle lookup rather than applying localTransition; a true answer enters yesState and a false answer enters noState.

                Instances For
                  def Complexity.OracleTM.step {n : } (machine : OracleTM n) (oracle : BooleanOracle) (cfg : OracleCfg n machine.Q) :
                  Option (OracleCfg n machine.Q)

                  Execute one oracle-machine step. A query lookup costs exactly one step and changes only the finite-control state.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    @[reducible, inline]
                    abbrev Complexity.OracleTM.initCfg {n : } (machine : OracleTM n) (input : List Bool) :
                    OracleCfg n machine.Q

                    Initial configuration for an oracle TM.

                    Equations
                    Instances For
                      @[reducible, inline]
                      abbrev Complexity.OracleTM.halted {n : } (machine : OracleTM n) (cfg : OracleCfg n machine.Q) :

                      An oracle configuration is halted in the designated halt state.

                      Equations
                      Instances For
                        def Complexity.OracleTM.stepRel {n : } (machine : OracleTM n) (oracle : BooleanOracle) (cfg next : OracleCfg n machine.Q) :

                        One-step oracle execution relation.

                        Equations
                        Instances For
                          inductive Complexity.OracleTM.reachesIn {n : } (machine : OracleTM n) (oracle : BooleanOracle) :
                          OracleCfg n machine.QOracleCfg n machine.QProp

                          Exact-time deterministic oracle execution.

                          Instances For
                            def Complexity.OracleTM.Accepts {n : } (machine : OracleTM n) (oracle : BooleanOracle) (input : List Bool) :

                            Oracle-machine acceptance.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              def Complexity.OracleTM.AcceptsInTime {n : } (machine : OracleTM n) (oracle : BooleanOracle) (input : List Bool) (timeBound : ) :

                              Oracle-machine acceptance within a time budget.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                def Complexity.OracleTM.DecidesInTime {n : } (machine : OracleTM n) (oracle : BooleanOracle) (language : Language) (timeBound : ) :

                                An oracle TM decides a language within a length-dependent time bound.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  def Complexity.TM.toOracleTM {n : } (machine : TM n) :

                                  Regard an ordinary TM as an oracle TM whose query-state map is everywhere none. The extra query tape is operationally inert and never affects the ordinary tapes.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For