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, parseFormulaFromFileprotected ActionSignature signature
public CLawParser(ActionSignature signature)
signature - public CActionDescription parseBeliefBase(java.io.Reader reader) throws ParserException
ParserparseBeliefBase in class Parser<CActionDescription>reader - a readerParserExceptionpublic Formula parseFormula(java.io.Reader reader) throws java.io.IOException, ParserException
ParserparseFormula in class Parser<CActionDescription>reader - a readerjava.io.IOExceptionParserExceptionprotected FolFormula parseFolFormula(java.lang.String s) throws ParserException, java.io.IOException
s - ParserExceptionjava.io.IOExceptionpublic Formula parseFormula(java.lang.String s) throws ParserException, java.io.IOException
ParserparseFormula in class Parser<CActionDescription>s - a stringParserExceptionjava.io.IOExceptionprivate 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.ParserExceptionjava.io.IOExceptionprivate 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.ParserExceptionjava.io.IOExceptionprivate 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.ParserExceptionjava.io.IOExceptionprivate 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.ParserExceptionjava.io.IOExceptionprivate 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.ParserExceptionjava.io.IOExceptionprivate 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.ParserExceptionjava.io.IOExceptionprivate 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.ParserExceptionjava.io.IOExceptionprotected java.util.Set<java.lang.String> containedKeywords(java.lang.String s)
s -