diff --git a/uplc/cost_model.py b/uplc/cost_model.py index ec11aed..7064133 100644 --- a/uplc/cost_model.py +++ b/uplc/cost_model.py @@ -267,7 +267,7 @@ class ConstAboveDiagonal(CostingFun): def cost(self, *memories: int, values=()) -> int: x, y = memories[0], memories[1] - if x > y: + if x < y: return self.model_above_diagonal.cost(x, y) return self.model_below_equal_diagonal.cost(x, y) diff --git a/uplc/cost_model_files/base/builtinCostModel.json b/uplc/cost_model_files/base/builtinCostModel.json index 40ea0cc..5bc1fc2 100644 --- a/uplc/cost_model_files/base/builtinCostModel.json +++ b/uplc/cost_model_files/base/builtinCostModel.json @@ -724,7 +724,7 @@ "type": "quadratic_in_x_and_y" } }, - "type": "const_below_diagonal" + "type": "const_above_diagonal" }, "memory": { "arguments": {