public class Interpreter extends Object
Constructor and Description |
---|
Interpreter()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
isAnd(String string)
Deprecated.
Checks whether the input string matches an and-clause.
|
static boolean |
isConstant(String string)
Deprecated.
Checks whether the input string matches the constant pattern.
|
static boolean |
isDPostDeclaration(String string)
Deprecated.
Checks whether the input string matches the DPost declaration pattern.
|
static boolean |
isEquality(String string)
Deprecated.
Checks whether the input string matches an equality clause.
|
static boolean |
isNegation(String string)
Deprecated.
Checks whether the input string matches an negative clause.
|
static boolean |
isReactiveRule(String string)
Deprecated.
Checks whether the input string matches a reactive rule.
|
static boolean |
isRule(String string)
Deprecated.
Checks whether the input string matches a rule.
|
static boolean |
isSimpleSentence(String string)
Deprecated.
Checks whether the input string matches the simple sentence pattern.
|
static boolean |
isVariable(String string)
Deprecated.
Checks whether the input string matches the variable pattern.
|
static And |
stringToAnd(String string,
HashMap<String,Variable> variables)
Deprecated.
Converts the input string into a
And object. |
static Clause |
stringToClause(String string,
HashMap<String,Variable> variables)
Deprecated.
Converts the input string into a
Clause object. |
static Constant |
stringToConstant(String string)
Deprecated.
Converts the input string into a
Constant object. |
static DPostDeclaration |
stringToDPost(String string,
HashMap<String,Variable> variables)
Deprecated.
Converts the input string into a
DPostDeclaration object. |
static Equal |
stringToEquality(String string,
HashMap<String,Variable> variables)
Deprecated.
Converts the input string into a
Equal object. |
static Not |
stringToNegation(String string,
HashMap<String,Variable> variables)
Deprecated.
Converts the input string into a
Not object. |
static ReactiveRule |
stringToReactiveRule(String string,
HashMap<String,Variable> variables)
Deprecated.
Converts the input string into a
ReactiveRule object. |
static Rule |
stringToRule(String string,
HashMap<String,Variable> variables)
Deprecated.
Converts the input string into a
Rule object. |
static SimpleSentence |
stringToSimpleSentence(String string,
HashMap<String,Variable> variables)
Deprecated.
Converts the input string into a
SimpleSentence object. |
static Variable |
stringToVariable(String string,
HashMap<String,Variable> variables)
Deprecated.
Converts the input string into a
Variable object. |
public static boolean isConstant(String string)
This method is used to throw exceptions in stringToConstant()
.
string
- that is the constant.public static Constant stringToConstant(String string) throws RemoteException
Constant
object. The input
string should be a constant.string
- to be converted into the Constant
object.Constant
object representing the constant string
input.RemoteException
- if the input does not correspond to a constant according to
the method isConstant()
.Constant
,
isConstant(String)
public static boolean isVariable(String string)
This method is used to throw exceptions in
stringToVariable()
.
string
- that is the variable.public static Variable stringToVariable(String string, HashMap<String,Variable> variables) throws RemoteException
Variable
object. The input
string should be a variable.
The variable variables
is used to pass the variables created to
the whole clause to avoid to create two different variables for the same
one. Initialize it with null
or a brand new HashMap
.
string
- to be converted into the Variable
object.variables
- the variables already created to be reused if necessary and it
will be updated with the new created variables.Variable
object representing the variable string
input.RemoteException
- if the input does not correspond to a variable according to
the method isVariable()
.Variable
,
isVariable(String)
public static boolean isSimpleSentence(String string)
isConstant()
and
isVariable()
.
See a Prolog documentation for more information about Prolog predicate.
This method is used to throw exceptions in
stringToSimpleSentence()
.
This method is used to throw exceptions in
stringToSimpleSentence()
.
string
- to be checked whether it is a simple sentence or not.public static SimpleSentence stringToSimpleSentence(String string, HashMap<String,Variable> variables) throws RemoteException
SimpleSentence
object. The input
string should be a simple sentence. It uses the methods
stringToAnd()
,
stringToNegation()
and
stringToSimpleSentence()
recursively to create the whole clause.
The variable variables
is used to pass the variables created to
the whole clause to avoid to create two different variables for the same
one. Initialize it with null
or a brand new HashMap
.
string
- to be converted into the SimpleSentence
object.variables
- the variables already created to be reused if necessary and it
will be updated with the new created variables.SimpleSentence
object representing the simple
sentence string input.RemoteException
- if the input does not correspond to a simple sentence
according to the method isSimpleSentence
.SimpleSentence
,
isSimpleSentence(String)
public static boolean isDPostDeclaration(String string)
This method is used to throw exceptions in
stringToDPost()
.
See a LPS documentation for more details on DPost declaration.
string
- to be checked whether or not it matches the DPost declaration
syntax.public static DPostDeclaration stringToDPost(String string, HashMap<String,Variable> variables) throws RemoteException
DPostDeclaration
object. The
input string should be a DPost declaration. It creates an
Initiator
or a Terminator
object depending on the input.
The variable variables
is used to pass the variables created to
the whole clause to avoid to create two different variables for the same
one. Initialize it with null
or a brand new HashMap
.
string
- to be converted into the DPostDeclaration
object.variables
- the variables already created to be reused if necessary and it
will be updated with the new created variables.DPostDeclaration
object representing the simple
sentence string input. It will be either a Initiator
object or an Terminator
object.RemoteException
- if the input does not correspond to a DPostDeclaration
according to the method isDPostDeclaration()
.SimpleSentence
,
isSimpleSentence(String)
public static boolean isAnd(String string)
This method is used to throw exceptions in
stringToAnd()
.
string
- to be checked whether or not it is an and-clause.public static boolean isNegation(String string)
This method is used to throw exceptions in
stringToNegation()
.
string
- to be checked whether or not it is a negative clause.public static boolean isEquality(String string)
This method is used to throw exceptions in
stringToEquality()
.
string
- to be checked whether or not it is an equality clause.public static And stringToAnd(String string, HashMap<String,Variable> variables) throws RemoteException
And
object. The input string
should be an and-clause. It uses the methods
stringToAnd()
,
stringToNegation()
and
stringToSimpleSentence()
recursively to create the whole clause.
The variable variables
is used to pass the variables created to
the whole clause to avoid to create two different variables for the same
one. Initialize it with null
or a brand new HashMap
.
string
- to be converted into the And
object.variables
- the variables already created to be reused if necessary and it
will be updated with the new created variables.And
object representing the and-clause string input.RemoteException
- if the input does not correspond to an and-clause according
to the method isAnd()
.And
,
isAnd(String)
public static Not stringToNegation(String string, HashMap<String,Variable> variables) throws RemoteException
Not
object. The input string
should be a negative clause. It uses the methods
stringToAnd()
,
stringToNegation()
and
stringToSimpleSentence()
recursively to create the whole clause.
The variable variables
is used to pass the variables created to
the whole clause to avoid to create two different variables for the same
one. Initialize it with null
or a brand new HashMap
.
string
- to be converted into the Not
object.variables
- the variables already created to be reused if necessary and it
will be updated with the new created variables.Not
object representing the negative clause string
input.RemoteException
- if the input does not correspond to a negative clause
according to the method isNot()
.Not
,
isNegation(String)
public static Equal stringToEquality(String string, HashMap<String,Variable> variables) throws RemoteException
Equal
object. The input string
should be an equality clause. It uses the methods
stringToConstant()
,
stringToVariable()
and
stringToSimpleSentence()
recursively to create the whole clause.
The variable variables
is used to pass the variables created to
the whole clause to avoid to create two different variables for the same
one. Initialize it with null
or a brand new HashMap
.
string
- to be converted into the Equal
object.variables
- the variables already created to be reused if necessary and it
will be updated with the new created variables.Equal
object representing the equality clause string
input.RemoteException
- if the input does not correspond to an equality clause
according to the method isEquality()
.Equal
,
isEquality(String)
public static Clause stringToClause(String string, HashMap<String,Variable> variables) throws RemoteException
Clause
object. The input string
should be a clause. It uses the methods
stringToAnd()
,
stringToNegation()
and
stringToSimpleSentence()
recursively to create the whole clause.
The variable variables
is used to pass the variables created to
the whole clause to avoid to create two different variables for the same
one. Initialize it with null
or a brand new HashMap
.
string
- to be converted into the Clause
object.variables
- the variables already created to be reused if necessary and it
will be updated with the new created variables.Clause
object representing the clause string input.RemoteException
- if the input does not correspond to a clause according to the
method isNot()
, isAnd()
or
isSimpleSentence()
.Clause
,
isNegation(String)
,
isAnd(String)
,
isSimpleSentence(String)
public static boolean isReactiveRule(String string)
This method is used to throw exceptions in
stringToReactiveRule()
.
string
- to be checked whether or not it is a reactive rule.public static ReactiveRule stringToReactiveRule(String string, HashMap<String,Variable> variables) throws RemoteException
ReactiveRule
object. The input
string should be a reactive rule. It uses the methods
stringToClause()
and
stringToSimpleSentence()
recursively to create the reactive rule.
The variable variables
is used to pass the variables created to
the whole clause to avoid to create two different variables for the same
one. Initialize it with null
or a brand new HashMap
.
string
- to be converted into the ReactiveRule
object.variables
- the variables already created to be reused if necessary and it
will be updated with the new created variables.ReactiveRule
object representing the reactive rule
string input.RemoteException
- if the input does not correspond to a reactive rule according
to the method isReactiveRule()
ReactiveRule
,
isReactiveRule(String)
public static boolean isRule(String string)
This method is used to throw exceptions in
stringToRule()
.
string
- to be checked whether or not it is a rule.public static Rule stringToRule(String string, HashMap<String,Variable> variables) throws RemoteException
Rule
object. The input string
should be a rule. It uses the methods
stringToClause()
and
stringToSimpleSentence()
recursively to create the rule.
The variable variables
is used to pass the variables created to
the whole clause to avoid to create two different variables for the same
one. Initialize it with null
or a brand new HashMap
.
string
- to be converted into the Rule
object.variables
- the variables already created to be reused if necessary and it
will be updated with the new created variables.Rule
object representing the reactive rule string
input.RemoteException
- if the input does not correspond to a reactive rule according
to the method isRule()
Rule
,
isRule(String)