Package org.tweetyproject.arg.aba.parser
Class AbaParser<T extends Formula>
java.lang.Object
org.tweetyproject.commons.Parser<AbaTheory<T>,Formula>
org.tweetyproject.arg.aba.parser.AbaParser<T>
- Type Parameters:
T
- the type of formulas (language) that the ABA theory ranges over
Parses an Assumption-Based Argumentation (ABA) System from an input text.
The standard symbols used in the syntax are:
<rule> ::= <head> '<-' <body>?
<head> ::= <word>
<body> ::= 'true' | <word> (',' <word>)*
<assumption> ::= <word>
<assumptions> ::= '{' <assumption> (',' <assumption>)* '}'
where <word> is a term in the theory's language.
<rule> ::= <head> '<-' <body>?
<head> ::= <word>
<body> ::= 'true' | <word> (',' <word>)*
<assumption> ::= <word>
<assumptions> ::= '{' <assumption> (',' <assumption>)* '}'
where <word> is a term in the theory's language.
- Author:
- Nils Geilen
-
Constructor Summary
ConstructorDescriptionAbaParser
(Parser<? extends BeliefBase, ? extends Formula> formulaparser) Creates a new ABA parser. -
Method Summary
Modifier and TypeMethodDescriptionGets the symbol used to separate the head and body in rules.Gets the symbol used for separating assumptions.Gets the symbol representing 'true' in rules.parseBeliefBase
(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.void
setSymbolArrow
(String symbolArrow) Sets the symbol used to separate the head and body in rules.void
setSymbolComma
(String symbolComma) Sets the symbol used for separating assumptions.void
setSymbolTrue
(String symbolTrue) Sets the symbol representing 'true' in rules.Methods inherited from class org.tweetyproject.commons.Parser
isNumeric, parseBeliefBase, parseBeliefBaseFromFile, parseFormula, parseFormulaFromFile, parseListOfBeliefBases, parseListOfBeliefBases, parseListOfBeliefBasesFromFile, parseListOfBeliefBasesFromFile
-
Constructor Details
-
AbaParser
Creates a new ABA parser.- Parameters:
formulaparser
- the parser for parsing individual formulae
-
-
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<AbaTheory<T extends Formula>,
Formula> - Parameters:
reader
- a reader- Returns:
- a belief base
- Throws:
IOException
- if some IO issue occurred.ParserException
- some parsing exceptions may be added here.
-
parseFormula
Description copied from class:Parser
Parses the given reader into a formula of the given type.- Specified by:
parseFormula
in classParser<AbaTheory<T extends Formula>,
Formula> - Parameters:
reader
- a reader- Returns:
- a formula
- Throws:
IOException
- if some IO issue occurred.ParserException
- some parsing exceptions may be added here.
-
getSymbolTrue
Gets the symbol representing 'true' in rules. This is the symbol used to represent a 'true' condition in rule bodies.- Returns:
- the symbol representing 'true' in rules
-
setSymbolTrue
Sets the symbol representing 'true' in rules. This allows setting a custom symbol to represent 'true' in rule bodies.- Parameters:
symbolTrue
- the symbol to set for 'true'
-
getSymbolArrow
Gets the symbol used to separate the head and body in rules.- Returns:
- the symbol separating the head and body in rules
-
setSymbolArrow
Sets the symbol used to separate the head and body in rules. This allows setting a custom symbol to represent the arrow in the rule definitions.- Parameters:
symbolArrow
- the symbol to set for the arrow
-
getSymbolComma
Gets the symbol used for separating assumptions. This is the symbol used to separate different assumptions in the assumption set.- Returns:
- the symbol used for separating assumptions
-
setSymbolComma
Sets the symbol used for separating assumptions. This allows setting a custom symbol to separate assumptions in the assumption set.- Parameters:
symbolComma
- the symbol to set for separating assumptions
-