Class FormulaAST

java.lang.Object
com.articulate.sigma.FormulaAST

public class FormulaAST extends Object
  • Field Details

    • errors

      public Set<String> errors
    • warnings

      public Set<String> warnings
      Warnings found during execution.
    • allVarsCache

      public Set<String> allVarsCache
    • allVarsPairCache

      public List<Set<String>> allVarsPairCache
    • quantVarsCache

      public Set<String> quantVarsCache
    • unquantVarsCache

      public Set<String> unquantVarsCache
    • existVarsCache

      public Set<String> existVarsCache
    • univVarsCache

      public Set<String> univVarsCache
    • termCache

      public Set<String> termCache
  • Constructor Details

    • FormulaAST

      public FormulaAST()
  • Method Details

    • atom

      public boolean atom()
    • listP

      public boolean listP()
    • isVariable

      public boolean isVariable()
    • empty

      public boolean empty()
    • car

      public FormulaAST car()
      This is a non-destructive operation that creates just a new FormulaAST with the Term member, but no caches or auxiliary information, which likely wouldn't be accurate if it were copied.
    • cdr

      public FormulaAST cdr()
      This is a non-destructive operation that creates just a new FormulaAST with the Term member, but no caches or auxiliary information, which likely wouldn't be accurate if it were copied.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • createID

      public String createID()
      Returns:
      a unique ID by appending the hashCode() of the formula String to the file name in which it appears
    • validArgs

      public String validArgs(String filename, Integer lineNo)
      Test whether the Formula uses logical operators and predicates with the correct number of arguments. "equals", "invalid input: '<'=>", and "=>" are strictly binary. "or", "xor" and "and" are binary or greater. "not" is unary. "forall" and "exists" are unary with an argument list. Warn if we encounter a formula that has more arguments than MAX_PREDICATE_ARITY.
      Parameters:
      filename - If not null, denotes the name of the file being parsed.
      lineNo - If not null, indicates the location of the expression (formula) being parsed in the file being read.
      Returns:
      an empty String if there are no problems or an error message if there are.
    • validArgs

      public String validArgs()
      Test whether the Formula uses logical operators and predicates with the correct number of arguments. "equals", "invalid input: '<'=>", and "=>" are strictly binary. "or", "xor" and "and" are binary or greater. "not" is unary. "forall" and "exists" are unary with an argument list. Warn if we encounter a formula that has more arguments than MAX_PREDICATE_ARITY.
      Returns:
      an empty String if there are no problems or an error message if there are.
    • badQuantification

      public String badQuantification()
      Not yet implemented! Test whether the Formula has variables that are not properly quantified. The case tested for is whether a quantified variable in the antecedent appears in the consequent or vice versa.
      Returns:
      an empty String if there are no problems or an error message if there are.
    • read

      public void read(FormulaAST input)
    • read

      public void read(String input)