k-user AT lists.cs.illinois.edu
Subject: K-user mailing list
List archive
- From: Andrei Arusoaie <andrei.arusoaie AT gmail.com>
- To: Bram Geron <bgeron AT gmail.com>
- Cc: k-user AT cs.uiuc.edu
- Subject: Re: [K-user] Ellipsis in cells of UserDefinedList type
- Date: Mon, 10 Sep 2012 11:25:51 +0300
- List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
- List-id: <k-user.cs.uiuc.edu>
Hi Bram,
The answer is no, you cannot match user-defined lists using ... and you cannot match inside a list. The reason is that in K the user-defined lists are cons-lists.
Why don't you use Set?
Andrei A.
--
Numai bine,
2012/9/10 Bram Geron <bgeron AT gmail.com>
Hi guys,
I'm working with Vlad Rusu as an intern, and we're modeling an assembler language using K.
I stumbled upon the following. We have a configuration with a cell
<decls> .FunctionDeclList </decls>where
syntax FunctionDeclList ::= List{FunctionDecl,""}which is included in a module from another file. Then we have a rule
and the <decls> matcher compiles to the following Maude fragment with _~>_, as if it was in a K cell:rule [linearize-func2]: <decls> ... F:FunctionDecl ... </decls> <nextLabel> L => L +Int 1 </nextLabel> [transition]
< decls > ?C5:K ~> F:KItem ~> ?C6:K </ decls >Instead, I expected it to match with __, like it would when matching a FunctionDeclList. Indeed, if we replace both ellipses by _:FunctionDeclList, we get this Maude fragment:
(infix form for readability)
< decls > ('__).KLabel(??6:KItem,,('__).KLabel(F:KItem,,??7:KItem)) </ decls > (infix form for readability)But the generated PDF looks less pretty o:)
My question: is it possible to match user-defined lists with ..., or is the ellipsis only possible for K cells?
I'm using k-latest.tgz downloaded on 3 September, on Ubuntu 12.04.1.
Cheers, Bram
_______________________________________________
k-user mailing list
k-user AT cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/k-user
Numai bine,
Andrei
- [K-user] Ellipsis in cells of UserDefinedList type, Bram Geron, 09/10/2012
- Re: [K-user] Ellipsis in cells of UserDefinedList type, Dorel Lucanu, 09/10/2012
- Re: [K-user] Ellipsis in cells of UserDefinedList type, Dorel Lucanu, 09/10/2012
- Re: [K-user] Ellipsis in cells of UserDefinedList type, Bram Geron, 09/10/2012
- Re: [K-user] Ellipsis in cells of UserDefinedList type, Dorel Lucanu, 09/10/2012
- Re: [K-user] Ellipsis in cells of UserDefinedList type, Andrei Arusoaie, 09/10/2012
- Re: [K-user] Ellipsis in cells of UserDefinedList type, Dorel Lucanu, 09/10/2012
Archive powered by MHonArc 2.6.16.