Class RowVars

java.lang.Object
com.articulate.sigma.RowVars

public class RowVars extends Object
  • Field Details

    • DEBUG

      public static boolean DEBUG
    • MAX_ARITY

      public static final int MAX_ARITY
      See Also:
  • Constructor Details

    • RowVars

      public RowVars()
  • Method Details

    • findRowVars

      public static Set<String> findRowVars(Formula f)
      Returns:
      a HashSet, possibly empty, containing row variable names, each of which will start with the row variable designator '@'.
    • getRowVarMaxAritiesWithOtherArgs

      public static Map<String,Integer> getRowVarMaxAritiesWithOtherArgs(Map<String,Set<String>> ar, KB kb, Formula f)
      Parameters:
      ar - a list for each variable of all the predicates in which it appears as an argument
    • getRowVarMinAritiesWithOtherArgs

      public static Map<String,Integer> getRowVarMinAritiesWithOtherArgs(Map<String,Set<String>> ar, KB kb, Formula f)
      Parameters:
      ar - a list for each variable of all the predicates in which it appears as an argument
    • getRowVarRelations

      protected static Map<String,Set<String>> getRowVarRelations(Formula f)
      Recurse through the formula looking for row variables. If found, add it to a map that has row variables as keys and a set of predicate names as values.
    • expandRowVars

      public static List<Formula> expandRowVars(KB kb, Formula f)
      Expand row variables, keeping the information about the original source formula. Each variable is treated like a macro that expands to up to seven regular variables. For example (=> (and (subrelation ?REL1 ?REL2) (?REL1 @ROW)) (?REL2 @ROW)) would become (=> (and (subrelation ?REL1 ?REL2) (?REL1 ?ARG1)) (?REL2 ?ARG1)) (=> (and (subrelation ?REL1 ?REL2) (?REL1 ?ARG1 ?ARG2)) (?REL2 ?ARG1 ?ARG2)) etc.
      Returns:
      an ArrayList of Formulas, or an empty ArrayList.
    • main

      public static void main(String[] args)