Skip to Content.
Sympa Menu

k-user - Re: [K-user] Unsupported sort of fresh variable

k-user AT lists.cs.illinois.edu

Subject: K-user mailing list

List archive

Re: [K-user] Unsupported sort of fresh variable


Chronological Thread 
  • From: Andrei Stefanescu <andreistef AT gmail.com>
  • To: Omar Duhaiby <3omarz 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 11:40:41 -0600
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
  • List-id: <k-user.cs.uiuc.edu>

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,

Andrei


On Sat, Nov 15, 2014 at 11:56 AM, Omar Duhaiby <3omarz AT gmail.com> wrote:
Hello,

I'm doing this:
rule E:Exp (0) => E -> !NewVar:LowerCaseId        [macro]

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





Archive powered by MHonArc 2.6.16.

Top of Page