Skip to content

Commit

Permalink
Merge pull request #138 from hotman78/fix_ArithmeticalExpr_bug
Browse files Browse the repository at this point in the history
fix(core) : arithmetical expr bug
  • Loading branch information
kmyk authored Aug 4, 2021
2 parents 324934b + d714b16 commit 48a870d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Jikka/Core/Convert/StrengthReduction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ reduceNegate = simpleRewriteRule $ \case
Negate' (Negate' e) -> Just e
Plus' (Negate' e1) (Negate' e2) -> Just $ Negate' (Plus' e1 e2)
Minus' e1 (Negate' e2) -> Just $ Plus' e1 e2
Minus' (Negate' e1) e2 -> Just $ Negate' (Minus' e1 e2)
Minus' (Negate' e1) e2 -> Just $ Negate' (Plus' e1 e2)
-- `Minus` is already removed.
Mult' (Negate' e1) e2 -> Just $ Negate' (Mult' e1 e2)
Mult' e1 (Negate' e2) -> Just $ Negate' (Mult' e1 e2)
Expand Down
2 changes: 1 addition & 1 deletion src/Jikka/Core/Language/ArithmeticalExpr.hs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ multSumExpr e1 e2 =
{ sumExprList =
let es1 = parseProductExpr (LitInt' (sumExprConst e1)) : sumExprList e1
es2 = parseProductExpr (LitInt' (sumExprConst e2)) : sumExprList e2
in map (uncurry multProductExpr) ((,) <$> es1 <*> es2),
in tail $ map (uncurry multProductExpr) ((,) <$> es1 <*> es2),
sumExprConst = sumExprConst e1 * sumExprConst e2
}

Expand Down

0 comments on commit 48a870d

Please sign in to comment.