Skip to Content.
Sympa Menu

k-user - Re: [K-user] "Don't-Care" unifiers in K

k-user AT lists.cs.illinois.edu

Subject: K-user mailing list

List archive

Re: [K-user] "Don't-Care" unifiers in K


Chronological Thread 
  • From: Traian Florin Șerbănuță <traian.serbanuta AT info.uaic.ro>
  • To: Joseph Osborn <joe.osborn AT me.com>
  • Cc: "k-user AT cs.uiuc.edu" <k-user AT cs.uiuc.edu>
  • Subject: Re: [K-user] "Don't-Care" unifiers in K
  • Date: Mon, 18 Feb 2013 19:12:23 +0200
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
  • List-id: <k-user.cs.uiuc.edu>

Thanks Joseph!

I've integrated your patch.
Hopefully, we'll get to solve soon your other issue.

best wishes,
- traian


2013/2/9 Joseph Osborn <joe.osborn AT me.com>
A common feature of languages with pattern-matching (even K!) is the "don't-care" variable "_", which matches anything, each instance of which is fresh. It doesn't seem like the UNIFICATION module supports these wildcards, so here's a little patch that puts them in (in a somewhat ad hoc way explicitly for unification, rather than by doing that formal replacement of terms by fresh terms, because it seemed simpler).

Languages which want it should have a line like the following, though of course "_" is only an example:

> syntax SomethingThatGetsUnified ::= "_" [onlyLabel, klabel($dontcare)]


There's probably a more K-like way to do that attribute ([dontcare] or [wildcard] or something?), but that's all I know how to do right now. All the LOGIK examples I tried (and those of my own language) seem to still work, but I have not tested exhaustively.

Diff's attached, I hope it doesn't get scrubbed by the listserv!


_______________________________________________
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