Questions tagged [plt-redex]

PLT Redex is a domain-specific language designed for specifying and debugging operational semantics. Given a grammar and the reduction rules, PLT Redex allows interactive exploration of terms and the use of randomized test generation to attempt to falsify properties of a given semantics.

PLT Redex is a domain-specific language designed for specifying and debugging operational semantics. Write down a grammar and the reduction rules, and PLT Redex allows you to interactively explore terms and to use randomized test generation to attempt to falsify properties of your semantics.

PLT Redex is embedded in Racket, meaning all of the convenience of a modern programming language is available, including standard libraries (and non-standard ones) and a program-development environment.

Documentation: The reference manual contains all of the gory details of all of Redex's operators.

19 questions
13
votes
1 answer

PLT Redex: parameterizing a language definition

This is a problem that's been nagging at me for some time, and I wonder if anyone here can help. I have a PLT Redex model of a language called lambdaLVar that is more or less a garden-variety untyped lambda calculus, but extended with a store…
Lindsey Kuper
  • 984
  • 8
  • 21
8
votes
2 answers

What are "reduction semantics"? Please explain the use of PLT Redex in layman's term

Somebody please explain the usage of reduction semantics and the PLT Redex in simpler language. Thanks.
unj2
  • 52,135
  • 87
  • 247
  • 375
4
votes
1 answer

Reduction-relation's in-hole may match a hole many different ways

I have a language defined with PLT-Redex that has (dynamic) mixin types. Expressions look like the following: ; terms / expressions (e ::= x (lkp e f) (call e m e ...) (new C e ... ⊕ (e R e ...) ...) (bind x ... with (e R e ...)…
lschuetze
  • 1,218
  • 10
  • 25
4
votes
1 answer

plt-redex: capture-avoiding substitution for free?

Every time I define a language in PLT redex, I need to manually define a (capture-avoiding) substitution function. For example, this model isn't finished because subst isn't defined: #lang racket/base (require…
Ben Greenman
  • 1,945
  • 12
  • 22
4
votes
1 answer

Invoke judgment from from within reduction-relation

I'm working on defining a language which has casts and subtyping as follows: (define-language base (t ::= int any) (e ::= number (cast t e)) #| stuff ... |#) I then define the following judgment form over it: (define-judgment-form base …
ckfinite
  • 427
  • 2
  • 6
4
votes
1 answer

How to implement equi-recursive types in PLT Redex?

I believe that I understand both equi-recursive and iso-recursive types quite well. Hence, I've been trying to implement a type checker for ISWIM with equi-recursive types in PLT Redex. However, for the life of me I can't figure out how to make type…
Aadit M Shah
  • 72,912
  • 30
  • 168
  • 299
3
votes
1 answer

Why do I need evaluation contexts in Redex?

It's perfectly possible to write the evaluation rules for my language without using evaluation contexts. My semantics are entirely call by value and do not permit the term to be stepped forwards inside of lambdas. Despite this, all the resources…
superlizardmo
  • 333
  • 1
  • 11
3
votes
1 answer

Redex Does Not Match

A common way of defining semantics is (for example): return v if [some other condition] otherwise, return error For example, consider (define-language simple-dispatch (e ::= v (+ e e)) (v ::= number string) (res ::= e err) (E ::= hole…
ckfinite
  • 427
  • 2
  • 6
3
votes
1 answer

Compare model to implementation in Redex

I'm working on building a model in Redex of a type system that also has a canonical implementation. I would like to use redex-check to fuzz test my model against the actual implementation. The implementation (with an adapter) can take my abstract…
ckfinite
  • 427
  • 2
  • 6
3
votes
1 answer

Racket, PLT Redex, test-->E non existence

I'm trying to prepare semantics for a language. Some derivation may lead to a 'stuck' state. I want to have a test, what certain term can't be reduced to the 'stuck' state. Is it somehow possible to represent it using something like test-->E?
2
votes
1 answer

Trying to define a small language with redex

I'm following the amb tutorial for Redex and, at the same time, building a model for typed arithmetic expressions, as found in Pierce's Types and Programming Languages. I have defined the syntax and type system for such small language, but I'm in…
Rodrigo Ribeiro
  • 3,198
  • 1
  • 18
  • 26
2
votes
1 answer

Ellipsis over unquote in redex term

I'm trying to define a Redex metafunction that converts a list of pairs into a list of single numbers, as follows: #lang racket (require redex) (define-language L (e n ((n n) ...) (n ...)) (n number)) (define-metafunction L ((add-up n)…
ckfinite
  • 427
  • 2
  • 6
2
votes
1 answer

Print successes with redex-check

I am using redex-check to validate a model against another, and would like to see the intermediate (successful) results for debugging purposes. The most obvious way to do this would be to have the property-expr print the given term as a side-effect,…
ckfinite
  • 427
  • 2
  • 6
2
votes
0 answers

Reduction Expression in Java?

Is there a module in Java to define a language and make the reduction of expressions as PLT/Redex module of Racket?
chsms
  • 107
  • 2
2
votes
1 answer

Can PLT-Redex model these features?

Just starting to learn PLT-Redex... Two questions come up: Can we use PLT-Redex to model side effects? For example: simple increment construct i++? What about thread? All the constructs introduced so far does not involve something like creating an…
monica
  • 1,035
  • 1
  • 9
  • 21
1
2