Skip to content

Commit

Permalink
minigent: remove join/meet in minigent
Browse files Browse the repository at this point in the history
  • Loading branch information
vjackson725 committed Mar 9, 2020
1 parent 416270b commit 21b81a5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 142 deletions.
138 changes: 0 additions & 138 deletions minigent/src/Minigent/TC/JoinMeet.hs

This file was deleted.

10 changes: 10 additions & 0 deletions minigent/src/Minigent/TC/SinkFloat.hs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ sinkFloat = Rewrite.rewrite' $ \cs -> do
, Just r2var <- rowVar r2
= makeRowRowVarSubsts r2new r2var

-- tfun
genStructSubst (Function _ _ :< UnifVar i) = makeFunUnifSubsts i
genStructSubst (UnifVar i :< Function _ _) = makeFunUnifSubsts i
genStructSubst (Function _ _ :=: UnifVar i) = makeFunUnifSubsts i
genStructSubst (UnifVar i :=: Function _ _) = makeFunUnifSubsts i

-- primitive types
genStructSubst (t@(PrimType _) :< UnifVar i) = pure [TyAssign i t]
Expand All @@ -133,3 +138,8 @@ sinkFloat = Rewrite.rewrite' $ \cs -> do
absTypeSubs n s ts i = do
ts' <- mapM (const (UnifVar <$> fresh)) ts
return [TyAssign i (AbsType n s ts')]

makeFunUnifSubsts i = do
t' <- UnifVar <$> fresh
u' <- UnifVar <$> fresh
return [TyAssign i $ Function t' u']
5 changes: 1 addition & 4 deletions minigent/src/Minigent/TC/Solver.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import Minigent.TC.Normalise
import Minigent.TC.Simplify
import Minigent.TC.Unify
import Minigent.TC.Equate
import Minigent.TC.JoinMeet
import Minigent.TC.SinkFloat
import Minigent.TC.Assign
import Minigent.Fresh
Expand Down Expand Up @@ -71,9 +70,7 @@ solve axs cs = do
-- Rewrite.debugNewline "[equate]" debugPrettyConstraints <>
Rewrite.lift equate <>
-- Rewrite.debugNewline "[sink/float]" debugPrettyConstraints <>
sinkFloat <>
-- Rewrite.debugNewline "[join/meet]" debugPrettyConstraints <>
joinMeet)
sinkFloat)

-- | Run a solver computation.
runSolver :: Solver a -> FreshT VarName IO (a,[Assign])
Expand Down

0 comments on commit 21b81a5

Please sign in to comment.