Class AspFolTranslator

java.lang.Object
org.tweetyproject.logics.translators.Translator
org.tweetyproject.logics.translators.aspfol.AspFolTranslator
Direct Known Subclasses:
AspNlpTranslator

public class AspFolTranslator extends Translator
This Translator can translate between FOL and ASP literals (without default negated literals).
Author:
Tim Janus
  • Field Details

    • TT_NEGATION

      public static final int TT_NEGATION
      Constant representing translation type for negation
      See Also:
  • Constructor Details

    • AspFolTranslator

      public AspFolTranslator()
      Default constructor for the AspFolTranslator class
  • Method Details

    • toFOL

      public FolAtom toFOL(ASPAtom source)
      Translates an ASPAtom to its corresponding FolAtom.
      Parameters:
      source - the ASPAtom to be translated
      Returns:
      the translated FolAtom
    • toASP

      public ASPAtom toASP(FolAtom source)
      Translates a FolAtom to its corresponding ASPAtom.
      Parameters:
      source - the FolAtom to be translated
      Returns:
      the translated ASPAtom
    • toASP

      public ASPLiteral toASP(FolFormula source)
      Translates a FolFormula to an ASPLiteral. If the formula is an atom or negation, it will translate accordingly.
      Parameters:
      source - the FolFormula to be translated
      Returns:
      the translated ASPLiteral
    • toFOL

      public Negation toFOL(StrictNegation source)
      Translates a StrictNegation into a Negation for FOL.
      Parameters:
      source - the StrictNegation to be translated
      Returns:
      the translated Negation
    • toASP

      public StrictNegation toASP(Negation source)
      Translates a Negation from FOL into a StrictNegation for ASP.
      Parameters:
      source - the Negation to be translated
      Returns:
      the translated StrictNegation
    • toFOL

      public FolFormula toFOL(ASPLiteral source)
      Translates an ASPLiteral to a FolFormula. If the literal is an atom or negation, it will translate accordingly.
      Parameters:
      source - the ASPLiteral to be translated
      Returns:
      the translated FolFormula
    • toFOL

      public Disjunction toFOL(ClassicalHead source)
      Translates a ClassicalHead (ASP disjunction) to a FOL Disjunction.
      Parameters:
      source - the ClassicalHead to be translated
      Returns:
      the translated Disjunction
    • toASP

      public ClassicalHead toASP(Disjunction source)
      Translates a FOL Disjunction into an ASP ClassicalHead.
      Parameters:
      source - the Disjunction to be translated
      Returns:
      the translated ClassicalHead
    • translateUsingMap

      public SimpleLogicalFormula translateUsingMap(SimpleLogicalFormula source)
      Translates the given formula using the translation map, handling custom logic for negations if needed.
      Overrides:
      translateUsingMap in class Translator
      Parameters:
      source - the source formula to be translated
      Returns:
      the translated SimpleLogicalFormula or null if no translation could be performed