SugarTrace version 1.0.1 Core API Specification

sugartracer.decoder
Class EncodingMap

java.lang.Object
  extended by sugartracer.decoder.EncodingMap

public class EncodingMap
extends Object

Represents the mapping from CSP variables to SAT variables.


Constructor Summary
EncodingMap()
           
 
Method Summary
 void addBoolVariable(String name, int code)
          Adds a CSP boolean variable to this object.
 void addIntVariable(String name, int code, int[][] domain)
          Adds a CSP integer variable to this object.
 Variable findVariable(int code)
          Finds the CSP variable whose encoded form uses the propositional variable code.
 Variable findVariable(String name)
          Finds the CSP variable of the given name.
 List<Variable> getVariables()
          Returns the list of CSP variables.
 void load(String mapFileName)
          Loads the mapping from the map file generated by Sugar.
 int size()
          Returns the size of CSP variables.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EncodingMap

public EncodingMap()
Method Detail

size

public int size()
Returns the size of CSP variables.

Returns:
size of CSP variables

getVariables

public List<Variable> getVariables()
Returns the list of CSP variables.

Returns:
list of CSP variables

findVariable

public Variable findVariable(String name)
Finds the CSP variable of the given name.

Parameters:
name - the name of the variable
Returns:
the CSP variable

findVariable

public Variable findVariable(int code)
Finds the CSP variable whose encoded form uses the propositional variable code.

Parameters:
code - index of the propositional variable
Returns:
the CSP variable

addIntVariable

public void addIntVariable(String name,
                           int code,
                           int[][] domain)
Adds a CSP integer variable to this object.

Parameters:
name -
code -
domain -

addBoolVariable

public void addBoolVariable(String name,
                            int code)
Adds a CSP boolean variable to this object.

Parameters:
name -
code -

load

public void load(String mapFileName)
          throws IOException
Loads the mapping from the map file generated by Sugar.

Parameters:
mapFileName - the map file to be loaded
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object

SugarTrace version 1.0.1 Core API Specification

SugarTracer: Tracer of Sugar