jerryj
2017-2-9 18:34:11

Can someone help guide my intuition on this aspect of reduction relations? I’m trying to implement the CEK machine as given in chapter 6.4 of SEwPR. I don’t know how to handle the “if V [not in] X” line. I think I could use a (side-condition ???) but I don’t know how to form it. Also, It seems strange to need to do additional “type checking” on terms in the LHS.


jerryj
2017-2-9 18:38:03

I’m trying to decide whether to change the abstract syntax to make that particular relation distinct, or use a side-condition. If i were to change the syntax, then I guess I would separate V={b X (λX.M)} into two, one with variables and one without. Like V={b (λX.M)} and V+ = {V X}


jerryj
2017-2-9 18:38:45

(I’m also thinking about what forms are easiest to translate into Java)


thinkmoore
2017-2-9 18:41:53

can you replace “V” in your reduction rules LHS with “X”?


thinkmoore
2017-2-9 18:42:38

(foo V) -> (bar) if V not in X <=> (foo X) -> (bar)


thinkmoore
2017-2-9 18:42:42

?


thinkmoore
2017-2-9 18:42:58

(just guessing, don’t have SEwPR on hand)


thinkmoore
2017-2-9 18:43:10

oh


thinkmoore
2017-2-9 18:43:11

not in


thinkmoore
2017-2-9 18:43:12

duh


jerryj
2017-2-9 18:43:32

i see what you’re getting at tho yeah


thinkmoore
2017-2-9 18:43:52

er, there has been at least one mailing list thread about this: http://lists.racket-lang.org/users/archive/2012-August/053641.html


jerryj
2017-2-9 18:44:11

like, i just want that term to match the other things in V that aren’t X. I don’t have a good sense of how to solve this kind of thing, because there seems to be multiple valid approaches


jerryj
2017-2-9 18:44:40

ah, thanks, I’ll read up on that mail


jerryj
2017-2-9 18:46:07

it just occurred to me that maybe type-systems are the solution to this kind of problem. if the expressions were typed you’d have the ability to make more precise matches.. (?)


jerryj
2017-2-9 19:14:49

@thinkmoore thanks for talking it out with me. The mailing list item helped — i didn’t realize that you could used redex-match in the side-condition to test for things. I was jammed up on how to test if something was a variable. symbol? worked, but that is just a coincidence, like, there is nothing saying that a variable has to be a symbol. so now i’m doing (side-condition (not (redex-match iswim-mach-cek X (term V)))) and that gets rid of the ambiguity I saw.


notjack
2017-2-9 22:29:24

@stamourv I was actually in the middle of a second draft on the blog post, whoops


stamourv
2017-2-9 22:40:52

@notjack: Oh. Oops.


stamourv
2017-2-9 22:41:02

Should have checked with you.


stamourv
2017-2-9 22:41:11

We can always update it.


notjack
2017-2-9 22:41:46

@stamourv I’ll finish it up tonight and we can update it, no worries


pavpanchekha
2017-2-10 00:53:26

@pavpanchekha has joined the channel


jrw
2017-2-10 03:58:29

@jrw has joined the channel