public class FolParser extends net.sf.tweety.commons.Parser<FolBeliefSet,FolFormula>
| Constructor and Description |
|---|
FolParser()
Creates a new FolParser
|
FolParser(boolean ignoreUndeclaredConstants)
Creates a new FolParser
|
| Modifier and Type | Method and Description |
|---|---|
FolSignature |
getSignature()
Returns the signature of this parser.
|
Map<String,net.sf.tweety.logics.commons.syntax.Variable> |
getVariables() |
FolBeliefSet |
parseBeliefBase(Reader reader) |
FolFormula |
parseFormula(Reader reader) |
FolSignature |
parseSignature(String s)
This function parses only the sorts declaration and type declaration parts
of a belief base.
|
void |
parseSortDeclaration(String s,
FolSignature sig)
Parses a sort declaration of the form "SORTNAME "=" "{" (CONSTANTNAME ("," CONSTANTNAME)*)? "}""
and modifies the given signature accordingly.
|
void |
parseTypeDeclaration(String s,
FolSignature sig)
Parses a predicate declaration of the form "type" "(" PREDICATENAME "(" (SORTNAME ("," SORTNAME)*)? ")" ")"
or a functor declaration of the form "type" "(" SORTNAME "=" FUNCTORNAME "(" (SORTNAME ("," SORTNAME)*)? ")" ")"
and modifies the given signature accordingly.
|
void |
setSignature(FolSignature signature)
Sets the signature for this parser.
|
void |
setVariables(Map<String,net.sf.tweety.logics.commons.syntax.Variable> variables) |
public FolParser()
public FolParser(boolean ignoreUndeclaredConstants)
ignoreUndeclaredConstants - Do not raise exceptions when encountering new constants, all new constants are treated
as THINGpublic FolBeliefSet parseBeliefBase(Reader reader) throws IOException, net.sf.tweety.commons.ParserException
parseBeliefBase in class net.sf.tweety.commons.Parser<FolBeliefSet,FolFormula>IOExceptionnet.sf.tweety.commons.ParserExceptionpublic void parseSortDeclaration(String s, FolSignature sig) throws net.sf.tweety.commons.ParserException
s - a stringsig - a signaturenet.sf.tweety.commons.ParserExceptionpublic void parseTypeDeclaration(String s, FolSignature sig) throws net.sf.tweety.commons.ParserException
s - a stringsig - a signaturenet.sf.tweety.commons.ParserExceptionpublic FolFormula parseFormula(Reader reader) throws IOException, net.sf.tweety.commons.ParserException
parseFormula in class net.sf.tweety.commons.Parser<FolBeliefSet,FolFormula>IOExceptionnet.sf.tweety.commons.ParserExceptionpublic FolSignature parseSignature(String s)
public void setSignature(FolSignature signature)
signature - a fol signature.public FolSignature getSignature()
Copyright © 2019. All rights reserved.