Package edu.tufts.hrilab.fol
Class Factory
java.lang.Object
edu.tufts.hrilab.fol.Factory
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SymbolCreates first order logic class based on string description, should be used in cases where it is unknown which FOL class the description string will produce.static PredicatecreateNegatedPredicate(Predicate predicate) Create a negated predicate based on the input predicate.static PredicatecreateNegatedPredicate(String name, Symbol... args) Convenience method to construct a negated predicate (i.e., wrap input in "not" predicate).static PredicatecreateNegatedPredicate(String name, List<? extends Symbol> args) Convenience method to construct a negated predicate (i.e., wrap input in "not" predicate).static PredicatecreatePredicate(String desc) static PredicatecreatePredicate(String name, Symbol... args) static PredicatecreatePredicate(String name, String... args) static PredicatecreatePredicate(String name, List<? extends Symbol> args) static SymbolcreateSymbol(String desc) Creates a Symbol from a string based representation, this supports the syntax of "name:type"static SymbolcreateSymbol(String name, String type) Creates a Symbol with explicit name and typestatic VariablecreateVariable(String desc) static VariablecreateVariable(String name, String type)
-
Field Details
-
log
protected static final org.slf4j.Logger log
-
-
Constructor Details
-
Factory
public Factory()
-
-
Method Details
-
createFOL
Creates first order logic class based on string description, should be used in cases where it is unknown which FOL class the description string will produce.- Parameters:
desc-- Returns:
-
createSymbol
Creates a Symbol from a string based representation, this supports the syntax of "name:type"- Parameters:
desc- sting specify the name and optionally type of the Symbol to be created.- Returns:
-
createSymbol
Creates a Symbol with explicit name and type- Parameters:
name- name of the Symbol to be createdtype- type of the Symbol to be created- Returns:
-
createVariable
-
createVariable
-
createPredicate
-
createPredicate
-
createPredicate
-
createPredicate
-
createNegatedPredicate
Convenience method to construct a negated predicate (i.e., wrap input in "not" predicate).- Parameters:
name-args-- Returns:
-
createNegatedPredicate
Convenience method to construct a negated predicate (i.e., wrap input in "not" predicate).- Parameters:
name-args-- Returns:
-
createNegatedPredicate
Create a negated predicate based on the input predicate. If the input predicate is not negated (i.e., "not" as functor name), then the input predicate is wrapped in a "not" predicate. If the input predicate is already negated, this method will remove the negation.- Parameters:
predicate-- Returns:
-