Class GroundingRequirementsParser
- java.lang.Object
-
- net.sf.tweety.action.grounding.parser.GroundingRequirementsParser
-
public class GroundingRequirementsParser extends Object
This class parses a list of grounding requirements of the form REQUIREMENT ("," REQUIREMENT)*- Author:
- Sebastian Homann
-
-
Constructor Summary
Constructors Constructor Description GroundingRequirementsParser()
-
Method Summary
Modifier and Type Method Description GroundingRequirementparseRequirement(String s, Set<net.sf.tweety.logics.commons.syntax.Variable> variables)Parses a string of the following form: (VARIABLENAME "<>" VARIABLENAME | VARIABLENAME "<>" CONSTANTNAME) where the constant CONSTANTNAME has to be of the same sort as the variable VARIABLENAME.Set<GroundingRequirement>parseRequirements(String s, Set<net.sf.tweety.logics.commons.syntax.Variable> variables)Parses a string of the following form: REQUIREMENT ("," REQUIREMENT)*
-
-
-
Method Detail
-
parseRequirements
public Set<GroundingRequirement> parseRequirements(String s, Set<net.sf.tweety.logics.commons.syntax.Variable> variables) throws net.sf.tweety.commons.ParserException
Parses a string of the following form: REQUIREMENT ("," REQUIREMENT)*- Parameters:
s- a stringvariables- A set of variables which are allowed in these requirements.- Returns:
- The set of grounding requirements parsed from the given string.
- Throws:
net.sf.tweety.commons.ParserException- if parsing fails
-
parseRequirement
public GroundingRequirement parseRequirement(String s, Set<net.sf.tweety.logics.commons.syntax.Variable> variables) throws net.sf.tweety.commons.ParserException
Parses a string of the following form: (VARIABLENAME "<>" VARIABLENAME | VARIABLENAME "<>" CONSTANTNAME) where the constant CONSTANTNAME has to be of the same sort as the variable VARIABLENAME.- Parameters:
s- a string containing a single requirementvariables- a set of variables- Returns:
- the parsed grounding requirement.
- Throws:
net.sf.tweety.commons.ParserException- if parsing fails
-
-