All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JavaAgent.resource.fopl.FOPLFormula

java.lang.Object
   |
   +----JavaAgent.resource.Language
           |
           +----JavaAgent.resource.fopl.FOPLFormula

public class FOPLFormula
extends Language
implements Parsable, KRSentence
A FOPLFormula is a rather ugly side effect necessary to allow the inheritance from the JAT Language class. Formula cannot directly inherit from the Language class because Formula is an abstract class. Hence, this class, FOPLFormula, inherits from Language and contains only exactly one object, a Formula.

See Also:
Language, Formula

Variable Index

 o theForm
The Formula contained in this FOPLFormula.

Constructor Index

 o FOPLFormula()
This constructor creates an empty instance of a FOPLFormula.
 o FOPLFormula(String)
This constructor for a FOPLFormula parses the given String and creates the according Formula.

Method Index

 o clone()
This function generates a copy of this FOPLFormula.
 o clone(Substitution)
Returns a copy of this Formula with Variables replaced according to the given Substitution.
 o equals(Object)
This function tests whether this and the given Object are equal.
 o getConclusion()
This function returns the conclusion of this implication.
 o getConjunction(Vector)
This function returns a FOPLFormula that represents a conjunction of the KRSentences in the given Vector.
 o getFormula()
This function returns the Formula embedded in this FOPLFormula.
 o getKBClass()
This function returns the Class that implements KnowledgeBase for this KRSentence Class.
 o getPremise()
This function returns the premise of this implication.
 o parse(InputStream)
This function can be used to parse a given InputStream that represents a Formula.
 o parse(String)
This function can be used to parse a given String that represents a FOPLFormula.
 o parseString(String)
This function should only be used on empty instances of a FOPLFormula.
 o toString()
This function returns the String that represents this FOPLFormula.

Variables

 o theForm
 protected Formula theForm
The Formula contained in this FOPLFormula.

Constructors

 o FOPLFormula
 public FOPLFormula()
This constructor creates an empty instance of a FOPLFormula.

 o FOPLFormula
 public FOPLFormula(String input) throws ParseException
This constructor for a FOPLFormula parses the given String and creates the according Formula.

Parameters:
input - The string to be parsed.
Throws: ParseException
An Exception can occur if parsing fails.

Methods

 o clone
 public Object clone()
This function generates a copy of this FOPLFormula. The copy will contain a clone of the Formula contained in this one.

Returns:
an equal copy of this FOPLFormula
Overrides:
clone in class Object
 o clone
 public FOPLFormula clone(Substitution s) throws IllegalArgumentException
Returns a copy of this Formula with Variables replaced according to the given Substitution. Symbols in the copy will be the same as the original ones but Variables will be repalced by the respective Terms in the given Substitution. A Variable not occurring in the Substitution will be replaced by a new (different) Variable with the same name. The given Substitution will be extended to include the mappings of old Variables to new ones.

This function can also be used to generate a copy of this Formula that contains a new set of Variables. The given Substitution should be a new, empty Substitution in this case. Otherwise cloning can be seen as instantiating the Formula.

Parameters:
s - the Substitution that tells us how to replace Variables
Returns:
a new FOPLFormula that is an instance of this FOPLFormula; the Substitution s will be extended with any new Variable replacements introduced
Throws: IllegalArgumentException
An exception can occur if the given Substitution is null. In this case clone() (above) should be used.
 o getFormula
 protected Formula getFormula()
This function returns the Formula embedded in this FOPLFormula.

Returns:
the Formula embedded in this FOPLFormula
 o equals
 public boolean equals(Object otherForm)
This function tests whether this and the given Object are equal. In general, two FOPLFormulae are equal if they contain equal Formulae.

Parameters:
otherForm - the FOPLFormula this one is to be compared to
Returns:
whether the given Object is equal to this one
Overrides:
equals in class Object
 o toString
 public String toString()
This function returns the String that represents this FOPLFormula.

Overrides:
toString in class Object
 o getConjunction
 public static KRSentence getConjunction(Vector conjuncts)
This function returns a FOPLFormula that represents a conjunction of the KRSentences in the given Vector.

Parameters:
conjuncts - a Vector of FOPLFormulas
Returns:
a FOPLFormula containing the conjunction of the given FOPLFormulas
 o getKBClass
 public static Class getKBClass()
This function returns the Class that implements KnowledgeBase for this KRSentence Class.

 o getPremise
 public FOPLFormula getPremise()
This function returns the premise of this implication.

 o getConclusion
 public FOPLFormula getConclusion()
This function returns the conclusion of this implication.

 o parseString
 public void parseString(String input)
This function should only be used on empty instances of a FOPLFormula. It will parse the given String and create the according Formula to be kept in this FOPLFormaula.

Parameters:
input - The string to be parsed.
Overrides:
parseString in class Language
 o parse
 public static FOPLFormula parse(String s) throws IllegalArgumentException, ParseException
This function can be used to parse a given String that represents a FOPLFormula. The syntax is as for a Formula.

Throws: IllegalArgumentException
An exception will occur if the supplied String is empty or null.
Throws: ParseException
An exception can occur if parsing failed. Potential reasons include a syntax error or an I/O problem.
 o parse
 public static FOPLFormula parse(InputStream ist) throws IllegalArgumentException, IOException, ParseException
This function can be used to parse a given InputStream that represents a Formula. The syntax is as for a Formula.


All Packages  Class Hierarchy  This Package  Previous  Next  Index