Skip to Content.
Sympa Menu

k-user - [K-user] Turning identifiers into matchable strings

k-user AT lists.cs.illinois.edu

Subject: K-user mailing list

List archive

[K-user] Turning identifiers into matchable strings


Chronological Thread 
  • From: Corbin Simpson <mostawesomedude AT gmail.com>
  • To: k-user AT cs.uiuc.edu
  • Subject: [K-user] Turning identifiers into matchable strings
  • Date: Sun, 26 Jan 2014 00:27:44 -0800
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
  • List-id: <k-user.cs.uiuc.edu>

Hi all,

I'm working on formalizing Kernel-E, a subset of the E language, since it has never had a formal semantics and I'm hoping to pin down exactly what a fast implementation of E would need to pay attention to. In the process, I'm discovering lots of fun things...

Everything's an object in E and objects interact with message passing; i.e. `obj.doThings(with, other, objects)`. I need to specialize some messages, like `mul`, to implement the concrete semantics for types like integers, which are core to the syntax and semantics.

However, I can't quite figure out how to match on the Id sort in rules. I've currently tried these two variants with no success:

rule E:Int . "mul" ( (X:Int) ) => E *Int X
rule E:Int . mul ( (X:Int) ) => E *Int X

Where the syntax generating the original pattern is:

syntax Exprs ::= List{Expr, ","}
syntax Expr ::= Expr "." Id "(" Exprs ")" [seqstrict]

I've been through many of the tutorial videos but haven't seen a language where specialization is handled this way. Do I have to specialize every one of these special messages in the syntax?

Thanks,
~ C.

--
When the facts change, I change my mind. What do you do, sir? ~ Keynes

Corbin Simpson
<MostAwesomeDude AT gmail.com>



Archive powered by MHonArc 2.6.16.

Top of Page