k-user AT lists.siebelschool.illinois.edu
Subject: K-user mailing list
List archive
- From: Traian Florin Șerbănuță <tserban2 AT illinois.edu>
- To: "Seyed H. HAERI (Hossein)" <hossein.haeri AT gmail.com>
- Cc: "k-user AT cs.uiuc.edu" <k-user AT cs.uiuc.edu>
- Subject: Re: [K-user] How to Remove a Key from a Map
- Date: Thu, 23 Feb 2012 19:14:13 -0600
- Authentication-results: mr.google.com; spf=pass (google.com: domain of traian.serbanuta AT gmail.com designates 10.52.240.177 as permitted sender) smtp.mail=traian.serbanuta AT gmail.com; dkim=pass header.i=traian.serbanuta AT gmail.com
- List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user>
- List-id: <k-user.cs.uiuc.edu>
Hi Hossein,
2012/2/23 Seyed H. HAERI (Hossein) <hossein.haeri AT gmail.com>
Hi Traian,
> There are two ways.
Cool! Both work. :)
> One suggestion would be to check the k-prelude.maude from $K_BASE/core/maude/lib directory for the syntax and definitions of the basic Set/Map constructs. This would require
> some familiarity with Maude, though.Had a look and it's well beyond me at the moment. I wonder how you do
value lookup for an existing key now?
As you might have guessed from the previous answer, there are two ways, again :-)
The first, is using direct matching. For example the rule:
rule <k> X => V ...</k> <state>... X |-> V ...</state>
matches X on top of the <k> cell and replaces it with the value V which X is mapped to in the state.
Alternatively, you can use the built-in map retrieval function for that, like this:
rule <k> X => Map(X) ...</k> <state> Map </state>
hope this helps.
best wishes,
- traian
TIA,
--Hossein
--------------------------------------------------------------------------------------------------------------
Seyed H. HAERI (Hossein)
Research Assistant
Institute for Software Systems (STS)
Technical University of Hamburg (TUHH)
Hamburg, Germany
ACCU - Professionalism in programming - http://www.accu.org/
--------------------------------------------------------------------------------------------------------------
_______________________________________________
k-user mailing list
k-user AT cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/k-user
- [K-user] How to Remove a Key from a Map, Seyed H. HAERI (Hossein), 02/23/2012
- <Possible follow-up(s)>
- Re: [K-user] How to Remove a Key from a Map, Traian Florin Șerbănuță, 02/23/2012
- Re: [K-user] How to Remove a Key from a Map, Seyed H. HAERI (Hossein), 02/23/2012
- Message not available
- Re: [K-user] How to Remove a Key from a Map, Traian Florin Șerbănuță, 02/23/2012
- Re: [K-user] How to Remove a Key from a Map, Seyed H. HAERI (Hossein), 02/24/2012
- Re: [K-user] How to Remove a Key from a Map, Traian Florin Șerbănuță, 02/23/2012
Archive powered by MHonArc 2.6.16.