Skip to Content.
Sympa Menu

k-user - Re: [K-user] new user: assignment by reference (as in PHP) and available operations on "Maps"

k-user AT lists.cs.illinois.edu

Subject: K-user mailing list

List archive

Re: [K-user] new user: assignment by reference (as in PHP) and available operations on "Maps"


Chronological Thread 
  • From: "Rosu, Grigore" <grosu AT illinois.edu>
  • To: Stefan Ciobaca <stefan.ciobaca AT gmail.com>, Daniele Filaretti <dfilaretti AT gmail.com>
  • Cc: "k-user AT cs.uiuc.edu" <k-user AT cs.uiuc.edu>
  • Subject: Re: [K-user] new user: assignment by reference (as in PHP) and available operations on "Maps"
  • Date: Mon, 23 Jul 2012 12:58:01 +0000
  • Accept-language: en-US
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user>
  • List-id: <k-user.cs.uiuc.edu>

Or even nicer (in the K sense):

>> rule [ass_ref_1]:
>> <k> X := & Y:Id => . ...</k>
>> <env>... Y |-> N (. => X |-> N) ...</env>

If the current K parser gives you headaches, you may try to write .Map
instead of .

Welcome to K, Daniele,
Grigore



________________________________________
From:
k-user-bounces AT cs.uiuc.edu

[k-user-bounces AT cs.uiuc.edu]
on behalf of Stefan Ciobaca
[stefan.ciobaca AT gmail.com]
Sent: Monday, July 23, 2012 7:54 AM
To: Daniele Filaretti
Cc:
k-user AT cs.uiuc.edu
Subject: Re: [K-user] new user: assignment by reference (as in PHP) and
available operations on "Maps"

Hello Daniele,

Welcome to K. I'll try to answer your question directly:

>> rule [ass_ref_1]:
>> <k> X := & Y:Id => . ... </k>
>> <env> ... Y |-> N => X |-> N ... </env>

Did you try to do the following?

>> rule [ass_ref_1]:
>> <k> X := & Y:Id => . ... </k>
>> <env> ... Y |-> N => (Y |-> N X |-> N) ... </env>

This replaces Y |- N by both X |- N and Y |- N, so it keeps Y bound. I
hope it solves your problem. Let us know if it works for you.

Cheers,
Stefan
_______________________________________________
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