kiselev / aic-praise

Automatically exported from code.google.com/p/aic-praise

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make more efficient logic in R_intersection to support extensional sets

GoogleCodeExporter opened this issue · comments

Currently the implementation just does the following:

R_set_diff(S1 \ R_set_diff(S1 \ S21))

a more efficient implementation should be developed. However need to take into 
account the following discussion (R_union will need to be updated as well):

I am thinking about how R_union would have to be extended.

Thanks,

Rodrigo

On 3/25/2013 1:47 PM, Rodrigo de Salvo Braz wrote:
> On 3/25/2013 1:41 PM, Ciaran O'Reilly wrote:
>> Hi Rodrigo,
>>
>> It would except that the routine needs to return an extensional set not a 
union as that is what is expected as a return. R_union won't solve the problem 
either as it only removes empty sets. Thoughts?
>
> Sorry, I meant to say R_union around that.
>
> It seems to me R_union should be able to take care of this. Can we extend it?
>
> BTW, why does "flattened" mean in the documentation of R_union? I completely 
forgot about that?
>
> Thanks,
>
> Rodrigo
>
>>
>> Thanks
>>
>> Ciaran
>>
>> On 3/25/2013 9:36 AM, Rodrigo de Salvo Braz wrote:
>>> On 3/25/2013 1:33 PM, Ciaran O'Reilly wrote:
>>>> Hi Rodrigo,
>>>>
>>>> A possible problem with what you've outlined is that
>>>> 'intersectionFromA2On' could be conditional making it difficult to do
>>>> the following:
>>>>
>>>> 'then {a1, elements of intersectionFromA2On}'
>>>
>>> I see. How about {a1} union intersectionFromA2On
>>>
>>> ? Should be as efficient and do the trick.
>>>
>>> Thanks,
>>>
>>> Rodrigo
>>>
>>>>
>>>> that is what lead me to introducing S3, thoughts?
>>>>
>>>> Thanks
>>>>
>>>> Ciaran
>>>>
>>>>
>>>>
>>>> On 3/25/2013 9:24 AM, Rodrigo de Salvo Braz wrote:
>>>>> On 3/25/2013 1:14 PM, Ciaran O'Reilly wrote:
>>>>>> Hi Rodrigo,
>>>>>>
>>>>>> Also, are you ok with this:
>>>>>>
>>>>>> https://code.google.com/p/aic-praise/wiki/RewriterIntersection
>>>>>>
>>>>>> if so I'll get that tidied up and out of the way first.
>>>>>
>>>>> I was about to write about it.
>>>>>
>>>>> A few comments:
>>>>>
>>>>> The way it is, R_intersection({a2,...,an} intersection {b1,...,bm} would
>>>>> be called twice, but we can run it once and re-use, as in extensional
>>>>> sets normalization.
>>>>>
>>>>> The first line of the page indicating arguments is missing S3. But... I
>>>>> am not really convinced we need it. We can keep the more straightforward
>>>>> interface S1 intersection S2 if the pseudo-code is as follows:
>>>>>
>>>>> | Externalizes conditionals
>>>>> | Cases:
>>>>> | Set1 is {{ (on I1) Alpha1 | C1 }} and Set2 is {{ (on I2) Alpha2 |
>>>>> C2 }}
>>>>> |.... standardize Set1 apart from (I2, Alpha2, C2)
>>>>> |.... C <- R_complete_simplify(Alpha1 = Alpha2 and C1 and C2)
>>>>> |.... if C is "false"
>>>>> |........ return {}
>>>>> |.... I <- concatenation of I1 and I2
>>>>> |.... return {{ (on I) Alpha1 | C }}
>>>>> | Set1 is {a1,...,an} and Set2 is {b1,...,bm}
>>>>> |.... if Set1 is empty // only need to check S1 emptiness
>>>>> |........ return Set2
>>>>> |.... else
>>>>> |........ C <- R_complete_simplify(a1 = b1 or ... or a1 = bm)
>>>>> |........ intersectionFromA2On <- R_intersection({a2,...,an}
>>>>> intersection {b1,...,bm} // compute this only once
>>>>> |........ return R_basic(if C
>>>>> |.................................. then {a1, elements of
>>>>> intersectionFromA2On}      // doing it like this does away with S3
>>>>> |.................................. else intersectionFromA2On
>>>>> | else
>>>>> |.... "Not currently supported"
>>>>>
>>>>> Does this make sense?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Rodrigo
>>>>
>>




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