public class CLawParser extends Parser<CActionDescription>
Modifier and Type | Field and Description |
---|---|
protected ActionSignature |
signature |
Constructor and Description |
---|
CLawParser(ActionSignature signature)
This parser needs a valid action signature to parse causal laws.
|
Modifier and Type | Method and Description |
---|---|
protected java.util.Set<java.lang.String> |
containedKeywords(java.lang.String s)
Returns the set of forbidden keywords, that are contained in a string.
|
private Formula |
parseAlwaysFormula(java.lang.String s,
java.lang.String reqString)
Parses a string containing a single causal law of the form
always A
which is converted to
caused - if !A
|
CActionDescription |
parseBeliefBase(java.io.Reader reader)
Parses the given reader into a belief base of the given type.
|
private Formula |
parseCausedFormula(java.lang.String s,
java.lang.String reqString)
Parses a string containing a single causal law of the form
caused A (if B)? (after C)?
|
private Formula |
parseCausesFormula(java.lang.String s,
java.lang.String reqString)
Parses a string containing a single causal law of the form
A causes B if C
which is converted to
caused B if + after A && C
|
private Formula |
parseDefaultFormula(java.lang.String s,
java.lang.String reqString)
Parses a string containing a single causal law of the form
default A (if B)?
which is converted to the causal law
caused A if A && B
|
protected FolFormula |
parseFolFormula(java.lang.String s)
Parses a FolFormula from a string using the FolParser class
|
Formula |
parseFormula(java.io.Reader reader)
Parses the given reader into a formula of the given type.
|
Formula |
parseFormula(java.lang.String s)
Parses the given text into a formula of the given type.
|
private Formula |
parseInertialFormula(java.lang.String s,
java.lang.String reqString)
Parses a string containing a single causal law of the form
inertial A
which is converted to the causal law
caused A if A after A
|
private Formula |
parseMayCauseFormula(java.lang.String s,
java.lang.String reqString)
Parses a string containing a single causal law of the form
A may cause B if C
which is converted to
caused B if B after A && C
|
private Formula |
parseNonexecutableFormula(java.lang.String s,
java.lang.String reqString)
Parses a string containing a single causal law of the form
nonexecutable A if B
which is converted to
caused - after A && B
|
isNumeric, parseBeliefBase, parseBeliefBaseFromFile, parseFormulaFromFile
protected ActionSignature signature
public CLawParser(ActionSignature signature)
signature
- public CActionDescription parseBeliefBase(java.io.Reader reader) throws ParserException
Parser
parseBeliefBase
in class Parser<CActionDescription>
reader
- a readerParserException
public Formula parseFormula(java.io.Reader reader) throws java.io.IOException, ParserException
Parser
parseFormula
in class Parser<CActionDescription>
reader
- a readerjava.io.IOException
ParserException
protected FolFormula parseFolFormula(java.lang.String s) throws ParserException, java.io.IOException
s
- ParserException
java.io.IOException
public Formula parseFormula(java.lang.String s) throws ParserException, java.io.IOException
Parser
parseFormula
in class Parser<CActionDescription>
s
- a stringParserException
java.io.IOException
private Formula parseCausedFormula(java.lang.String s, java.lang.String reqString) throws ParserException, java.io.IOException
s
- a string containing a single causal law.reqString
- the grounding requirements of this law.ParserException
java.io.IOException
private Formula parseInertialFormula(java.lang.String s, java.lang.String reqString) throws ParserException, java.io.IOException
s
- a string containing a single inertial law.reqString
- the grounding requirements of this law.ParserException
java.io.IOException
private Formula parseDefaultFormula(java.lang.String s, java.lang.String reqString) throws ParserException, java.io.IOException
s
- a string containing a single causal law.reqString
- the grounding requirements of this law.ParserException
java.io.IOException
private Formula parseCausesFormula(java.lang.String s, java.lang.String reqString) throws ParserException, java.io.IOException
s
- a string containing a single causal law.reqString
- the grounding requirements of this law.ParserException
java.io.IOException
private Formula parseAlwaysFormula(java.lang.String s, java.lang.String reqString) throws ParserException, java.io.IOException
s
- a string containing a single causal law.reqString
- the grounding requirements of this law.ParserException
java.io.IOException
private Formula parseNonexecutableFormula(java.lang.String s, java.lang.String reqString) throws ParserException, java.io.IOException
s
- a string containing a single causal law.reqString
- the grounding requirements of this law.ParserException
java.io.IOException
private Formula parseMayCauseFormula(java.lang.String s, java.lang.String reqString) throws ParserException, java.io.IOException
s
- a string containing a single causal law.reqString
- the grounding requirements of this law.ParserException
java.io.IOException
protected java.util.Set<java.lang.String> containedKeywords(java.lang.String s)
s
-