Skip to Content.
Sympa Menu

k-user - Re: [K-user] K reference manual

k-user AT lists.cs.illinois.edu

Subject: K-user mailing list

List archive

Re: [K-user] K reference manual


Chronological Thread 
  • From: Omar Duhaiby <3omarz AT gmail.com>
  • To: Philip Daian <phil AT linux.com>
  • Cc: k-user AT cs.uiuc.edu
  • Subject: Re: [K-user] K reference manual
  • Date: Tue, 25 Mar 2014 06:21:07 +0300
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
  • List-id: <k-user.cs.uiuc.edu>

Thanks Philip. Here is what I did. I used the comma operator to try to concatenate two Lists. However, K gave an error that it expected the sort MyMap. I thought MyMap is somehow overriding List because they both use the comma operator. So I changed the comma in the builtins files (list.k and io.k) to a unique operator that I made up: "+List". Now the error I get is that my variables are of sort List but are expected to be of sort MyList.
I don't understand the relation between List and MyList.


On Tue, Mar 25, 2014 at 2:10 AM, Philip Daian <phil AT linux.com> wrote:
Hello Omar,

There is a manual being worked on right now, but as the framework is still in an early stage and even the core is still constantly changing, there is nothing complete currently out.  Right now the best resources are the K Tutorials, related exercises, publications on the KFramework site, and the source code of the related builtins.  Once learning the basics of K definitions, you can check something like https://github.com/kframework/k/blob/master/include/builtins/list.k for what you need.  It looks like the comma operation does what you seek. 

  /*@ Construct a List using two Lists. This is similar to the "Cons" operation
   in many functional programming languages.*/
  syntax MyList ::= MyList "," MyList [left, function, hook(List:__), klabel('_List_)]

I hope that helps. The K developers definitely do recognize the need for better documentation for widespread user adoption, and it is something that should be nailed down as the framework matures.  It's also worth noting that I am not a K core developer, so anything I said may be wrong and corrected in the future :).

- Philip Daian


On Mon, Mar 24, 2014 at 6:56 AM, Omar Duhaiby <3omarz AT gmail.com> wrote:
Hello,

Is there a K reference manual that I'm not aware of? I couldn't find anything in the wiki.
Currently I'm looking for a built-in function to concatenate Lists.

Thank you

_______________________________________________
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