Package com.articulate.sigma
Class FormulaAST
java.lang.Object
com.articulate.sigma.FormulaAST
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclassclassclassclassclassclassclassclassclass -
Field Summary
FieldsModifier and TypeFieldDescriptionWarnings found during execution. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanatom()Not yet implemented! Test whether the Formula has variables that are not properly quantified.car()This is a non-destructive operation that creates just a new FormulaAST with the Term member, but no caches or auxiliary information, which likely wouldn't be accurate if it were copied.cdr()This is a non-destructive operation that creates just a new FormulaAST with the Term member, but no caches or auxiliary information, which likely wouldn't be accurate if it were copied.createID()booleanempty()booleanbooleanlistP()voidread(FormulaAST input) voidtoString()Test whether the Formula uses logical operators and predicates with the correct number of arguments.Test whether the Formula uses logical operators and predicates with the correct number of arguments.
-
Field Details
-
errors
-
warnings
Warnings found during execution. -
allVarsCache
-
allVarsPairCache
-
quantVarsCache
-
unquantVarsCache
-
existVarsCache
-
univVarsCache
-
termCache
-
-
Constructor Details
-
FormulaAST
public FormulaAST()
-
-
Method Details
-
atom
public boolean atom() -
listP
public boolean listP() -
isVariable
public boolean isVariable() -
empty
public boolean empty() -
car
This is a non-destructive operation that creates just a new FormulaAST with the Term member, but no caches or auxiliary information, which likely wouldn't be accurate if it were copied. -
cdr
This is a non-destructive operation that creates just a new FormulaAST with the Term member, but no caches or auxiliary information, which likely wouldn't be accurate if it were copied. -
toString
-
createID
- Returns:
- a unique ID by appending the hashCode() of the formula String to the file name in which it appears
-
validArgs
Test whether the Formula uses logical operators and predicates with the correct number of arguments. "equals", "invalid input: '<'=>", and "=>" are strictly binary. "or", "xor" and "and" are binary or greater. "not" is unary. "forall" and "exists" are unary with an argument list. Warn if we encounter a formula that has more arguments than MAX_PREDICATE_ARITY.- Parameters:
filename- If not null, denotes the name of the file being parsed.lineNo- If not null, indicates the location of the expression (formula) being parsed in the file being read.- Returns:
- an empty String if there are no problems or an error message if there are.
-
validArgs
Test whether the Formula uses logical operators and predicates with the correct number of arguments. "equals", "invalid input: '<'=>", and "=>" are strictly binary. "or", "xor" and "and" are binary or greater. "not" is unary. "forall" and "exists" are unary with an argument list. Warn if we encounter a formula that has more arguments than MAX_PREDICATE_ARITY.- Returns:
- an empty String if there are no problems or an error message if there are.
-
badQuantification
Not yet implemented! Test whether the Formula has variables that are not properly quantified. The case tested for is whether a quantified variable in the antecedent appears in the consequent or vice versa.- Returns:
- an empty String if there are no problems or an error message if there are.
-
read
-
read
-