Class ActionQueryParser
java.lang.Object
org.tweetyproject.commons.Parser<SActionQuerySet,SActionQuery>
org.tweetyproject.action.query.parser.ActionQueryParser
This class implements a parser for action queries in S. The BNF of such queries is given by: (starting symbol is KB)
KB ::== QUERY1 ("\n" QUERY1)*
QUERY1 ::== QUERY ( "requires" REQUIREMENTS )?
QUERY ::== PROPOSITION | QUERY "&&" QUERY | QUERY "||" QUERY | "!" QUERY | "(" QUERY ")" | "+" | "-"
PROPOSITION ::== HOLDSQUERY | ALWAYSQUERY | NECESSARILYQUERY
HOLDSQUERY ::== "holds" "[" STATEFORMULA "]"
ALWAYSQUERY ::== "always" "[" STATEFORMULA "]"
NECESSARILYQUERY ::== "necessarily" "[" STATEFORMULA "]" "after" ACTIONS
ACTIONS ::== ACTION ( ";" ACTION )*
ACTION ::== "{" ACTIONNAME ("," ACTIONNAME)* "}"
REQUIREMENTS ::== REQUIREMENT ("," REQUIREMENT)*
REQUIREMENT ::== (VARIABLENAME "<>" VARIABLENAME | VARIABLENAME "<>" CONSTANTNAME)*
where STATEFORMULA is an unquantified first-order formula without functors,
and VARIABLENAME, CONSTANTNAME are sequences of symbols
from {a,...,z,A,...,Z,0,...,9} with a letter at the beginning.
KB ::== QUERY1 ("\n" QUERY1)*
QUERY1 ::== QUERY ( "requires" REQUIREMENTS )?
QUERY ::== PROPOSITION | QUERY "&&" QUERY | QUERY "||" QUERY | "!" QUERY | "(" QUERY ")" | "+" | "-"
PROPOSITION ::== HOLDSQUERY | ALWAYSQUERY | NECESSARILYQUERY
HOLDSQUERY ::== "holds" "[" STATEFORMULA "]"
ALWAYSQUERY ::== "always" "[" STATEFORMULA "]"
NECESSARILYQUERY ::== "necessarily" "[" STATEFORMULA "]" "after" ACTIONS
ACTIONS ::== ACTION ( ";" ACTION )*
ACTION ::== "{" ACTIONNAME ("," ACTIONNAME)* "}"
REQUIREMENTS ::== REQUIREMENT ("," REQUIREMENT)*
REQUIREMENT ::== (VARIABLENAME "<>" VARIABLENAME | VARIABLENAME "<>" CONSTANTNAME)*
where STATEFORMULA is an unquantified first-order formula without functors,
and VARIABLENAME, CONSTANTNAME are sequences of symbols
from {a,...,z,A,...,Z,0,...,9} with a letter at the beginning.
- Author:
- Sebastian Homann, Tim Janus (change constant LogicalSymbols to dynamic)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionparseBeliefBase
(Reader reader) Parses the given reader into a belief base of the given type.parseFormula
(Reader reader) Parses the given reader into a formula of the given type.Methods inherited from class org.tweetyproject.commons.Parser
isNumeric, parseBeliefBase, parseBeliefBaseFromFile, parseFormula, parseFormulaFromFile, parseListOfBeliefBases, parseListOfBeliefBases, parseListOfBeliefBasesFromFile, parseListOfBeliefBasesFromFile
-
Constructor Details
-
ActionQueryParser
constructor- Parameters:
signature
-
-
-
Method Details
-
parseBeliefBase
Description copied from class:Parser
Parses the given reader into a belief base of the given type.- Specified by:
parseBeliefBase
in classParser<SActionQuerySet,
SActionQuery> - Parameters:
reader
- a reader- Returns:
- a belief base
-
parseFormula
Description copied from class:Parser
Parses the given reader into a formula of the given type.- Specified by:
parseFormula
in classParser<SActionQuerySet,
SActionQuery> - Parameters:
reader
- a reader- Returns:
- a formula
- Throws:
IOException
- if some IO issue occurred.ParserException
- some parsing exceptions may be added here.
-