gaoyuanning / aic-expresso

Automatically exported from code.google.com/p/aic-expresso
0 stars 0 forks source link

Make R_cardExtensionalSet generate a normalized conditional expression #11

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
*. R_cardExtensionalSet generates a normalized conditional expression:
You know are working with variables and constants only and therefore
that the answer is bounded to [number constants, number constants + number 
variables].

    no need to condition on equalities between constants.
    see if can normalize in a way that minimizes calls to R_simplify
    (note: still need to take contextual constraints into consideration and
    to check if variables equal each other or constants).
    want to try and determine if a shallow normalized conditional structures (i.e.
    conjunctions in the conditions) or deep conditional structures work better (i.e.
    test of each equality per condition).

Original issue reported on code.google.com by ctjoreilly@gmail.com on 11 Apr 2013 at 12:25

GoogleCodeExporter commented 8 years ago
 Rodrigo Braz added a comment - 17/Jul/12 11:27 AM

I got the following test to work:

// TODO: - taking too long to process, see ALBP-188 
new CardinalityExtensionalSetData(false,
"| {X, Y, X, Z, W, V, U, b, a, c, d, f} |",
new CountsDeclaration(10),
"if X = Y or X = Z or X = W or X = V or X = U or X = b or X = a or X = c or X = 
d or X = f then if Y = Z or Y = W or Y = V or Y = U or Y = b or Y = a or Y = c 
or Y = d or Y = f then if Z = W or Z = V or Z = U or Z = b or Z = a or Z = c or 
Z = d or Z = f then if W = V or W = U or W = b or W = a or W = c or W = d or W 
= f then if V = U or V = b or V = a or V = c or V = d or V = f then if U = b or 
U = a or U = c or U = d or U = f then 5 else 6 else if U = b or U = a or U = c 
or U = d or U = f then 6 else 7 else if V = U or V = b or V = a or V = c or V = 
d or V = f then if U = b or U = a or U = c or U = d or U = f then 6 else 7 else 
if U = b or U = a or U = c or U = d or U = f then 7 else 8 else if W = V or W = 
U or W = b or W = a or W = c or W = d or W = f then if V = U or V = b or V = a 
or V = c or V = d or V = f then if U = b or U = a or U = c or U = d or U = f 
then 6 else 7 else if U = b or U = a or U = c or U = d or U = f then 7 else 8 
else if V = U or V = b or V = a or V = c or V = d or V = f then if U = b or U = 
a or U = c or U = d or U = f then 7 else 8 else if U = b or U = a or U = c or U 
= d or U = f then 8 else 9 else if Z = W or Z = V or Z = U or Z = b or Z = a or 
Z = c or Z = d or Z = f then if W = V or W = U or W = b or W = a or W = c or W 
= d or W = f then if V = U or V = b or V = a or V = c or V = d or V = f then if 
U = b or U = a or U = c or U = d or U = f then 6 else 7 else if U = b or U = a 
or U = c or U = d or U = f then 7 else 8 else if V = U or V = b or V = a or V = 
c or V = d or V = f then if U = b or U = a or U = c or U = d or U = f then 7 
else 8 else if U = b or U = a or U = c or U = d or U = f then 8 else 9 else if 
W = V or W = U or W = b or W = a or W = c or W = d or W = f then if V = U or V 
= b or V = a or V = c or V = d or V = f then if U = b or U = a or U = c or U = 
d or U = f then 7 else 8 else if U = b or U = a or U = c or U = d or U = f then 
8 else 9 else if V = U or V = b or V = a or V = c or V = d or V = f then if U = 
b or U = a or U = c or U = d or U = f then 8 else 9 else if U = b or U = a or U 
= c or U = d or U = f then 9 else 10 else if Y = Z or Y = W or Y = V or Y = U 
or Y = b or Y = a or Y = c or Y = d or Y = f then if Z = W or Z = V or Z = U or 
Z = b or Z = a or Z = c or Z = d or Z = f then if W = V or W = U or W = b or W 
= a or W = c or W = d or W = f then if V = U or V = b or V = a or V = c or V = 
d or V = f then if U = b or U = a or U = c or U = d or U = f then 6 else 7 else 
if U = b or U = a or U = c or U = d or U = f then 7 else 8 else if V = U or V = 
b or V = a or V = c or V = d or V = f then if U = b or U = a or U = c or U = d 
or U = f then 7 else 8 else if U = b or U = a or U = c or U = d or U = f then 8 
else 9 else if W = V or W = U or W = b or W = a or W = c or W = d or W = f then 
if V = U or V = b or V = a or V = c or V = d or V = f then if U = b or U = a or 
U = c or U = d or U = f then 7 else 8 else if U = b or U = a or U = c or U = d 
or U = f then 8 else 9 else if V = U or V = b or V = a or V = c or V = d or V = 
f then if U = b or U = a or U = c or U = d or U = f then 8 else 9 else if U = b 
or U = a or U = c or U = d or U = f then 9 else 10 else if Z = W or Z = V or Z 
= U or Z = b or Z = a or Z = c or Z = d or Z = f then if W = V or W = U or W = 
b or W = a or W = c or W = d or W = f then if V = U or V = b or V = a or V = c 
or V = d or V = f then if U = b or U = a or U = c or U = d or U = f then 7 else 
8 else if U = b or U = a or U = c or U = d or U = f then 8 else 9 else if V = U 
or V = b or V = a or V = c or V = d or V = f then if U = b or U = a or U = c or 
U = d or U = f then 8 else 9 else if U = b or U = a or U = c or U = d or U = f 
then 9 else 10 else if W = V or W = U or W = b or W = a or W = c or W = d or W 
= f then if V = U or V = b or V = a or V = c or V = d or V = f then if U = b or 
U = a or U = c or U = d or U = f then 8 else 9 else if U = b or U = a or U = c 
or U = d or U = f then 9 else 10 else if V = U or V = b or V = a or V = c or V 
= d or V = f then if U = b or U = a or U = c or U = d or U = f then 9 else 10 
else if U = b or U = a or U = c or U = d or U = f then 10 else 11"),

by removing the simplification of the final result. However, investigating the 
issues pointed out in the description still makes sense.

Original comment by ctjoreilly@gmail.com on 11 Apr 2013 at 12:25