| | 97 | * CExpression implements SymbolicExpressionIF |
| | 98 | * AndCExpression extends CExpression |
| | 99 | * clauses: set of OrCExpression |
| | 100 | * OrCExpression extends CExpression |
| | 101 | * clauses: set of SBasicExpression |
| | 102 | * BasicCExpression extends CExpression |
| | 103 | * RelationalCExpression, or |
| | 104 | * PrimitiveCExpression, where PrimitiveCExpression has boolean type, or |
| | 105 | * !PrimitiveCExpression |
| | 106 | * RelationalCExpression extends CExpression |
| | 107 | * e>0, e>=0, e=0, e!=0, where e is a PolynomialCExpression |
| | 108 | * PrimitiveCExpression extends CExpression |
| | 109 | * X, where X is a symbolic constant |
| | 110 | * a[e], a is a CExpression of array type, e a CExpression of integer type |
| | 111 | * r.f, where r is an CExpression of tuple type and f is a nonnegative integer |
| | 112 | * PolynomialCExpression extends CExpression |
| | 113 | * terms: set of MonomialCExpression |
| | 114 | * MonomialCExpression extends CExpression |
| | 115 | * coefficient: Rational |
| | 116 | * factors: set of pairs (PrimitiveCExpression, n), where n is a positive integer |
| | 117 | * RationalCExpression extends CExpression |
| | 118 | * numerator, denominator: PolynomialCExpression |
| 96 | | == SExpression implements SymbolicExpressionIF == |
| 97 | | |
| 98 | | This an implementation of the interface defined above. The idea is to aggressively put every expression into a canonical form. |
| 99 | | |
| 100 | | a canonical-form based implementation of symbolic expression |
| 101 | | |
| 102 | | * SAndExpression extends SExpression |
| 103 | | * clauses: set of SOrExpression |
| 104 | | * SOrExpression extends SExpression |
| 105 | | * clauses: set of SBasicExpression |
| 106 | | * SBasicExpression extends SExpression |
| 107 | | * SRelationalExpression, or |
| 108 | | * SPrimitiveExpression, where SPrimitiveExpression has boolean type, or |
| 109 | | * !SPrimitiveExpression |
| 110 | | * SRelationalExpression extends SExpression |
| 111 | | * e>0, e>=0, e=0, e!=0, where e is an SPolynomialExpression |
| 112 | | * SPrimitiveExpression extends SExpression |
| 113 | | * X, where X is a symbolic constant |
| 114 | | * a[e], a is an SExpression of array type, e an SExpression of integer type |
| 115 | | * r.f, where r is an SExpression of tuple type and f is a nonnegative integer |
| 116 | | * SPolynomialExpression extends SExpression |
| 117 | | * terms: set of SMonomialExpression |
| 118 | | * SMonomialExpression extends SExpression |
| 119 | | * coefficient: Number |
| 120 | | * factors: set of pairs (SPrimitiveExpression, n), where n is a positive integer |
| 121 | | * SRationalExpression extends SExpression |
| 122 | | * numerator, denominator: SPolynomialExpression |
| 123 | | |
| 124 | | Numbers |
| 125 | | |
| 126 | | Infinite-precision rational number. |
| 127 | | |
| 128 | | == SExpressionFactory == |
| 129 | | |
| 130 | | * SExpression symbolicConstant() |
| 131 | | * SAndExpression and(Collection<SOrExpression>) |
| 132 | | * SOrExpression or(Collection<SBasicExpression>) |
| | 122 | * CExpression symbolicConstant(...) |
| | 123 | * AndCExpression and(Collection<OrCExpression>) |
| | 124 | * OrCExpression or(Collection<BasicCExpression>) |