## org.opencyc.constraintsolver
Class ProblemParser

    java.lang.Object
      |
      +--org.opencyc.constraintsolver.ProblemParser

public class ProblemParser
extends java.lang.Object

`ProblemParser` object to model the attributes and behavior of a parser which inputs the constraint problem representation and sets up the parent `ConstraintProblem` object.

Author:
  Stephen L. Reed

  Copyright 2001 Cycorp, Inc., license is open source GNU LGPL.

  the license

  www.opencyc.org

  OpenCyc at SourceForge

  THIS SOFTWARE AND KNOWLEDGE BASE CONTENT ARE PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENCYC ORGANIZATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE AND KNOWLEDGE BASE CONTENT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

See Also:
  `UnitTest#testConstraintProblem`

Field Summary
`protected ArgumentTypeConstrainer` `argumentTypeConstrainer` Reference to the constraint problem's ArgumentTypeConstrainer object.
`protected ConstraintProblem` `constraintProblem` Reference to the parent `ConstraintProblem` object.
`protected java.util.ArrayList` `constraintRules` Reference to the parent list of constraint rules.
`protected java.util.ArrayList` `domainPopulationRules` Reference to the parent list of domain populating constraint rules.
`protected java.util.ArrayList` `simplifiedRules` Reference to the parent list of simplified constraint rules.
`protected int` `verbosity` Sets verbosity of the constraint solver output.

Constructor Summary
`ProblemParser(ConstraintProblem constraintProblem)` Constructs a new `ProblemParser` object for the parent `ConstraintProblem`.

Method Summary
`protected void` `extractRulesAndDomains()` Simplifies the input problem into its constituent `Rule` objects, then divides the input rules into those which populate the variable domains, and those which subsequently constrain the search for one or more solutions.
`void` `gatherVariables()` Gathers the unique variables used in this constraint problem.
`protected void` `initializeDomains()` Initializes the value domains for each variable.
`void` `setVerbosity(int verbosity)` Sets verbosity of the constraint solver output.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### constraintProblem

    protected ConstraintProblem constraintProblem

  Reference to the parent `ConstraintProblem` object.

### simplifiedRules

    protected java.util.ArrayList simplifiedRules

  Reference to the parent list of simplified constraint rules.

### domainPopulationRules

    protected java.util.ArrayList domainPopulationRules

  Reference to the parent list of domain populating constraint rules.

### constraintRules

    protected java.util.ArrayList constraintRules

  Reference to the parent list of constraint rules.

### argumentTypeConstrainer

    protected ArgumentTypeConstrainer argumentTypeConstrainer

  Reference to the constraint problem's ArgumentTypeConstrainer object.

### verbosity

    protected int verbosity

  Sets verbosity of the constraint solver output. 0 --> quiet ... 9 -> maximum diagnostic input.

Constructor Detail

### ProblemParser

    public ProblemParser(ConstraintProblem constraintProblem)

  Constructs a new `ProblemParser` object for the parent `ConstraintProblem`.
  Parameters:
    `constraintProblem` - the parent constraint problem

Method Detail

### setVerbosity

    public void setVerbosity(int verbosity)

  Sets verbosity of the constraint solver output. 0 --> quiet ... 9 -> maximum diagnostic input.
  Parameters:
    `verbosity` - 0 --> quiet ... 9 -> maximum diagnostic input

### extractRulesAndDomains

    protected void extractRulesAndDomains()
                                   throws java.io.IOException,
                                          CycApiException

  Simplifies the input problem into its constituent `Rule` objects, then divides the input rules into those which populate the variable domains, and those which subsequently constrain the search for one or more solutions.

### initializeDomains

    protected void initializeDomains()
                              throws java.io.IOException,
                                     CycApiException

  Initializes the value domains for each variable.

### gatherVariables

    public void gatherVariables()

  Gathers the unique variables used in this constraint problem.