k-user AT lists.cs.illinois.edu
Subject: K-user mailing list
List archive
- From: Traian Florin Şerbănuţă <traian.serbanuta AT unibuc.ro>
- To: Derek Sorensen <derek AT pyrofex.net>
- Cc: "Chen, Xiaohong" <xc3 AT illinois.edu>, "k-user AT lists.cs.illinois.edu" <k-user AT lists.cs.illinois.edu>
- Subject: Re: [[K-user] ] Quoting in K
- Date: Fri, 22 Jun 2018 09:51:25 +0300
- Authentication-results: illinois.edu; spf=pass smtp.mailfrom=traian.serbanuta AT unibuc.ro; dkim=pass header.d=unibuc-ro.20150623.gappssmtp.com header.s=20150623; dmarc=none
Hi Derek,
best wishes,
Traian
On Thu, Jun 21, 2018 at 12:04 AM Derek Sorensen <derek AT pyrofex.net> wrote:
Alternatively, is there a way to check if two variables are the same in K?
> On Jun 20, 2018, at 2:52 PM, Derek Sorensen <derek AT pyrofex.net> wrote:
>
> Hey Xiaohong,
>
> With regards to this, what would I write for the semantics of toString( X ) where X:Id?
>
> Best,
> Derek
>
>> On May 29, 2018, at 9:07 AM, Derek Sorensen <derek AT pyrofex.net> wrote:
>>
>> This does help very much, thank you.
>>
>>> On May 24, 2018, at 7:27 PM, Chen, Xiaohong <xc3 AT illinois.edu> wrote:
>>>
>>> Hi Derek,
>>>
>>> One possible solution would be to define a symbol
>>>
>>> syntax String ::= toString(K)
>>>
>>> and define for each language construct their string representation,
>>> which should be straightforward. For example,
>>>
>>> rule toString(if B then S1 else S2)
>>> => "if" +String "(" +String toString(B) +String ")" +String toString(S1) +String toString(S2)
>>>
>>> Maybe K has a toString() function built in. You might want to examine
>>> the k-distribution/include/builtin/domains.k to see if there's anything
>>> related.
>>>
>>> Hope it helps.
>>> Xiaohong
>>>
>>> -------------------------
>>> Chen, Xiaohong
>>> BSc, Peking University
>>> PhD student, UIUC
>>>
>>> ________________________________________
>>> From: Derek Sorensen [derek AT pyrofex.net]
>>> Sent: Thursday, May 24, 2018 5:28 PM
>>> To: k-user AT lists.cs.illinois.edu
>>> Subject: [[K-user] ] Quoting in K
>>>
>>> Hi all,
>>>
>>> I would like to quote something in a rewrite rule—in particular, I would like to take two statements S1 and S2 and see if they are equal as strings. Is there a way to do this? I would like to define some sort of rule where S1 => “S1” in the sense that it’s the string corresponding to the statement S1, but no the literal string “S1”.
>>>
>>> Any help would be greatly appreciated.
>>>
>>> Best,
>>> Derek Sorensen
>>
>
- Re: [[K-user] ] Quoting in K, Derek Sorensen, 06/20/2018
- Re: [[K-user] ] Quoting in K, Derek Sorensen, 06/20/2018
- Re: [[K-user] ] Quoting in K, Traian Florin Şerbănuţă, 06/22/2018
- Re: [[K-user] ] Quoting in K, Derek Sorensen, 06/20/2018
Archive powered by MHonArc 2.6.19.