Ejemplo n.º 1
0
        public TapeArray(TapeArray tapeArray)
        {
            tape      = new int[tapeArray.tape.Length];
            indexBase = tapeArray.indexBase;

            tapeArray.tape.CopyTo(tape, 0);
        }
Ejemplo n.º 2
0
        public TMInstance(TMInstance other)
        {
            owner = other.owner;
            Level = other.Level + 1;

            tape      = new TapeArray(other.tape);
            cellIndex = other.cellIndex;
            state     = other.state;
        }
Ejemplo n.º 3
0
        public TMInstance(OneTapeTuringMachine owner, int[] input)
        {
            this.owner = owner;
            Level      = 0;

            tape      = new TapeArray();
            cellIndex = 1;
            state     = owner.qStart;

            for (long i = 1; i <= input.Length; i++)
            {
                int currentInputSymbol = input[i - 1];

                Ensure.That(owner.Sigma.Contains(currentInputSymbol)).IsTrue();

                tape[i] = currentInputSymbol;
            }
        }