コード例 #1
0
        public WamEnvironment(WamEnvironment predecessor, WamInstructionPointer returnInstructionPointer, WamChoicePoint cutChoicePoint)
        {
            m_id          = s_nextId++;
            m_predecessor = predecessor;
            m_returnInstructionPointer = returnInstructionPointer;
            m_cutChoicePoint           = cutChoicePoint;

            m_permanentRegisters = new WamReferenceTargetList();
        }
コード例 #2
0
        public WamEnvironment(WamEnvironment predecessor, WamInstructionPointer returnInstructionPointer, WamChoicePoint cutChoicePoint)
        {
            Id          = _nextId++;
            Predecessor = predecessor;
            ReturnInstructionPointer = returnInstructionPointer;
            CutChoicePoint           = cutChoicePoint;

            PermanentRegisters = new WamReferenceTargetList();
        }
コード例 #3
0
        public WamEnvironment(WamEnvironment predecessor, WamInstructionPointer returnInstructionPointer, WamChoicePoint cutChoicePoint)
        {
            Id = _nextId++;
            Predecessor = predecessor;
            ReturnInstructionPointer = returnInstructionPointer;
            CutChoicePoint = cutChoicePoint;

            PermanentRegisters = new WamReferenceTargetList();
        }
コード例 #4
0
        public WamEnvironment(WamEnvironment predecessor, WamInstructionPointer returnInstructionPointer, WamChoicePoint cutChoicePoint)
        {
            m_id = s_nextId++;
            m_predecessor = predecessor;
            m_returnInstructionPointer = returnInstructionPointer;
            m_cutChoicePoint = cutChoicePoint;

            m_permanentRegisters = new WamReferenceTargetList();
        }
コード例 #5
0
        public WamChoicePoint(WamChoicePoint predecessor, WamEnvironment environment, int stackIndex, WamInstructionPointer returnInstructionPointer, IEnumerable<WamReferenceTarget> argumentRegisters, WamChoicePoint cutChoicePoint)
        {
            m_generation = s_nextGeneration++;

            m_predecessor = predecessor;
            m_environment = environment;
            m_stackIndex = stackIndex;
            m_returnInstructionPointer = returnInstructionPointer;
            m_argumentRegisters = new WamReferenceTargetList(argumentRegisters);
            m_cutChoicePoint = cutChoicePoint;

            m_backtrackInstructionPointer = WamInstructionPointer.Undefined;
            m_predicateEnumerator = null;

            m_trail = new List<WamVariable>();
        }
コード例 #6
0
        public WamChoicePoint(WamChoicePoint predecessor, WamEnvironment environment, int stackIndex, WamInstructionPointer returnInstructionPointer, IEnumerable<WamReferenceTarget> argumentRegisters, WamChoicePoint cutChoicePoint)
        {
            Generation = NextGeneration++;

            Predecessor = predecessor;
            Environment = environment;
            StackIndex = stackIndex;
            ReturnInstructionPointer = returnInstructionPointer;
            ArgumentRegisters = new WamReferenceTargetList(argumentRegisters);
            CutChoicePoint = cutChoicePoint;

            BacktrackInstructionPointer = WamInstructionPointer.Undefined;
            PredicateEnumerator = null;

            Trail = new List<WamVariable>();
        }
コード例 #7
0
 private bool IsBreakpoint(WamInstructionPointer wamInstructionPointer)
 {
     //HACK: Implement
     return false;
 }
コード例 #8
0
ファイル: WamMachine.cs プロジェクト: wallymathieu/Prolog.NET
        public void PushContext(WamInstructionStream instructionStream)
        {
            if (instructionStream == null)
            {
                throw new ArgumentNullException("instructionStream");
            }

            WamContext context = new WamContext();
            m_contextStack.Push(context);
            m_currentContext = context;

            State = WamMachineStates.Run;
            InstructionPointer = new WamInstructionPointer(instructionStream);
            ReturnInstructionPointer = WamInstructionPointer.Undefined;
            StackIndex = 0;

            Environment = null;
            ChoicePoint = null;
            ArgumentRegisters.Clear();
            TemporaryRegisters.Clear();

            CurrentStructure = null;
            CurrentStructureIndex = -1;
        }
コード例 #9
0
ファイル: WamMachine.cs プロジェクト: wallymathieu/Prolog.NET
        public void SetInstructionStream(WamInstructionStream instructionStream)
        {
            if (instructionStream == null)
            {
                throw new ArgumentNullException("instructionStream");
            }

            ReturnInstructionPointer = InstructionPointer.GetNext();
            CutChoicePoint = ChoicePoint;
            TemporaryRegisters.Clear();

            StackIndex += 1;
            InstructionPointer = new WamInstructionPointer(instructionStream);
        }