Skip to content

Commit

Permalink
Remove UnitT from type analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
rtjoa committed Jan 26, 2024
1 parent a902058 commit 671b3c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions tree_unique_args/src/type_analysis.egg
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
(datatype Type
(IntT)
(BoolT)
(UnitT)
(FuncT Type Type)
(TupleT TypeList)
)
Expand Down Expand Up @@ -38,7 +37,7 @@
:ruleset type-analysis)

(rule ((UnitExpr id))
((HasType (UnitExpr id) (UnitT)))
((HasType (UnitExpr id) (TupleT (TNil))))
:ruleset type-analysis)

; Pure Op Compute
Expand Down Expand Up @@ -113,7 +112,7 @@

; Effectful Ops
(rule ((Print e))
((HasType (Print e) (UnitT)))
((HasType (Print e) (TupleT (TNil))))
:ruleset type-analysis)
; TODO: Read and Write (requires type annotations)

Expand Down
2 changes: 1 addition & 1 deletion tree_unique_args/src/type_analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn switch_int() -> Result<(), egglog::Error> {
(check (HasType s1 (IntT)))
(check (HasType s2 (BoolT)))
(check (HasType s3 (UnitT)))
(check (HasType s3 (TupleT (TNil))))
";
crate::run_test(build, check)
}
Expand Down

0 comments on commit 671b3c4

Please sign in to comment.