SmartFrog 3.10.000

org.smartfrog.sfcore.languages.csf.constraints
Class PrologSolver

java.lang.Object
  extended by org.smartfrog.sfcore.languages.csf.constraints.CoreSolver
      extended by org.smartfrog.sfcore.languages.csf.constraints.PrologSolver
All Implemented Interfaces:
Solver

public abstract class PrologSolver
extends CoreSolver

Created by IntelliJ IDEA. User: pcg Date: 21-Oct-2005 Time: 14:02:19 To change this template use File | Settings | File Templates.


Constructor Summary
PrologSolver()
           
 
Method Summary
 java.lang.Object mapValueIn(java.lang.Object v)
          Method to convert an SF value to an object suitable for the solver This should be the inverse of mapValueOut
 java.lang.Object mapValueOut(java.lang.Object v)
          Method to convert an object returned by the solver into one suited for SF This should be the inverse of mapValueIn
abstract  void prepareTheory(java.io.InputStream prologStream)
           
 void solve(CSFComponentDescription cd)
          Implemention of the solver interface method., Solve the constraints and bind the variables.
abstract  java.util.Hashtable solveQuery(java.lang.StringBuffer totalConstraint, java.util.Hashtable bindings)
           
 
Methods inherited from class org.smartfrog.sfcore.languages.csf.constraints.CoreSolver
solver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrologSolver

public PrologSolver()
Method Detail

solve

public void solve(CSFComponentDescription cd)
           throws SmartFrogCompileResolutionException
Implemention of the solver interface method., Solve the constraints and bind the variables.

1) Provides initial processing of query and theory strings to identify references into the component description hierarchy, and resolves them in place.

2) Invokes an abstract method SolveBindings to evaluate the bindings for the free variables

3) Maps the variable bindings back into the components descritpions, ensuring that all variables are now bound.

Parameters:
cd - the component description at the root of the tree
Throws:
SmartFrogCompileResolutionException

mapValueIn

public java.lang.Object mapValueIn(java.lang.Object v)
                            throws SmartFrogCompileResolutionException
Method to convert an SF value to an object suitable for the solver This should be the inverse of mapValueOut

Parameters:
v - the value to convert
Returns:
the converted value
Throws:
SmartFrogCompileResolutionException

mapValueOut

public java.lang.Object mapValueOut(java.lang.Object v)
                             throws SmartFrogCompileResolutionException
Method to convert an object returned by the solver into one suited for SF This should be the inverse of mapValueIn

Parameters:
v - the value to convert
Returns:
the converted value
Throws:
SmartFrogCompileResolutionException

prepareTheory

public abstract void prepareTheory(java.io.InputStream prologStream)
                            throws java.io.IOException
Throws:
java.io.IOException

solveQuery

public abstract java.util.Hashtable solveQuery(java.lang.StringBuffer totalConstraint,
                                               java.util.Hashtable bindings)

SmartFrog CORE 3.10.000

(C) Copyright 1998-2006 Hewlett-Packard Development Company, LP