All Packages Class Hierarchy This Package Previous Next Index
Class ShoeKb.Sentence
java.lang.Object
|
+----ShoeKb.Sentence
- public class Sentence
- extends Object
A logical formula. This formula may be asserted to a knowledge base
or may be a query to a knowledge base. Currently, a sentence can consist
of one or more atoms conjuncted together, where an atom is a predicate
with one or more arguments. An argument may be a literal or a variable,
where variables are indicated by preceding them with a question mark.
-
Sentence()
- Construct a new Sentence without initializing it.
-
Sentence(String, String, String)
- Constructs a new Sentence which consists of a single predicate with
two arguments.
-
Sentence(String, String[])
- Construct a new Sentence which consists of a single predicate with
any number of arguments.
-
addConjunct(Atom)
- Adds an additional atom as a conjunct to the existing sentence
where the input is the atom to be added.
-
addConjunct(String, String, String)
- Adds an additional atom as a conjunct to the existing sentence
where the atom consists of a predicate and two arguments.
-
addConjunct(String, String[])
- Adds an additional atom as a conjunct to the existing sentence
where the conjunct consists of a predicate and a set of
arguments.
-
getAtoms()
- Returns the vector of atoms that are conjuncted together
in the sentence.
-
getVariables()
- Returns an array of the variables in the sentence.
-
toString()
-
Sentence
public Sentence()
- Construct a new Sentence without initializing it.
Sentence
public Sentence(String predicate,
String args[])
- Construct a new Sentence which consists of a single predicate with
any number of arguments.
Sentence
public Sentence(String predicate,
String arg1,
String arg2)
- Constructs a new Sentence which consists of a single predicate with
two arguments.
addConjunct
public void addConjunct(String predicate,
String args[])
- Adds an additional atom as a conjunct to the existing sentence
where the conjunct consists of a predicate and a set of
arguments.
addConjunct
public void addConjunct(String predicate,
String arg1,
String arg2)
- Adds an additional atom as a conjunct to the existing sentence
where the atom consists of a predicate and two arguments.
addConjunct
public void addConjunct(Atom atom)
- Adds an additional atom as a conjunct to the existing sentence
where the input is the atom to be added.
getAtoms
public Vector getAtoms()
- Returns the vector of atoms that are conjuncted together
in the sentence.
getVariables
public String[] getVariables()
- Returns an array of the variables in the sentence. They are
returned in the order in which they appear in the sentence.
toString
public String toString()
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index