Skip to Content.
Sympa Menu

k-user - Re: [K-user] (no subject)

k-user AT lists.cs.illinois.edu

Subject: K-user mailing list

List archive

Re: [K-user] (no subject)


Chronological Thread 
  • From: Ömer Sinan Ağacan <omeragacan AT gmail.com>
  • To: Dorel Lucanu <dlucanu AT info.uaic.ro>
  • Cc: k-user AT cs.uiuc.edu
  • Subject: Re: [K-user] (no subject)
  • Date: Mon, 19 Aug 2013 00:24:06 +0300
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
  • List-id: <k-user.cs.uiuc.edu>

Dore, many thanks for your answers.. My program now works as expected.

(btw, I realized that I had forgotten writing a subject for my first
email -- sorry about that)

I especially liked the `C:Concat1 ; Cs:Concat => C ~> Cs` trick, this
is very useful.



Since we don't yet have a reference manual to look up data structure
manipulation syntax, I want to ask another question about data
structure operations.

I want to have a rule like this: (I want this only for learning
purposes, this rule may not be very meaningful and/or useful)

rule <k> I:Int => . ... </k>
<someMap> ... _ |-> (N => N +Int I) ... </someMap>

What I'm trying to say here is that when encountered with an int, I
want to increment each element in my map configuration by that int,
ie. if I have 10 in my program and my someMap state is like:

<someMap>
identifier1 |-> 10
identifier2 |-> 20
</someMap>

I want to update this to:

<someMap>
identifier1 |-> 20
identifier2 |-> 30
</someMap>

But currently this rule only updates first element in map(namely,
indetifier1 in this example). Why is that? And how can I do what I
want to do here?

---
Ömer Sinan Ağacan
http://osa1.net





Archive powered by MHonArc 2.6.16.

Top of Page