Stephen Chang
35b36b3781
stlc+define+cons/racket-ext: cleanup
2014-09-03 18:44:50 -04:00
Stephen Chang
9de0cea481
stlc+cons+defined-via-racket-ext: cases working, all tests passing; todo: abstract the meta(term) stx class
2014-09-03 18:42:11 -04:00
Stephen Chang
fcbab12a9a
stlc+cons+defined-via-racket-ext: add top level define
2014-09-03 14:14:14 -04:00
Stephen Chang
e05e60a566
stlc+define-ext: add begin, void, if
2014-08-28 16:23:17 -04:00
Stephen Chang
2311deb396
add tests for testing extended datum
2014-08-28 16:22:54 -04:00
Stephen Chang
e4f788ec7a
use define-simple-syntax/type-rule instead of define-term/type-rule
2014-08-28 16:22:25 -04:00
Stephen Chang
003e38b40f
stlc+define-via-racket-ext: add tests
2014-08-28 16:21:43 -04:00
Stephen Chang
76a2f310f2
racket-ext:
...
- rename define-term/type-rule to define-simple-syntax/type-rule
- add requires, provides and testing forms implicitly
- add == type constraint
2014-08-28 16:20:50 -04:00
Stephen Chang
235c953a5d
add stlc+define+cons-via-racket-extended.rkt
2014-08-28 15:22:42 -04:00
Stephen Chang
12ffcb4238
update stlc-via-racket-ext to use changes from racket-ext: declare-base-types, automatic requires/provides
2014-08-28 15:22:20 -04:00
Stephen Chang
ca8e922c56
add extends form for racket-extended
2014-08-28 15:21:06 -04:00
Stephen Chang
9b8193e383
stlc+define+cons: add printf, make vararg for primops work
...
- general cleanup
- add more tests
- todo: support vararg type in general in application
2014-08-27 16:33:53 -04:00
Stephen Chang
034f072156
typecheck: fix error msg to not reveal internal stack trace; primop
...
- primop properly handles varargs and gives good err msg
- todo: primop has non-vararg type when used as HO fn
2014-08-27 16:32:36 -04:00
Stephen Chang
ac69545d6b
typecheck: add define-primop
2014-08-27 14:51:10 -04:00
Stephen Chang
7210c79b03
stx-utils: add stx-length and stx-last
2014-08-27 14:50:54 -04:00
Stephen Chang
ea5d0d1a02
stlc: use define-primop; rename stlc-test stlc-tests.rkt
2014-08-27 14:50:27 -04:00
Stephen Chang
dc3409fe20
rename tests for stlc+define+cons
2014-08-26 19:25:40 -04:00
Stephen Chang
6af7402e42
stlc+define+cons passing tests (in stlc-tests.rkt)
2014-08-26 19:24:53 -04:00
Stephen Chang
27d7f33b4a
add parallel implementation what uses racket-extended instead of racket
...
- currently stlc (core) only
2014-08-26 16:53:48 -04:00
Stephen Chang
2d2d278b8e
split stlc into stlc.rkt and stlc+define+cons.rkt
...
- old stlc.rkt is now stlc+define+cons.rkt
- new stlc.rkt defines core forms (lam, app, var) only
2014-08-26 16:52:36 -04:00
Stephen Chang
b2ab7f322f
add notes file
2014-08-26 16:50:30 -04:00
Stephen Chang
71d65e1a44
stlc, sysf: make function tycon infix instead of prefix
...
- TODO: typecheck uses -> as datum-literal because it can't see the
actual literal, fix this
2014-08-21 13:31:11 -04:00
Stephen Chang
4d8f904e70
sysf: fix forall inst problems
...
- also add tyvar and tau-inst-list syntax-classes
- add better forall tests
- exposes problem with naive subst - if you subst non-id type
- add lots of notes about forall problem
2014-08-20 19:20:02 -04:00
Stephen Chang
69ef254227
typecheck: reimpl apply-forall, doing manual subst, special-handling binding forms
2014-08-20 19:19:09 -04:00
Stephen Chang
81143e27cb
stx-utils: add stx-member
2014-08-20 19:18:30 -04:00
Stephen Chang
b0769c5f1a
sysf: impl renaming of forall binders but then backed out
...
- capture when applying forall is ok since binder is renamed as well
- and since type names are valid binder names, this is ok
- TODO: what if we call inst with non-base type?
- add more variable capture tests
- typecheck: type= handles alpha-equiv
2014-08-20 14:39:24 -04:00
Stephen Chang
5a4e27a7d8
cleanup old type-error usage
2014-08-19 16:06:27 -04:00
Stephen Chang
fbca467d01
typecheck: add type-error form
2014-08-19 16:05:08 -04:00
Stephen Chang
70767635bb
stlc: cleanup
2014-08-19 15:53:41 -04:00
Stephen Chang
852dc14a06
sysf-tests: small edit to nqueens test
2014-08-19 15:50:26 -04:00
Stephen Chang
c14f4bc705
sysf: add inst, better error when type insts are missing in app
...
- add nqueens to sysf-tests
- current failing cases: nested foralls
- giving poly fn to map without explicit inst
2014-08-18 18:36:41 -04:00
Stephen Chang
4a5eb432af
stlc:
...
- add define-prim,
- better errors,
- add list/tc,
- single-case define-type
- started a hack of a base type env in mod-begin
2014-08-18 18:34:49 -04:00
Stephen Chang
99cc2e57e8
code cleanup
2014-08-15 19:07:47 -04:00
Stephen Chang
45dd603a08
stlc and sysf: require define to give explicit return type
...
sysf: extended cases to handle forall
2014-08-15 19:04:16 -04:00
Stephen Chang
e6062f605e
stlc: implement define/tc
...
- module-begin handles defines more modularly (and extensibly)
- remove letrec/tc
2014-08-15 17:10:43 -04:00
Stephen Chang
8ece6a3986
typecheck.rkt: add apply-forall
2014-08-15 16:22:32 -04:00
Stephen Chang
4dcb1230b8
stlc: add extensibility note in define-type
2014-08-15 16:21:58 -04:00
Stephen Chang
caeda2ff0d
sysf: move apply-forall to typecheck.rkt
2014-08-15 16:18:17 -04:00
Stephen Chang
ea5d41deb0
sysf: code cleanup
...
- at this point, sysf only extends define-type, app, and lambda
- sysf passes all stlc-tests and sysf-tests
2014-08-15 16:16:24 -04:00
Stephen Chang
b49ddbaabf
stlc: fix some bugs
...
- provide assert-Unit-type and assert-Int-type, for sysf
- sysf must use these instead of its own because type= relies on
free-identifier=?, so it must be comparing the same Int type
- move tests to the end
- define-type syntax class must declare define-type as a datum-literal
and not a literal, otherwise the wrong version will get used when
another language extends define-type
2014-08-15 16:11:09 -04:00
Stephen Chang
cb3842281d
stlc-tests: fix accidental copy and paste
2014-08-15 15:54:38 -04:00
Stephen Chang
0a82e9298c
sysf: basic forall type working
2014-08-15 15:33:07 -04:00
Stephen Chang
1a327fc8f9
add sysf tests
2014-08-15 15:32:54 -04:00
Stephen Chang
820d56cf2a
stx-utils: add curly-parens?
2014-08-15 15:32:18 -04:00
Stephen Chang
723c5bbaec
separate general type checking fns from stlc
2014-08-14 15:15:42 -04:00
Stephen Chang
857fee962f
fix some stlc bugs
...
- need to manually check for lone identifiers in lambda body
- ow they wont get expanded and wont get a type
- in type=?, make sure tycons have same number of args
2014-08-14 14:28:18 -04:00
Stephen Chang
4783c7f93e
sysf: copied from stlc
2014-08-13 16:39:16 -04:00
Stephen Chang
cc3a224a7b
stlc bug: cases expr had no type
2014-08-13 15:38:14 -04:00
Stephen Chang
10674298c4
stlc cleanup
2014-08-13 14:30:13 -04:00
Stephen Chang
dff0f2b79f
add stlc tests for recursive define-types (ie intlist)
2014-08-13 14:28:45 -04:00