k-user AT lists.cs.illinois.edu
Subject: K-user mailing list
List archive
- From: Omar Duhaiby <3omarz AT gmail.com>
- To: Andrei Stefanescu <andreistef AT gmail.com>
- Cc: "k-user AT cs.uiuc.edu" <k-user AT cs.uiuc.edu>, "Musab A. AlTurki" <musab AT kfupm.edu.sa>
- Subject: Re: [K-user] Unsupported sort of fresh variable
- Date: Mon, 17 Nov 2014 23:37:28 +0300
- List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
- List-id: <k-user.cs.uiuc.edu>
OK, I can make my own, but when I call it, I have to provide an Int. And using String2Id will always return a type Id. The compiler complains about that. The only way to do it that I can see is to keep a global Int that increments with each run of the rule.
On Mon, Nov 17, 2014 at 8:40 PM, Andrei Stefanescu <andreistef AT gmail.com> wrote:
Hi Omar,The !X notation is syntactic sugar for a function that generates a "fresh" element given an integer argument. This is the function for Id (from builtins/id.k):syntax Id ::= freshId(Int) [freshGenerator, function]rule freshId(I:Int) => String2Id("_" +String Int2String(I))You can add you own for LowerCaseId in a similar way.Let me know if I can help you further,AndreiOn Sat, Nov 15, 2014 at 11:56 AM, Omar Duhaiby <3omarz AT gmail.com> wrote:_______________________________________________rule E:Exp (0) => E -> !NewVar:LowerCaseId [macro]Hello,I'm doing this:
However, the compiler says "Only sorts [Id, Int] admit fresh variables". But I don't want to use Id because it can start with an upper case. My LowerCaseId starts only with a lower case. What should I do?
k-user mailing list
k-user AT cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/k-user
- [K-user] Unsupported sort of fresh variable, Omar Duhaiby, 11/15/2014
- Re: [K-user] Unsupported sort of fresh variable, Andrei Stefanescu, 11/17/2014
- Re: [K-user] Unsupported sort of fresh variable, Omar Duhaiby, 11/17/2014
- Re: [K-user] Unsupported sort of fresh variable, Andrei Stefanescu, 11/17/2014
- Re: [K-user] Unsupported sort of fresh variable, Omar Duhaiby, 11/18/2014
- Re: [K-user] Unsupported sort of fresh variable, Andrei Stefanescu, 11/17/2014
- Re: [K-user] Unsupported sort of fresh variable, Omar Duhaiby, 11/17/2014
- Re: [K-user] Unsupported sort of fresh variable, Andrei Stefanescu, 11/17/2014
Archive powered by MHonArc 2.6.16.