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.


Constructor Index

 o Sentence()
Construct a new Sentence without initializing it.
 o Sentence(String, String, String)
Constructs a new Sentence which consists of a single predicate with two arguments.
 o Sentence(String, String[])
Construct a new Sentence which consists of a single predicate with any number of arguments.

Method Index

 o addConjunct(Atom)
Adds an additional atom as a conjunct to the existing sentence where the input is the atom to be added.
 o 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.
 o 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.
 o getAtoms()
Returns the vector of atoms that are conjuncted together in the sentence.
 o getVariables()
Returns an array of the variables in the sentence.
 o toString()

Constructors

 o Sentence
 public Sentence()
Construct a new Sentence without initializing it.

 o Sentence
 public Sentence(String predicate,
                 String args[])
Construct a new Sentence which consists of a single predicate with any number of arguments.

 o Sentence
 public Sentence(String predicate,
                 String arg1,
                 String arg2)
Constructs a new Sentence which consists of a single predicate with two arguments.

Methods

 o 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.

 o 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.

 o 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.

 o getAtoms
 public Vector getAtoms()
Returns the vector of atoms that are conjuncted together in the sentence.

 o 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.

 o toString
 public String toString()
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index