Class GroundingRequirementsParser
java.lang.Object
org.tweetyproject.action.grounding.parser.GroundingRequirementsParser
This class parses a list of grounding requirements of the form
REQUIREMENT ("," REQUIREMENT)*
- Author:
- Sebastian Homann
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionparseRequirement
(String s, Set<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.parseRequirements
(String s, Set<Variable> variables) Parses a string of the following form: REQUIREMENT ("," REQUIREMENT)*
-
Constructor Details
-
GroundingRequirementsParser
public GroundingRequirementsParser()
-
-
Method Details
-
parseRequirements
public Set<GroundingRequirement> parseRequirements(String s, Set<Variable> variables) throws 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:
ParserException
- if parsing fails
-
parseRequirement
public GroundingRequirement parseRequirement(String s, Set<Variable> variables) throws 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:
ParserException
- if parsing fails
-