"is not in my domain"

53 views
Skip to first unread message

Beatriz Moreira

unread,
May 29, 2020, 3:21:57 AM5/29/20
to Racket Users

Hi, im a beginner with racket and im using it to implement a language in order to test its operational semantic rules.

This is the function where i keep having the error:

(define-metafunction FS

call : env-ß classes address f ((x v)...) -> e

[(call (env-ß_1 ... ((address_1 C_1 n_1 vars_1 ...) ... (address C n vars ...) (address_2 C_2 n_2 vars_2 ...) ...) env-ß_2 ...)

((contract C_1 {x_11 ...} F_1) ... (contract C {x_1 ...} f (x ...) {return e}) (contract C_2 {x_22 ...} F_2) ...) address f ((x v)...))

e])


And this is the error message :

../../../../../../../Applications/Racket v7.6/share/pkgs/redex-lib/redex/private/reduction-semantics.rkt:1588:55: call: (call (((2 C 4 (x 3) (r 9)) (9 A 24 (a 9) (b 5)))) ((contract C (x r) (a (d y) (return (y + d)))) (contract A (a b) (c (a b) (return (3))))) 2 a (d 7) (y 3)) is not in my domain

I have tried changing the parenthesis but i can't seem to get it right. Here's the code .Thank you guys for your help! :)

Ben Greenman

unread,
Jun 1, 2020, 9:59:25 AM6/1/20
to Racket Users
> <https://bitbucket.org/beatrizmoreira/contracts/src/master/newfs.rkt> .Thank
>
> you guys for your help! :)

The "not in my domain error" happens when a metafunction gets either
the wrong number of arguments or the wrong shape for a certain arg.

Once you have the right number of arguments, `redex-match?` can help
check shapes.

```
(require rackunit)
(check-true (redex-match? FS env-ß (term (((2 C 4 (x 3) (r 9)) (9 A 24
(a 9) (b 5)))))))
```
Reply all
Reply to author
Forward
0 new messages