public class Brackets extends Expression
EPSILON
Constructor  Description 

Brackets(List<Expression> expressions) 
Initializes a new vector, which is a list of expressions enclosed in
brackets.

Brackets(Expression enclosed) 
Initializes a new expression in brackets.

Modifier and Type  Method  Description 

Expression 
copy() 
Creates a copy of this object.

Value 
eval(Bindings bindings) 
Evaluates this expression using the specified variable bindings.

String 
format(FormatVisitor visitor) 
Formats this expression.

Expression 
getExpr() 
Retrieves the enclosed expression.

List<Expression> 
getExpressions() 
Retrieves the enclosed expressions, which are the components of the
vector.

Truth 
isOne() 
Checks whether this expression is equal to 1 (with respect to the EPSILON
tolerance).

Truth 
isZero() 
Checks whether this expression is equal to 0 (with respect to the EPSILON
tolerance).

Expression 
simplify(Bindings bindings,
SymbolicVisitor visitor) 
Tries to simplify this expression.

String 
toString() 

Set<String> 
variables() 
Retrieves the names of all the variables appearing in this expression.

isOneNumber, isOneNumber, isZeroNumber, isZeroNumber
public Brackets(Expression enclosed)
enclosed
 The enclosed expression.public Brackets(List<Expression> expressions)
expressions
 The enclosed expressions (vector components).public Expression getExpr()
public List<Expression> getExpressions()
public Value eval(Bindings bindings)
Expression
It is important to note that this method will not attempt any kind of simplification on the expression, which means that all the variables appearing in it must be either bound or correspond to Java static fields defined somewhere; if this is not the case an exception will be thrown.
eval
in class Expression
bindings
 Variable bindings.public Expression simplify(Bindings bindings, SymbolicVisitor visitor)
Expression
This method will not throw an exception if some variables appearing in the expression are not bound. However it may still be able to cancel a variable, if an appropriate rule is found.
simplify
in class Expression
bindings
 Variable bindings.visitor
 The visitor implementing the simplification rules.public Truth isZero()
Expression
To decrease the probability that this method will return DONTKNOW, simplify or eval should be preventively called on this expression.
isZero
in class Expression
public Truth isOne()
Expression
To decrease the probability that this method will return DONTKNOW, simplify or eval should be preventively called on this expression.
isOne
in class Expression
public Set<String> variables()
Expression
variables
in class Expression
public Expression copy()
copy
in class Expression
public String format(FormatVisitor visitor)
Expression
format
in class Expression
visitor
 The visitor implementing the formatting rules.public String toString()
toString
in class Expression
Copyright © 2018 STLAB. All rights reserved.