@@ -33,7 +33,6 @@ data Expr a
3333 | Constr a Ctr (List (Expr a ))
3434 | Matrix a (Expr a ) (Var × Var ) (Expr a )
3535 | Lambda a (Elim a )
36- | Project (Expr a ) Var
3736 | DProject (Expr a ) (Expr a )
3837 | App (Expr a ) (Expr a )
3938 | Let (VarDef a ) (Expr a )
@@ -77,7 +76,6 @@ instance FV (Expr a) where
7776 fv (Constr _ _ es) = unions (fv <$> es)
7877 fv (Matrix _ e1 _ e2) = fv e1 ∪ fv e2
7978 fv (Lambda _ σ) = fv σ
80- fv (Project e _) = fv e
8179 fv (DProject e x) = fv e ∪ fv x
8280 fv (App e1 e2) = fv e1 ∪ fv e2
8381 fv (Let def e) = fv def ∪ (fv e \\ bv def)
@@ -173,7 +171,6 @@ instance JoinSemilattice a => JoinSemilattice (Expr a) where
173171 join (Matrix α e1 (x × y) e2) (Matrix α' e1' (x' × y') e2') =
174172 Matrix (α ∨ α') (e1 ∨ e1') ((x ≜ x') × (y ≜ y')) (e2 ∨ e2')
175173 join (Lambda α σ) (Lambda α' σ') = Lambda (α ∨ α') (σ ∨ σ')
176- join (Project e x) (Project e' x') = Project (e ∨ e') (x ≜ x')
177174 join (DProject e1 e2) (DProject e1' e2') = DProject (e1 ∨ e1') (e2 ∨ e2')
178175 join (App e1 e2) (App e1' e2') = App (e1 ∨ e1') (e2 ∨ e2')
179176 join (LetRec ρ e) (LetRec ρ' e') = LetRec (ρ ∨ ρ') (e ∨ e')
@@ -191,7 +188,6 @@ instance BoundedJoinSemilattice a => Expandable (Expr a) (Raw Expr) where
191188 expand (Matrix α e1 (x × y) e2) (Matrix _ e1' (x' × y') e2') =
192189 Matrix α (expand e1 e1') ((x ≜ x') × (y ≜ y')) (expand e2 e2')
193190 expand (Lambda α σ) (Lambda _ σ') = Lambda α (expand σ σ')
194- expand (Project e x) (Project e' x') = Project (expand e e') (x ≜ x')
195191 expand (DProject e1 e2) (DProject e1' e2') = DProject (expand e1 e1') (expand e2 e2')
196192 expand (App e1 e2) (App e1' e2') = App (expand e1 e1') (expand e2 e2')
197193 expand (Let def e) (Let def' e') = Let (expand def def') (expand e e')
@@ -214,7 +210,6 @@ instance Vertices (Expr Vertex) where
214210 vertices e@(Constr α _ es) = singleton (DVertex (α × pack e)) ∪ unions (vertices <$> es)
215211 vertices e@(Matrix α e1 _ e2) = singleton (DVertex (α × pack e)) ∪ vertices e1 ∪ vertices e2
216212 vertices e@(Lambda α σ) = singleton (DVertex (α × pack e)) ∪ vertices σ
217- vertices (Project e _) = vertices e
218213 vertices (DProject e e') = vertices e ∪ vertices e'
219214 vertices (App e1 e2) = vertices e1 ∪ vertices e2
220215 vertices (Let def e) = vertices def ∪ vertices e
@@ -275,7 +270,6 @@ instance Apply Expr where
275270 apply (Matrix fα fe1 (x × y) fe2) (Matrix α e1 (x' × y') e2) =
276271 Matrix (fα α) (fe1 <*> e1) ((x ≜ x') × (y ≜ y')) (fe2 <*> e2)
277272 apply (Lambda fα fσ) (Lambda α σ) = Lambda (fα α) (fσ <*> σ)
278- apply (Project fe x) (Project e _) = Project (fe <*> e) x
279273 apply (DProject fd fk) (DProject d k) = DProject (fd <*> d) (fk <*> k)
280274 apply (App fe1 fe2) (App e1 e2) = App (fe1 <*> e1) (fe2 <*> e2)
281275 apply (Let (VarDef fσ fe1) fe2) (Let (VarDef σ e1) e2) = Let (VarDef (fσ <*> σ) (fe1 <*> e1)) (fe2 <*> e2)
0 commit comments