(module struct mzscheme
(provide reduction-relation-lang
reduction-relation-make-procs
reduction-relation-rule-names
reduction-relation-lws
reduction-relation-procs
build-reduction-relation
reduction-relation?
empty-reduction-relation
(struct rule-pict (arrow lhs rhs label side-conditions fresh-vars pattern-binds)))
(define-struct rule-pict (arrow lhs rhs label side-conditions fresh-vars pattern-binds))
(define-struct reduction-relation (lang make-procs rule-names lws procs))
(define empty-reduction-relation (make-reduction-relation 'empty-reduction-relations-language
'()
'()
'()
'()))
(define (build-reduction-relation orig-reduction-relation lang make-procs rule-names lws)
(cond
[orig-reduction-relation
(let ([all-make-procs
(append (reduction-relation-make-procs orig-reduction-relation)
make-procs)])
(make-reduction-relation lang
all-make-procs
(append (reduction-relation-rule-names orig-reduction-relation)
rule-names)
lws (map (λ (make-proc) (make-proc lang)) all-make-procs)))]
[else
(make-reduction-relation lang make-procs rule-names lws (map (λ (make-proc) (make-proc lang)) make-procs))])))