@@ -36,7 +36,6 @@ module CCC.Compiler
3636
3737import CCC.CatExpr (CatExpr (.. ))
3838import CCC.Cat (fanC )
39- import CCC.Rewrite (simplify )
4039import Parser (Environment , Expr (.. ))
4140
4241-- A closed morphism: valid in any input context z, i.e. a global element z → a.
@@ -65,7 +64,7 @@ newtype ClosedSel = ClosedSel (forall z. CatExpr z (CatExpr (Integer, Integer) I
6564compileNumExpr :: Environment -> Expr -> CatExpr a Integer
6665compileNumExpr env expr =
6766 case compileIntExpr env expr of
68- Right (Closed cat) -> simplify cat
67+ Right (Closed cat) -> cat
6968 Left err -> error (" Structural compilation failed: " ++ err)
7069
7170compileIntExpr :: Environment -> Expr -> Either String (Closed Integer )
@@ -446,8 +445,8 @@ compileEnvironment env = map compileBinding env
446445 where
447446 compileBinding (name, expr) =
448447 case compileExpr env [] expr of
449- Right (SInt (Closed cat)) -> (name, show (simplify cat) )
450- Right (SSel (ClosedSel cat)) -> (name, show (simplify cat) )
448+ Right (SInt (Closed cat)) -> (name, show cat)
449+ Right (SSel (ClosedSel cat)) -> (name, show cat)
451450 Right (SFun _) -> (name, " <lambda function>" )
452451 Left err -> (name, " <compile error: " ++ err ++ " >" )
453452
@@ -459,7 +458,7 @@ tryCompileVar env name =
459458 case lookup name env of
460459 Just expr ->
461460 case compileIntExpr env expr of
462- Right (Closed cat) -> Right (simplify cat)
461+ Right (Closed cat) -> Right cat
463462 Left err -> Left $ " Expected numeric value for '" ++ name ++ " ', got: " ++ err
464463 Nothing -> Left $ " Variable '" ++ name ++ " ' not found in environment"
465464
0 commit comments