aic-sri-international / aic-expresso

SRI International's AIC Symbolic Manipulation and Evaluation Library (for Java 1.8+)
BSD 3-Clause "New" or "Revised" License
8 stars 0 forks source link

Cardinality computation, context variables do not appear to be shadowed by scoping variables on cardinality expression #36

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
>     I am after fixing Issue 28. However, when testing the Rewriting
>     System Demo App I observed behavior which I believe to be
>     incorrect. The issue can be observed if you run the 2nd
>     Carindality example you get:
>
>     | {(on X) tuple(X) | X != a } |
>     ->
>     9
>
>     However, if I change the Context from 'true' to 'X = a',
>     '0' is returned instead as the answer - does this seem correct to
>     you? Should the context's 'X' variable not have been shadowed by the
>     intensional sets 'X' or a standardize apart in
>     the cardinality logic have occurred?

Yes, this is definitely a problem. I can look into it

NOTE: This behavior existed before the new variables with domain information 
logic was added.

Original issue reported on code.google.com by ctjoreilly@gmail.com on 21 Jan 2014 at 12:24

GoogleCodeExporter commented 9 years ago
Fixed. This involved fixing two distinct bugs:

- contextual variables must be renamed (shadowed) upon encountering a local 
variable of same name
- top level procedures such as AbstractGrinderTest and rewriter system demo 
were extending the context twice, once for the input context, and another for 
the main expression. However, this is incorrect if the same free variable X 
appears in both, because the second context extension will shadow X with itself 
even though it is the same variable (it's a free variable at the top level). 
Now there is a single context extension using a tuple of input and input 
context.

Original comment by rodrigob...@gmail.com on 5 Feb 2014 at 5:52

GoogleCodeExporter commented 9 years ago
Rodrigo, does the fix for 'top level procedures such as AbstractGrinderTest and 
rewriter system demo were extending the context twice' also not need to be 
applied to the corresponding logic in aic-praise?

Original comment by ctjoreilly@gmail.com on 5 Feb 2014 at 9:27

GoogleCodeExporter commented 9 years ago
Yes... I realized that after committing. I will take care of it today. Thanks.

Original comment by rodrigob...@gmail.com on 5 Feb 2014 at 9:30

GoogleCodeExporter commented 9 years ago
That is done as well now.

Original comment by rodrigob...@gmail.com on 7 Feb 2014 at 12:40