Exemplo n.º 1
0
            public ExecutionSession(TuringMachineState state)
            {
                Assert(state._Buffer != null);

                Handle           = GCHandle.Alloc(state._Buffer);
                MachineState     = state;
                ExecutionContext = state.GetExecutionContext <TExecutionContext>();
            }
Exemplo n.º 2
0
        /// <inheritdoc/>
        public object Clone()
        {
            if (_Buffer is null)
            {
                ThrowObjectDisposedException();
            }

            TuringMachineState clone = new TuringMachineState(Size, Mode, false)
            {
                _Position = _Position
            };

            _Buffer.AsSpan(0, Size).CopyTo(clone._Buffer.AsSpan(0, Size));

            return(clone);
        }