(require (lib "reduction-semantics.ss" "reduction-semantics") (lib "iswim.ss" "reduction-semantics" "examples") (lib "gui.ss" "reduction-semantics")) (define cc1 (reduction iswim-grammar (side-condition [(M_1 M_2) : (in-hole E_1 ||)] (not (V? (term M_1)))) (term [M_1 : (in-hole E_1 (|| M_2))]))) (define cc2 (reduction iswim-grammar (side-condition [(V_1 M_2) : (in-hole E_1 ||)] (not (V? (term M_2)))) (term [M_2 : (in-hole E_1 (V_1 ||))]))) (define cc3 (reduction iswim-grammar (side-condition [(on_1 V_1 ... M_1 M_2 ...) : (in-hole E_1 ||)] (not (V? (term M_1)))) (term [M_1 : (in-hole E_1 (on_1 V_1 ... || M_2 ...))]))) (define cc4 (reduction iswim-grammar [V_2 : (in-hole E_1 (V_1 ||))] (term [(V_1 V_2) : (in-hole E_1 ||)]))) (define cc5 (reduction iswim-grammar [V_1 : (in-hole E_1 (|| M_2))] (term [(V_1 M_2) : (in-hole E_1 ||)]))) (define cc6 (reduction iswim-grammar [V_2 : (in-hole E_1 (on_1 V_1 ... || M_2 ...))] (term [(on_1 V_1 ... V_2 M_2 ...) : (in-hole E_1 ||)]))) (define ccbeta (reduction iswim-grammar [(("lam" X_1 M_1) V_1) : (in-hole E_1 ||)] (term-let ([M_2 (iswim-subst (term M_1) (term X_1) (term V_1))]) (term [M_2 : (in-hole E_1 ||)])))) (define ccdelta (reduction iswim-grammar [(on_1 V_1 ...) : (in-hole E_1 ||)] ;; Note: delta*n always succeeds (term-let ([V_2 (delta*n (term on_1) (term (V_1 ...))) ]) (term [V_2 : (in-hole E_1 ||)])))) (define :->cc (list cc1 cc2 cc3 cc4 cc5 cc6 ccbeta ccdelta)) (traces iswim-grammar :->cc `((("lam" x ("+" 10 ("-" 11 x))) (("lam" z z) 12)) : ||))