Class AspicParser<T extends net.sf.tweety.logics.commons.syntax.interfaces.Invertable>

  • Type Parameters:
    T - is the type of the language that the ASPIC theory's rules range over

    public class AspicParser<T extends net.sf.tweety.logics.commons.syntax.interfaces.Invertable>
    extends net.sf.tweety.commons.Parser<AspicArgumentationTheory<T>,​net.sf.tweety.commons.Formula>
    Parses a Aspic Argumentation System out of an input text. Every line contains one of the following:
    <order> ::= <identifier> ( '<' <identifier> )+
    <ordinary premise> ::= '=>' '-'? <identifier>
    <axiom> ::= '->' '-'? <identifier>
    <defeasible rule> ::= ( <identifier> ':' )? <identifier> ( ',' <identifier> )* '=>' (-)? <identifier>
    <static rule> ::= <identifier> ( ',' <identifier> )* '->' (-)? <identifier>
    Author:
    Nils Geilen
    • Constructor Detail

      • AspicParser

        public AspicParser​(net.sf.tweety.commons.Parser<? extends net.sf.tweety.commons.BeliefBase,​? extends net.sf.tweety.commons.Formula> formulaparser,
                           RuleFormulaGenerator<T> rfg)
        Constructs a new instance
        Parameters:
        formulaparser - parses the bodies and the heads of the ASPIC argumentation systems rules
        rfg - a generator, that transforms InferenceRule<T> into T
    • Method Detail

      • setSymbolStrict

        public void setSymbolStrict​(String symbolStrict)
        Sets a new symbol used for parsing strict function arrows
        Parameters:
        symbolStrict - is the new symbol
      • setSymbolDefeasible

        public void setSymbolDefeasible​(String symbolDefeasible)
        Sets a new symbol used for parsing defeasible function arrows
        Parameters:
        symbolDefeasible - is the new symbol
      • setSymbolComma

        public void setSymbolComma​(String symbolComma)
        Sets a new symbol used for parsing parameter separators
        Parameters:
        symbolComma - is the new symbol
      • parseBeliefBase

        public AspicArgumentationTheory<T> parseBeliefBase​(Reader reader)
                                                    throws IOException,
                                                           net.sf.tweety.commons.ParserException
        Specified by:
        parseBeliefBase in class net.sf.tweety.commons.Parser<AspicArgumentationTheory<T extends net.sf.tweety.logics.commons.syntax.interfaces.Invertable>,​net.sf.tweety.commons.Formula>
        Throws:
        IOException
        net.sf.tweety.commons.ParserException
      • parseFormula

        public net.sf.tweety.commons.Formula parseFormula​(Reader reader)
                                                   throws IOException,
                                                          net.sf.tweety.commons.ParserException
        Specified by:
        parseFormula in class net.sf.tweety.commons.Parser<AspicArgumentationTheory<T extends net.sf.tweety.logics.commons.syntax.interfaces.Invertable>,​net.sf.tweety.commons.Formula>
        Throws:
        IOException
        net.sf.tweety.commons.ParserException
      • parseSimpleOrder

        public SimpleAspicOrder<T> parseSimpleOrder​(String line)
        Extracts and Constructs a SimpleAspicOrder out of a string
        Parameters:
        line - the source string
        Returns:
        the parsed order