Package com.articulate.sigma
Class RowVars
java.lang.Object
com.articulate.sigma.RowVars
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexpandRowVars(KB kb, Formula f) Expand row variables, keeping the information about the original source formula.Recurse through the formula looking for row variables.static void
-
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
- 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
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
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
-