Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright The Sett Ltd, 2005 to 2014.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.thesett.aima.logic.fol.wam.machine;

WAMInternalRegisters holds the register file and flags of the machines internal registers.

CRC Card
Responsibilities Collaborations
Encapsulate the WAM machine internal register file and flags.

Author(s):
Rupert Smith
public class WAMInternalRegisters
{
    
Holds the current instruction pointer into the code.
    public int ip;

    
Holds the heap pointer.
    public int hp;

    
Holds the top of heap at the latest choice point.
    public int hbp;

    
Holds the secondary heap pointer, used for the heap address of the next term to match.
    public int sp;

    
Holds the unification stack pointer.
    public int up;

    
Holds the environment base pointer.
    public int ep;

    
Holds the choice point base pointer.
    public int bp;

    
Holds the last call choice point pointer.
    public int b0;

    
Holds the trail pointer.
    public int trp;

    
Used to record whether the machine is in structure read or write mode.
    public boolean writeMode;

    
Creates an instance of the WAM machine internal register file and flags.

Parameters:
ip The current instruction pointer into the code.
hp The heap pointer.
hbp The top of heap at the latest choice point.
sp The secondary heap pointer, used for the heap address of the next term to match.
up The unification stack pointer.
ep The environment base pointer.
bp The choice point base pointer.
b0 The last call choice point pointer.
trp The trail pointer.
writeMode The write mode flag.
    public WAMInternalRegisters(int ipint hpint hbpint spint upint epint bpint b0int trp,
        boolean writeMode)
    {
        this. = ip;
        this. = hp;
        this. = hbp;
        this. = sp;
        this. = up;
        this. = ep;
        this. = bp;
        this. = b0;
        this. = trp;
        this. = writeMode;
    }
New to GrepCode? Check out our FAQ X