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

public class AbaParser<T extends Formula> extends Parser<AbaTheory<T>,Formula>
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.
Author:
Nils Geilen
  • Constructor Details

    • AbaParser

      public AbaParser(Parser<? extends BeliefBase,? extends Formula> formulaparser)
      Creates a new ABA parser.
      Parameters:
      formulaparser - the parser for parsing individual formulae
  • Method Details

    • parseBeliefBase

      public AbaTheory<T> parseBeliefBase(Reader reader) throws IOException, ParserException
      Description copied from class: Parser
      Parses the given reader into a belief base of the given type.
      Specified by:
      parseBeliefBase in class Parser<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

      public Formula parseFormula(Reader reader) throws IOException, ParserException
      Description copied from class: Parser
      Parses the given reader into a formula of the given type.
      Specified by:
      parseFormula in class Parser<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

      public String 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

      public void setSymbolTrue(String symbolTrue)
      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

      public String getSymbolArrow()
      Gets the symbol used to separate the head and body in rules.
      Returns:
      the symbol separating the head and body in rules
    • setSymbolArrow

      public void setSymbolArrow(String symbolArrow)
      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

      public String 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

      public void setSymbolComma(String symbolComma)
      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