Package com.articulate.sigma
Class PredVarInst
java.lang.Object
com.articulate.sigma.PredVarInst
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanstatic final Stringstatic booleanstatic boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThere are two type conditions: one type condition is extracted from domain expression; second type condition is specifically defined in the antecedent of a rule with an instance or subclass expressionstatic voidfindPredVarTypes(Formula f, KB kb) Get a set of all the types for predicate variables in the formula.gatherPredVarRecurse(KB kb, Formula f) Get a set of all the predicate variables in the formula.gatherPredVars(KB kb, Formula f) Collect and return all predicate variables for the given formulahandleDoubles(KB kb) A bit of a hack to produce the statements that would result from the only two axioms in SUMO with two predicate variablesstatic StringhasCorrectArity(Formula f, KB kb) If arity is correct, return null, otherwise, return the predicate that has its arity violated in the given formula.static voidinit()instantiatePredVars(Formula input, KB kb) static voidstatic voidtest()
-
Field Details
-
DOUBLE_PREDICATE_AXIOM
- See Also:
-
predVarArity
-
debug
public static boolean debug -
rejectDoubles
public static boolean rejectDoubles -
doublesHandled
public static boolean doublesHandled
-
-
Constructor Details
-
PredVarInst
public PredVarInst()
-
-
Method Details
-
init
public static void init() -
addExplicitTypes
protected static Map<String,Set<String>> addExplicitTypes(KB kb, Formula input, Map<String, Set<String>> types) There are two type conditions: one type condition is extracted from domain expression; second type condition is specifically defined in the antecedent of a rule with an instance or subclass expression- Parameters:
kb- the current knowledge baseinput- formulatypes- type condition extracted from domain expression. This is a HashMap in which the keys are predicate variables, and the values are HashSets containing one or more class names that indicate the type constraints that apply to the variable- Returns:
- add explicit type condition into types
-
handleDoubles
A bit of a hack to produce the statements that would result from the only two axioms in SUMO with two predicate variables -
instantiatePredVars
- Parameters:
input- formulakb- knowledge base- Returns:
- A list of formulas where predicate variables are instantiated; There are three possible returns: return null if input contains predicate variables but cannot be instantiated; return empty if input contains no predicate variables; return a list of instantiated formulas if the predicate variables are instantiated;
-
hasCorrectArity
If arity is correct, return null, otherwise, return the predicate that has its arity violated in the given formula. -
gatherPredVarRecurse
Get a set of all the predicate variables in the formula. If the argument list has a row variable, return 0 as the value, meaning any possible arity of 1 - maxArity -
findPredVarTypes
Get a set of all the types for predicate variables in the formula.- Returns:
- a HashMap in which the keys are predicate variables, and the values are HashSets containing one or more class names that indicate the type constraints that apply to the variable. If no predicate variables can be gathered from the Formula, the HashMap will be empty. Note that predicate variables must logically be instances (of class Relation).
-
gatherPredVars
Collect and return all predicate variables for the given formula -
arityTest
public static void arityTest() -
test
public static void test() -
main
-