add missing value production
also, use redex-check? instead of redex-check in 2 places
This commit is contained in:
parent
1ecd4c0563
commit
5e275e41ef
|
@ -2,11 +2,11 @@
|
||||||
< (define the-error "the ((cons v) v) value has been omitted")
|
< (define the-error "the ((cons v) v) value has been omitted")
|
||||||
---
|
---
|
||||||
> (define the-error "app rule the range of the function is matched to the argument")
|
> (define the-error "app rule the range of the function is matched to the argument")
|
||||||
31a32
|
32a33
|
||||||
> ((cons v) v)
|
> ((cons v) v)
|
||||||
53c54
|
54c55
|
||||||
< (typeof Γ M_2 σ)
|
< (typeof Γ M_2 σ)
|
||||||
---
|
---
|
||||||
> (typeof Γ M_2 σ_2)
|
> (typeof Γ M_2 σ_2)
|
||||||
236d236
|
237d237
|
||||||
<
|
<
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
< (define the-error "the ((cons v) v) value has been omitted")
|
< (define the-error "the ((cons v) v) value has been omitted")
|
||||||
---
|
---
|
||||||
> (define the-error "the ((cons number) v) value has been omitted")
|
> (define the-error "the ((cons number) v) value has been omitted")
|
||||||
31a32
|
32a33
|
||||||
> ((cons v) v)
|
> ((cons v) v)
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
< (define the-error "the ((cons v) v) value has been omitted")
|
< (define the-error "the ((cons v) v) value has been omitted")
|
||||||
---
|
---
|
||||||
> (define the-error "the order of the types in the function position of application has been swapped")
|
> (define the-error "the order of the types in the function position of application has been swapped")
|
||||||
31a32
|
32a33
|
||||||
> ((cons v) v)
|
> ((cons v) v)
|
||||||
52c53
|
53c54
|
||||||
< [(typeof Γ M (σ → σ_2))
|
< [(typeof Γ M (σ → σ_2))
|
||||||
---
|
---
|
||||||
> [(typeof Γ M (σ_2 → σ))
|
> [(typeof Γ M (σ_2 → σ))
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
< (define the-error "the ((cons v) v) value has been omitted")
|
< (define the-error "the ((cons v) v) value has been omitted")
|
||||||
---
|
---
|
||||||
> (define the-error "the type of cons is incorrect")
|
> (define the-error "the type of cons is incorrect")
|
||||||
31a32
|
32a33
|
||||||
> ((cons v) v)
|
> ((cons v) v)
|
||||||
62c63
|
63c64
|
||||||
< (int → ((list int) → (list int)))]
|
< (int → ((list int) → (list int)))]
|
||||||
---
|
---
|
||||||
> (int → ((list int) → int))]
|
> (int → ((list int) → int))]
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
< (define the-error "the ((cons v) v) value has been omitted")
|
< (define the-error "the ((cons v) v) value has been omitted")
|
||||||
---
|
---
|
||||||
> (define the-error "the tail reduction returns the wrong value")
|
> (define the-error "the tail reduction returns the wrong value")
|
||||||
31a32
|
32a33
|
||||||
> ((cons v) v)
|
> ((cons v) v)
|
||||||
91c92
|
92c93
|
||||||
< (in-hole E v_2)
|
< (in-hole E v_2)
|
||||||
---
|
---
|
||||||
> (in-hole E v_1)
|
> (in-hole E v_1)
|
||||||
236d236
|
237d237
|
||||||
<
|
<
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
< (define the-error "the ((cons v) v) value has been omitted")
|
< (define the-error "the ((cons v) v) value has been omitted")
|
||||||
---
|
---
|
||||||
> (define the-error "hd reduction acts on partially applied cons")
|
> (define the-error "hd reduction acts on partially applied cons")
|
||||||
31a32
|
32a33
|
||||||
> ((cons v) v)
|
> ((cons v) v)
|
||||||
87c88
|
88c89
|
||||||
< (--> (in-hole E (hd ((cons v_1) v_2)))
|
< (--> (in-hole E (hd ((cons v_1) v_2)))
|
||||||
---
|
---
|
||||||
> (--> (in-hole E (hd (cons v_1)))
|
> (--> (in-hole E (hd (cons v_1)))
|
||||||
236d236
|
237d237
|
||||||
<
|
<
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
< (define the-error "the ((cons v) v) value has been omitted")
|
< (define the-error "the ((cons v) v) value has been omitted")
|
||||||
---
|
---
|
||||||
> (define the-error "evaluation isn't allowed on the rhs of applications")
|
> (define the-error "evaluation isn't allowed on the rhs of applications")
|
||||||
31a32
|
32a33
|
||||||
> ((cons v) v)
|
> ((cons v) v)
|
||||||
34,35c35
|
35,36c36
|
||||||
< (E M)
|
< (E M)
|
||||||
< (v E)))
|
< (v E)))
|
||||||
---
|
---
|
||||||
> (E M)))
|
> (E M)))
|
||||||
236d235
|
237d236
|
||||||
<
|
<
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
< (define the-error "the ((cons v) v) value has been omitted")
|
< (define the-error "the ((cons v) v) value has been omitted")
|
||||||
---
|
---
|
||||||
> (define the-error "lookup always returns int")
|
> (define the-error "lookup always returns int")
|
||||||
31a32
|
32a33
|
||||||
> ((cons v) v)
|
> ((cons v) v)
|
||||||
75c76
|
76c77
|
||||||
< σ]
|
< σ]
|
||||||
---
|
---
|
||||||
> int]
|
> int]
|
||||||
236d236
|
237d237
|
||||||
<
|
<
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
< (define the-error "the ((cons v) v) value has been omitted")
|
< (define the-error "the ((cons v) v) value has been omitted")
|
||||||
---
|
---
|
||||||
> (define the-error "variables aren't required to match in lookup")
|
> (define the-error "variables aren't required to match in lookup")
|
||||||
31a32
|
32a33
|
||||||
> ((cons v) v)
|
> ((cons v) v)
|
||||||
74c75
|
75c76
|
||||||
< [(lookup (x σ Γ) x)
|
< [(lookup (x σ Γ) x)
|
||||||
---
|
---
|
||||||
> [(lookup (x σ Γ) x_2)
|
> [(lookup (x σ Γ) x_2)
|
||||||
236d236
|
237d237
|
||||||
<
|
<
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
c
|
c
|
||||||
(cons v)
|
(cons v)
|
||||||
((cons v) v)
|
((cons v) v)
|
||||||
|
((cons v) v)
|
||||||
(+ v))
|
(+ v))
|
||||||
(E hole
|
(E hole
|
||||||
(E M)
|
(E M)
|
||||||
|
@ -124,8 +125,8 @@
|
||||||
[(subst M x N)
|
[(subst M x N)
|
||||||
,(subst/proc x? (term (x)) (term (N)) (term M))])
|
,(subst/proc x? (term (x)) (term (N)) (term M))])
|
||||||
|
|
||||||
(define v? (redex-match stlc v))
|
(define v? (redex-match? stlc v))
|
||||||
(define τ? (redex-match stlc τ))
|
(define τ? (redex-match? stlc τ))
|
||||||
(define/contract (type-check M)
|
(define/contract (type-check M)
|
||||||
(-> M? (or/c τ? #f))
|
(-> M? (or/c τ? #f))
|
||||||
(define M-t (judgment-holds (typeof • ,M τ) τ))
|
(define M-t (judgment-holds (typeof • ,M τ) τ))
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
c
|
c
|
||||||
(cons v)
|
(cons v)
|
||||||
((cons v) v)
|
((cons v) v)
|
||||||
|
((cons v) v)
|
||||||
(+ v))
|
(+ v))
|
||||||
(E hole
|
(E hole
|
||||||
(E M)
|
(E M)
|
||||||
|
@ -124,8 +125,8 @@
|
||||||
[(subst M x N)
|
[(subst M x N)
|
||||||
,(subst/proc x? (term (x)) (term (N)) (term M))])
|
,(subst/proc x? (term (x)) (term (N)) (term M))])
|
||||||
|
|
||||||
(define v? (redex-match stlc v))
|
(define v? (redex-match? stlc v))
|
||||||
(define τ? (redex-match stlc τ))
|
(define τ? (redex-match? stlc τ))
|
||||||
(define/contract (type-check M)
|
(define/contract (type-check M)
|
||||||
(-> M? (or/c τ? #f))
|
(-> M? (or/c τ? #f))
|
||||||
(define M-t (judgment-holds (typeof • ,M τ) τ))
|
(define M-t (judgment-holds (typeof • ,M τ) τ))
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
c
|
c
|
||||||
(cons v)
|
(cons v)
|
||||||
((cons v) v)
|
((cons v) v)
|
||||||
|
((cons v) v)
|
||||||
(+ v))
|
(+ v))
|
||||||
(E hole
|
(E hole
|
||||||
(E M)
|
(E M)
|
||||||
|
@ -124,8 +125,8 @@
|
||||||
[(subst M x N)
|
[(subst M x N)
|
||||||
,(subst/proc x? (term (x)) (term (N)) (term M))])
|
,(subst/proc x? (term (x)) (term (N)) (term M))])
|
||||||
|
|
||||||
(define v? (redex-match stlc v))
|
(define v? (redex-match? stlc v))
|
||||||
(define τ? (redex-match stlc τ))
|
(define τ? (redex-match? stlc τ))
|
||||||
(define/contract (type-check M)
|
(define/contract (type-check M)
|
||||||
(-> M? (or/c τ? #f))
|
(-> M? (or/c τ? #f))
|
||||||
(define M-t (judgment-holds (typeof • ,M τ) τ))
|
(define M-t (judgment-holds (typeof • ,M τ) τ))
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
c
|
c
|
||||||
(cons v)
|
(cons v)
|
||||||
((cons v) v)
|
((cons v) v)
|
||||||
|
((cons v) v)
|
||||||
(+ v))
|
(+ v))
|
||||||
(E hole
|
(E hole
|
||||||
(E M)
|
(E M)
|
||||||
|
@ -124,8 +125,8 @@
|
||||||
[(subst M x N)
|
[(subst M x N)
|
||||||
,(subst/proc x? (term (x)) (term (N)) (term M))])
|
,(subst/proc x? (term (x)) (term (N)) (term M))])
|
||||||
|
|
||||||
(define v? (redex-match stlc v))
|
(define v? (redex-match? stlc v))
|
||||||
(define τ? (redex-match stlc τ))
|
(define τ? (redex-match? stlc τ))
|
||||||
(define/contract (type-check M)
|
(define/contract (type-check M)
|
||||||
(-> M? (or/c τ? #f))
|
(-> M? (or/c τ? #f))
|
||||||
(define M-t (judgment-holds (typeof • ,M τ) τ))
|
(define M-t (judgment-holds (typeof • ,M τ) τ))
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
c
|
c
|
||||||
(cons v)
|
(cons v)
|
||||||
((cons v) v)
|
((cons v) v)
|
||||||
|
((cons v) v)
|
||||||
(+ v))
|
(+ v))
|
||||||
(E hole
|
(E hole
|
||||||
(E M)
|
(E M)
|
||||||
|
@ -124,8 +125,8 @@
|
||||||
[(subst M x N)
|
[(subst M x N)
|
||||||
,(subst/proc x? (term (x)) (term (N)) (term M))])
|
,(subst/proc x? (term (x)) (term (N)) (term M))])
|
||||||
|
|
||||||
(define v? (redex-match stlc v))
|
(define v? (redex-match? stlc v))
|
||||||
(define τ? (redex-match stlc τ))
|
(define τ? (redex-match? stlc τ))
|
||||||
(define/contract (type-check M)
|
(define/contract (type-check M)
|
||||||
(-> M? (or/c τ? #f))
|
(-> M? (or/c τ? #f))
|
||||||
(define M-t (judgment-holds (typeof • ,M τ) τ))
|
(define M-t (judgment-holds (typeof • ,M τ) τ))
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
c
|
c
|
||||||
(cons v)
|
(cons v)
|
||||||
((cons v) v)
|
((cons v) v)
|
||||||
|
((cons v) v)
|
||||||
(+ v))
|
(+ v))
|
||||||
(E hole
|
(E hole
|
||||||
(E M)
|
(E M)
|
||||||
|
@ -124,8 +125,8 @@
|
||||||
[(subst M x N)
|
[(subst M x N)
|
||||||
,(subst/proc x? (term (x)) (term (N)) (term M))])
|
,(subst/proc x? (term (x)) (term (N)) (term M))])
|
||||||
|
|
||||||
(define v? (redex-match stlc v))
|
(define v? (redex-match? stlc v))
|
||||||
(define τ? (redex-match stlc τ))
|
(define τ? (redex-match? stlc τ))
|
||||||
(define/contract (type-check M)
|
(define/contract (type-check M)
|
||||||
(-> M? (or/c τ? #f))
|
(-> M? (or/c τ? #f))
|
||||||
(define M-t (judgment-holds (typeof • ,M τ) τ))
|
(define M-t (judgment-holds (typeof • ,M τ) τ))
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
c
|
c
|
||||||
(cons v)
|
(cons v)
|
||||||
((cons v) v)
|
((cons v) v)
|
||||||
|
((cons v) v)
|
||||||
(+ v))
|
(+ v))
|
||||||
(E hole
|
(E hole
|
||||||
(E M)))
|
(E M)))
|
||||||
|
@ -123,8 +124,8 @@
|
||||||
[(subst M x N)
|
[(subst M x N)
|
||||||
,(subst/proc x? (term (x)) (term (N)) (term M))])
|
,(subst/proc x? (term (x)) (term (N)) (term M))])
|
||||||
|
|
||||||
(define v? (redex-match stlc v))
|
(define v? (redex-match? stlc v))
|
||||||
(define τ? (redex-match stlc τ))
|
(define τ? (redex-match? stlc τ))
|
||||||
(define/contract (type-check M)
|
(define/contract (type-check M)
|
||||||
(-> M? (or/c τ? #f))
|
(-> M? (or/c τ? #f))
|
||||||
(define M-t (judgment-holds (typeof • ,M τ) τ))
|
(define M-t (judgment-holds (typeof • ,M τ) τ))
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
c
|
c
|
||||||
(cons v)
|
(cons v)
|
||||||
((cons v) v)
|
((cons v) v)
|
||||||
|
((cons v) v)
|
||||||
(+ v))
|
(+ v))
|
||||||
(E hole
|
(E hole
|
||||||
(E M)
|
(E M)
|
||||||
|
@ -124,8 +125,8 @@
|
||||||
[(subst M x N)
|
[(subst M x N)
|
||||||
,(subst/proc x? (term (x)) (term (N)) (term M))])
|
,(subst/proc x? (term (x)) (term (N)) (term M))])
|
||||||
|
|
||||||
(define v? (redex-match stlc v))
|
(define v? (redex-match? stlc v))
|
||||||
(define τ? (redex-match stlc τ))
|
(define τ? (redex-match? stlc τ))
|
||||||
(define/contract (type-check M)
|
(define/contract (type-check M)
|
||||||
(-> M? (or/c τ? #f))
|
(-> M? (or/c τ? #f))
|
||||||
(define M-t (judgment-holds (typeof • ,M τ) τ))
|
(define M-t (judgment-holds (typeof • ,M τ) τ))
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
c
|
c
|
||||||
(cons v)
|
(cons v)
|
||||||
((cons v) v)
|
((cons v) v)
|
||||||
|
((cons v) v)
|
||||||
(+ v))
|
(+ v))
|
||||||
(E hole
|
(E hole
|
||||||
(E M)
|
(E M)
|
||||||
|
@ -124,8 +125,8 @@
|
||||||
[(subst M x N)
|
[(subst M x N)
|
||||||
,(subst/proc x? (term (x)) (term (N)) (term M))])
|
,(subst/proc x? (term (x)) (term (N)) (term M))])
|
||||||
|
|
||||||
(define v? (redex-match stlc v))
|
(define v? (redex-match? stlc v))
|
||||||
(define τ? (redex-match stlc τ))
|
(define τ? (redex-match? stlc τ))
|
||||||
(define/contract (type-check M)
|
(define/contract (type-check M)
|
||||||
(-> M? (or/c τ? #f))
|
(-> M? (or/c τ? #f))
|
||||||
(define M-t (judgment-holds (typeof • ,M τ) τ))
|
(define M-t (judgment-holds (typeof • ,M τ) τ))
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
(v (λ (x τ) M)
|
(v (λ (x τ) M)
|
||||||
c
|
c
|
||||||
(cons v)
|
(cons v)
|
||||||
|
((cons v) v)
|
||||||
(+ v))
|
(+ v))
|
||||||
(E hole
|
(E hole
|
||||||
(E M)
|
(E M)
|
||||||
|
@ -123,8 +124,8 @@
|
||||||
[(subst M x N)
|
[(subst M x N)
|
||||||
,(subst/proc x? (term (x)) (term (N)) (term M))])
|
,(subst/proc x? (term (x)) (term (N)) (term M))])
|
||||||
|
|
||||||
(define v? (redex-match stlc v))
|
(define v? (redex-match? stlc v))
|
||||||
(define τ? (redex-match stlc τ))
|
(define τ? (redex-match? stlc τ))
|
||||||
(define/contract (type-check M)
|
(define/contract (type-check M)
|
||||||
(-> M? (or/c τ? #f))
|
(-> M? (or/c τ? #f))
|
||||||
(define M-t (judgment-holds (typeof • ,M τ) τ))
|
(define M-t (judgment-holds (typeof • ,M τ) τ))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user