Commit Graph

189 Commits

Author SHA1 Message Date
Ben Greenman
dfaab96a29 [o+] check for same-arity functions in unions 2015-10-15 14:31:31 -04:00
Ben Greenman
5c8300a538 [o+] check & filter functions (by arity) 2015-10-15 14:08:22 -04:00
Ben Greenman
e2b1eaa06b bugfix in stlc+sub: subs assumed length=? 2015-10-15 14:00:42 -04:00
Stephen Chang
48b625c2f4 define star as rename-transformer to #%type, in fomega 2015-10-14 15:39:11 -04:00
Stephen Chang
4dd2b66d2b generalize fomega ty= to avoid specific types; add tests
- fixes fomega bug where kind annotations were not being compared
- fix subst bug: must tranfer props (ie types) when replacing an id
- add exist tests to check proper subst in ty=
2015-10-14 14:57:27 -04:00
Stephen Chang
a07fa92d25 clean up fomega2/3, remove many type-eval
- remove expand-fn optional arg in infer fn
2015-10-14 14:57:27 -04:00
stchang
94b610c93b Merged in occurrence (pull request #3)
Occurrence Types: first draft
2015-10-13 21:08:05 -04:00
Ben Greenman
bc2e83c449 [occurence] simple filters complete 2015-10-13 15:16:24 -04:00
Ben Greenman
d7913f7753 [occurrence] subtyping, normal form, and VERY BASIC filters. Having trouble propogating variables. 2015-10-13 12:51:24 -04:00
Ben Greenman
c5d6bfbf9e [occurrence] type eval 2015-10-11 00:22:16 -04:00
Stephen Chang
bf126449b4 define-type-constructor supports annotated bound vars
- use this to impl forall in fomega
- define-type-constructor default arity is =1
- define explicit normalize fn in fomega -- speeds up tests 15%
- move same-type to define-syntax-category
2015-10-09 16:59:48 -04:00
Ben Greenman
5497b347df [occurrence] simple type evaluator, assumes no recursive unions 2015-10-09 02:24:09 -04:00
Stephen Chang
dad2c26c49 add existential tests demonstrating hidden type 2015-10-08 13:22:26 -04:00
Stephen Chang
33996e71ac rec-iso, reduce ty=? to just focus on lamda 2015-10-08 13:21:54 -04:00
Ben Greenman
050c43b3a2 [occurrence] constructor + basic tests 2015-10-06 16:32:26 -04:00
Stephen Chang
0aa2857e74 define-syntax-category defines default type=?; other cleanup
- extended type=? in rec-iso only does 1 subst
- simplify current-type? in fomega by defining in terms of current-kind?
2015-10-06 14:28:08 -04:00
Stephen Chang
2278adcf95 replace provide/requires with "extends...except"/"reuse...from" forms
- introduce basic define-typed-syntax instead of define-syntax
- add fomega3 --- same as fomega2, without the duplication
  - app and lam are both types and terms
  - arrow is both type and kind
  - same tests as fomega2
2015-10-01 16:21:29 -04:00
Stephen Chang
cb7a49ab06 use #lang typecheck 2015-09-23 17:01:13 -04:00
AlexKnauth
149897653a use make-variable-like-transformer 2015-09-21 18:09:58 -04:00
AlexKnauth
82b7ec004d add version of make-variable-like-transformer 2015-09-21 17:54:25 -04:00
Stephen Chang
fc2150dc0d fix subtyping bug in if; add current-join 2015-09-16 15:04:48 -04:00
Stephen Chang
3ea9fc5db0 rec-iso: refactor requires so stlc+tup is base lang 2015-09-16 15:04:13 -04:00
Stephen Chang
a3b9cbc712 fix define-type-constructor to properly error if used at runtime 2015-09-10 14:29:23 -04:00
Stephen Chang
d1814cb57a code cleanup; add define-sub-relation
- all tests passing
2015-08-28 16:57:38 -04:00
Stephen Chang
0255003ff7 all tests passing with define-syntax-category (except some err msgs in fomega2) 2015-08-27 19:30:46 -04:00
Stephen Chang
d9e1c2febb fomega working with define-syntax-category 2015-08-27 17:23:03 -04:00
Stephen Chang
efaef8b60e progress commit: stuck on fomega+define-syntax-category 2015-08-21 19:28:36 -04:00
Stephen Chang
336b6ea1f3 fix bugs in fomega2 2015-08-20 14:49:33 -04:00
Stephen Chang
6feff7d3b3 completed: type valiation; new type constructor pattern matching 2015-08-19 19:29:07 -04:00
Stephen Chang
1a831454f4 progress commit: use typechecking system to typecheck types
- ported (tests passing) up to stlc+sub.rkt
2015-08-14 19:37:09 -04:00
Stephen Chang
3d4fe8f71a new define-type-constructor: exist-tests.rkt passing 2015-08-07 18:12:47 -04:00
Stephen Chang
0dde065949 new define-type-constructor: support binding forms
- tests passing up to stlc+rec-iso.rkt
2015-08-07 17:26:53 -04:00
Stephen Chang
75b4dae95f use new define-type-constructor and #%type in stlc+box 2015-08-04 18:24:33 -04:00
Stephen Chang
6e91837992 use new define-type-constructor and #%type in stlc+cons 2015-08-04 18:21:02 -04:00
Stephen Chang
c151463a6f use #%type in stlc+reco+var.rkt; tests passing 2015-08-04 17:31:36 -04:00
Stephen Chang
a12e85d4bc fix type constructor pattern matching and extraction
- tests passing up to stlc+reco+var tup and proj (not but variants)
2015-07-31 17:33:45 -04:00
Stephen Chang
b687cffb0a extend define-tycon with "get"- extract matched type by pat var name 2015-07-30 14:12:34 -04:00
Stephen Chang
9973e1c705 start require "extends" macro in typecheck.rkt 2015-07-29 14:27:24 -04:00
Stephen Chang
8d6eaf227e ext-stlc-tests.rkt passing 2015-07-28 19:32:16 -04:00
Stephen Chang
655c4acd5a cleanup typecheck.rkt 2015-07-28 19:14:27 -04:00
Stephen Chang
b958ee6947 add #%plain-type; cleanup
- see notes.txt for details on #%plain-type
- convert \vdash to meta2 macro instead of function
  - cleaner syntax -- no #', use colon
- fix some src locs
- up stlc+lit.rkt working, everything else broken
2015-07-28 17:49:29 -04:00
Stephen Chang
a44d946ffb add #%type annotation; add type->str; type constructor pattern match
- #%type annotation distinguishes types from terms
- is-type? checks #%type
- type->str fixes type printing
  - wasnt recursively calling get-orig
- use delay in "type" syntax-class norm attribute
  - fixes eager eval problem from before
- add more invalid type tests
  - only tested up to stlc+lit.rkt
- nicer type constructors
  - more concise, intuitive pat matching language
  - use for-meta 2 macros
2015-07-28 15:25:34 -04:00
Stephen Chang
daecc5c624 add tycon pattern matching to stlc
- fix stlc+lit tests
- current-promote is currently broken
- add err msg checking unit rackunit-typechecking
- works with new expander
2015-07-24 16:26:04 -04:00
Stephen Chang
0e1a848465 add fsub test; typecheck? needs to call current-promote 2015-07-20 18:03:33 -04:00
Stephen Chang
d0c61a5dc0 add current-promote; fsub avoids extending app and proj 2015-07-10 18:14:33 -04:00
Stephen Chang
5435021ee6 complete fsub 2015-07-10 15:43:08 -04:00
Stephen Chang
03453362b5 start fsub 2015-07-09 15:37:50 -04:00
Stephen Chang
176b48208d cleanup 2015-07-09 15:34:36 -04:00
Stephen Chang
f0d314b46d consolidate typecheck.rkt: impl everything in terms of infer fn 2015-07-09 15:30:12 -04:00
Stephen Chang
b0a8d192ef finish exist.rkt 2015-07-09 14:00:36 -04:00
Stephen Chang
e678912c2c add stlc+rec-iso files; rename record files; start exist
- previously forgot to add stlc+rec-iso.rkt and tests
- rename files with records (eg stlc+var, stlc+rec+sub)
  - use "reco" to avoid confusion with recursive types ("rec")
- start exist.rkt --- existential types
2015-07-08 17:24:15 -04:00
Stephen Chang
46598499d1 move define to stlc+var.rkt; cleanup 2015-07-08 17:15:08 -04:00
Stephen Chang
dafa992176 add stlc+(iso)recursive types 2015-06-30 16:32:50 -04:00
Stephen Chang
8656e1469d report errors in terms of surface, not expanded, type 2015-06-30 12:43:03 -04:00
Stephen Chang
d69a16ffcb add fomega2.rkt
- fomega2 is the same as fomega.rkt, except tyapp, tylam, and => are removed
- instead, #%app, \lam, and -> serve dual purpose at both term and type level
2015-06-29 19:41:05 -04:00
Stephen Chang
dcd72eb245 code cleanup 2015-06-29 18:37:40 -04:00
Stephen Chang
479ca7d717 implement fomega type-level abs and app
- add define-type-alias to fomega
- fomega complete and working
2015-06-29 18:20:03 -04:00
Stephen Chang
98fdc8806c convert type representation to fully expanded syntax
- type-eval = expand/df
- fomega tyapp and tylam not yet implemented
2015-06-26 18:56:01 -04:00
Stephen Chang
ad02e586ad small cleanup 2015-06-12 19:33:06 -04:00
Stephen Chang
3d422803f6 make define-type-const a macro to enable error checking 2015-06-12 19:30:00 -04:00
Stephen Chang
ef74f68270 fomega with kinds, no operator abstraction yet 2015-06-11 16:46:50 -04:00
Stephen Chang
7e9d8cd1e0 start fomega 2015-06-10 17:34:58 -04:00
Stephen Chang
e39dc434b4 move eval-tau out of typecheck.rkt 2015-06-10 17:31:01 -04:00
Stephen Chang
e4a234afbc code cleanup 2015-06-10 15:56:27 -04:00
Stephen Chang
50540efaa5 add current-typecheck-relation - generalizes equality and subtype 2015-06-04 15:22:39 -04:00
Stephen Chang
bec3be8b22 use parameters to implement extensible type relations (instead of eval) 2015-06-03 19:25:31 -04:00
Stephen Chang
f703520367 cleanup: remove origin prop 2015-05-28 19:19:40 -04:00
Stephen Chang
d0459d58b0 move type=? out of typecheck.rkt and into each language def 2015-05-28 19:18:26 -04:00
Stephen Chang
f56fae94ab cleanup 2015-05-28 17:40:23 -04:00
Stephen Chang
01999fd2eb move eval-tau to vdash (and testing forms) 2015-05-28 17:28:16 -04:00
Stephen Chang
1b0179d066 add sysf; fix begin splicing problem 2015-05-28 16:01:09 -04:00
Stephen Chang
5c058bffd6 start sysf 2015-05-27 19:25:50 -04:00
Stephen Chang
7759111cb4 add stlc+rec+sub.rkt 2015-05-27 17:31:35 -04:00
Stephen Chang
95aaf627b5 add stlc+sub 2015-05-27 16:07:39 -04:00
Stephen Chang
3a337848b4 start stlc+sub 2015-05-26 19:34:42 -04:00
Stephen Chang
bfe5fbfe00 add stlc+box 2015-05-26 18:04:49 -04:00
Stephen Chang
3ebd1aba5f add stlc+cons 2015-05-26 16:38:21 -04:00
Stephen Chang
3a42569f64 add records and variants 2015-05-22 19:00:40 -04:00
Stephen Chang
ee2789d777 add define-type-alias, changes:
- types must be expanded (with manual handling of #%app)
- type constructors must be prefix
- base types and constructors must be run time identifiers
2015-05-21 14:54:54 -04:00
Stephen Chang
bb7ed03f3c add stlc+tup 2015-05-20 19:27:19 -04:00
Stephen Chang
c4813ebd95 add ext-stlc, not including data structures 2015-05-20 18:10:39 -04:00
Stephen Chang
a4d7483f25 stlc+lit: cleanup and comment 2015-05-20 15:26:02 -04:00
Stephen Chang
adf34fd219 add errors for invalid types 2015-05-20 15:20:43 -04:00
Stephen Chang
ee413b96a2 add define-primop 2015-05-20 15:01:49 -04:00
Stephen Chang
e47fb07aba add infer+erase 2015-05-20 12:17:57 -04:00
Stephen Chang
bd8d1b32d1 tapl: stlc code cleanup 2015-05-19 19:00:43 -04:00
Stephen Chang
338452aadd tapl: add lam-testing example 2015-05-19 18:58:05 -04:00
Stephen Chang
f317282609 tapl: reimplement stlc using rename-transformers instead of typeenv 2015-05-19 18:54:50 -04:00
Stephen Chang
69c97a5512 start tapl/ dir 2014-11-11 18:21:43 -05:00