Skip to Content.
Sympa Menu

k-user - [[K-user] ] Match “_” in K

k-user AT lists.cs.illinois.edu

Subject: K-user mailing list

List archive

[[K-user] ] Match “_” in K


Chronological Thread 
  • From: wang_feng_bro AT 163.com
  • To: k-user AT lists.cs.illinois.edu
  • Subject: [[K-user] ] Match “_” in K
  • Date: Sat, 28 Jul 2018 23:47:10 +0800
  • Authentication-results: illinois.edu; spf=none smtp.mailfrom=wang_feng_bro AT 163.com; dkim=pass header.d=163.com header.s=s110527; dmarc=none

Hi all,

I am working on Rust now. In Rust, we have “_” ( like default in C++ ) in match. For instance, 

let x = 1;
match x {
   1 => println!(“one”),
   2 => println!(“two”),
   _ => (),
}

In my implementation, "_ "will be recognized as type of Id in K I think and K will try to evaluate it. However,I already defined a rule:

 rule <k> X:Id => V ...</k> 
        <env>... X |-> L ...</env> 
        <store>... L |-> V ...</store> 

So, “_” can not be evaluated. I tried to defined “_” as a special token, but it didn’t work because many rules use “_”. Anyway, there are always conflicts. 

Any ideas ?

Jerry




Archive powered by MHonArc 2.6.19.

Top of Page