k-user AT lists.cs.illinois.edu
Subject: K-user mailing list
List archive
- From: "Rosu, Grigore" <grosu AT illinois.edu>
- To: Abdul Dakkak <abduld AT wolfram.com>
- Cc: k-user <k-user AT cs.uiuc.edu>
- Subject: Re: [K-user] implementing swap in K
- Date: Fri, 14 Dec 2012 17:11:59 +0000
- Accept-language: en-US
- List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
- List-id: <k-user.cs.uiuc.edu>
Yes, I forgot to mention that. This is AC matching at work :)
Grigore
________________________________________
From: Abdul Dakkak
[abduld AT wolfram.com]
Sent: Friday, December 14, 2012 11:06 AM
To: Rosu, Grigore
Cc: k-user
Subject: Re: [K-user] implementing swap in K
Is it because Maps are unordered that you can do <store>... pattern1 pattern2
...</store> ?
-adk-
----- Original Message -----
> From: "Grigore Rosu"
> <grosu AT illinois.edu>
> To: "Abdul Dakkak"
> <abduld AT wolfram.com>,
> "k-user"
> <k-user AT cs.uiuc.edu>
> Sent: Friday, December 14, 2012 10:53:49 AM
> Subject: RE: [K-user] implementing swap in K
>
> This is simpler and should work:
>
> rule swapLocations(L,L) => .
> rule <k> swapLocations(L1, L2) => . ...</k> <store>... L1 |-> (V1 =>
> V2) L2 |-> (V2 => V1) ....</store>
>
> Grigore
>
>
>
> ________________________________________
> From:
> k-user-bounces AT cs.uiuc.edu
>
> [k-user-bounces AT cs.uiuc.edu]
> on
> behalf of Abdul Dakkak
> [abduld AT wolfram.com]
> Sent: Friday, December 14, 2012 10:51 AM
> To: k-user
> Subject: [K-user] implementing swap in K
>
> how does one go about implementing swap
>
>
> rule <k> swapLocations(L1, L2) => . ...</k>
> <store>... L1 |-> (V1 => V2) ... L2 |-> (V2 => V1)
> ....</store>
> when L1 <Int L2
>
> rule <k> swapLocations(L1, L2) => . ...</k>
> <store>... L2 |-> (V2 => V1) ... L1 |-> (V1 => V2)
> ....</store>
> when L1 >Int L2
>
> rule swapLocations(L1, L2) => .
> when L1 ==Int L2
>
> the above does not work because K cannot do more than 2 tears. Is
> there a way around that?
>
> thanks
>
> -adk-
> _______________________________________________
> k-user mailing list
> k-user AT cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/k-user
- [K-user] implementing swap in K, Abdul Dakkak, 12/14/2012
- Re: [K-user] implementing swap in K, Rosu, Grigore, 12/14/2012
- Re: [K-user] implementing swap in K, Abdul Dakkak, 12/14/2012
- Re: [K-user] implementing swap in K, Rosu, Grigore, 12/14/2012
- Re: [K-user] implementing swap in K, Abdul Dakkak, 12/14/2012
- Re: [K-user] implementing swap in K, Rosu, Grigore, 12/14/2012
Archive powered by MHonArc 2.6.16.