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 Symbol
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.static Predicate
createNegatedPredicate
(Predicate predicate) Create a negated predicate based on the input predicate.static Predicate
createNegatedPredicate
(String name, Symbol... args) Convenience method to construct a negated predicate (i.e., wrap input in "not" predicate).static Predicate
createNegatedPredicate
(String name, List<? extends Symbol> args) Convenience method to construct a negated predicate (i.e., wrap input in "not" predicate).static Predicate
createPredicate
(String desc) static Predicate
createPredicate
(String name, Symbol... args) static Predicate
createPredicate
(String name, String... args) static Predicate
createPredicate
(String name, List<? extends Symbol> args) static Symbol
createSymbol
(String desc) Creates a Symbol from a string based representation, this supports the syntax of "name:type"static Symbol
createSymbol
(String name, String type) Creates a Symbol with explicit name and typestatic Variable
createVariable
(String desc) static Variable
createVariable
(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:
-