Closed mbuszka closed 3 years ago
Yes. This works, for example:
#lang racket
(require redex/reduction-semantics)
(define-language L
(n ::= Z (S n)))
(define-judgment-form L
#:mode (odd I)
[(even n)
----------
(odd (S n))])
(define-judgment-form L
#:mode (even I)
[--------
(even Z)]
[(odd n)
------------
(even (S n))])
(test-judgment-holds (even Z))
(test-judgment-holds (odd (S Z)))
(test-judgment-holds (even (S (S Z))))
(test-equal (judgment-holds (odd Z)) #f)
(test-equal (judgment-holds (even (S Z))) #f)
(test-results)
Thank you!
Is it possible to define mutually recursive judgements/meta-functions?