Skip to Content.
Sympa Menu

k-user - Re: [K-user] How to Remove a Key from a Map

k-user AT lists.cs.illinois.edu

Subject: K-user mailing list

List archive

Re: [K-user] How to Remove a Key from a Map


Chronological Thread 
  • From: "Seyed H. HAERI (Hossein)" <hossein.haeri AT gmail.com>
  • To: k-user AT cs.uiuc.edu
  • Subject: Re: [K-user] How to Remove a Key from a Map
  • Date: Fri, 24 Feb 2012 09:11:22 +0100
  • Authentication-results: mr.google.com; spf=pass (google.com: domain of hossein.haeri AT gmail.com designates 10.236.200.165 as permitted sender) smtp.mail=hossein.haeri AT gmail.com; dkim=pass header.i=hossein.haeri AT gmail.com
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user>
  • List-id: <k-user.cs.uiuc.edu>

Yup. I was looking for the latter. Thanks. :)

2012/2/24 Traian Florin Șerbănuță
<tserban2 AT illinois.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
>
>



--
--------------------------------------------------------------------------------------------------------------

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/
--------------------------------------------------------------------------------------------------------------





Archive powered by MHonArc 2.6.16.

Top of Page