Skip to Content.
Sympa Menu

k-user - Re: [K-user] Problem with lists

k-user AT lists.cs.illinois.edu

Subject: K-user mailing list

List archive

Re: [K-user] Problem with lists


Chronological Thread 
  • From: Cosmin Radoi <cos AT illinois.edu>
  • To: "Rosu, Grigore" <grosu AT illinois.edu>
  • Cc: "k-user AT cs.uiuc.edu" <k-user AT cs.uiuc.edu>
  • Subject: Re: [K-user] Problem with lists
  • Date: Sat, 3 Dec 2011 18:24:16 -0600
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user>
  • List-id: <k-user.cs.uiuc.edu>


Yes, the cell is <cell> .Map </cell>. It should contain a map from ints to lists of ints. We eventually used a wrapper  for the list of ints, so it is now of the form #Int |-> WrappedList(List).

We'll look through the examples more,

Thank you,

Cosmin 

(sorry for the duplicate email; didn't cc k-user the first time)

On Sat, Dec 3, 2011 at 2:58 PM, Rosu, Grigore <grosu AT illinois.edu> wrote:

How did you define <cell> in the configuration?  What is its contents?  For below, I assume it is

<cell> .Map </cell>

 

First, the K maps currently take only bindings of the form K |-> K, so N |-> .List cannot work since .List is the unit of the List sort, which is disjoint from K.

 

Second, you are only allowed to use List{#Int} or List{AnySort} once in a definition, when you alias it.  Something like this:

 

syntax Ints ::= List{#Int,","}

 

Then, if you want to refer to the unit of Ints, you should use .Ints and NOT .List{#Int}, etc.

 

All these are explained in the examples (e.g., IMP, IMPPP, SIMPLE, KOOL, etc.).  Hopefully we will have some tutorial or manual soon.

 

Grigore
 
 

From: k-user-bounces AT cs.uiuc.edu [k-user-bounces AT cs.uiuc.edu] on behalf of Cosmin Radoi [cos AT illinois.edu]
Sent: Saturday, December 03, 2011 1:26 PM
To: k-user AT cs.uiuc.edu
Subject: [K-user] Problem with lists


We're having problems with a very basic scenario. For some reason, the lists are behaving unintuitively.

First:
rule <cell> . => N |-> .List  … </cell> ( N is matched as an #Int, there is other irrelevant stuff)
Raises the warning:
Didn't expect token …</
Replacing .List with .List{#Int} makes it say it doesn't expect token #Int

If we replace that with:
rule <cell> . => N |-> .  … </cell>
it gets past this but breaks a following rule:
rule <cell> … N |-> (. => M … ) … </cell> ( M is matched as an #Int )
with a multiple distinct parses error.

We've played with multiple variations of these rules but they don't seem to work. We are trying to make something seemingly simple, a Map with #Int keys and List{#Int} values.

Thanks,

Cosmin





Archive powered by MHonArc 2.6.16.

Top of Page