Class TseitinTransformer

java.lang.Object
org.tweetyproject.arg.adf.transform.TseitinTransformer
All Implemented Interfaces:
Collector<Literal,Clause>, Transformer<Pair<Literal,Collection<Clause>>>

public final class TseitinTransformer extends Object implements Collector<Literal,Clause>, Transformer<Pair<Literal,Collection<Clause>>>
TseitinTransformer class
  • Method Details

    • ofPositivePolarity

      public static TseitinTransformer ofPositivePolarity(boolean optimize)
      Creates a new TseitinTransformer instance with positive root polarity and default argument-to-literal mapping.
      Parameters:
      optimize - A boolean indicating whether optimizations should be applied.
      Returns:
      A new TseitinTransformer instance with positive polarity.
    • ofNegativePolarity

      public static TseitinTransformer ofNegativePolarity(boolean optimize)
      Creates a new TseitinTransformer instance with negative root polarity and default argument-to-literal mapping.
      Parameters:
      optimize - A boolean indicating whether optimizations should be applied.
      Returns:
      A new TseitinTransformer instance with negative polarity.
    • ofPositivePolarity

      public static TseitinTransformer ofPositivePolarity(Function<Argument,Literal> mapping, boolean optimize)
      Creates a new TseitinTransformer instance with positive root polarity and a custom argument-to-literal mapping.
      Parameters:
      mapping - A Function<Argument, Literal> that maps arguments to literals.
      optimize - A boolean indicating whether optimizations should be applied.
      Returns:
      A new TseitinTransformer instance with positive polarity.
    • ofNegativePolarity

      public static TseitinTransformer ofNegativePolarity(Function<Argument,Literal> mapping, boolean optimize)
      Creates a new TseitinTransformer instance with negative root polarity and a custom argument-to-literal mapping.
      Parameters:
      mapping - A Function<Argument, Literal> that maps arguments to literals.
      optimize - A boolean indicating whether optimizations should be applied.
      Returns:
      A new TseitinTransformer instance with negative polarity.
    • collect

      public Literal collect(AcceptanceCondition acc, Consumer<Clause> clauses)
      Description copied from interface: Collector
      Traverses through the given AcceptanceCondition and calls the provided consumer on all the collected data.
      Specified by:
      collect in interface Collector<Literal,Clause>
      Parameters:
      acc - the acceptance condition
      clauses - the consumer which is used as a callback for the collected data.
      Returns:
      the result we may compute while collecting data
    • transform

      public Pair<Literal,Collection<Clause>> transform(AcceptanceCondition acc)
      Description copied from interface: Transformer
      Transforms the given acceptance condition into another structure.
      Specified by:
      transform in interface Transformer<Pair<Literal,Collection<Clause>>>
      Parameters:
      acc - the acceptance condition
      Returns:
      the transformed result