Skip to content

Commit

Permalink
Fix cost model for const above diagonal
Browse files Browse the repository at this point in the history
  • Loading branch information
nielstron committed Jan 6, 2025
1 parent 69bfb05 commit 46befff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion uplc/cost_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion uplc/cost_model_files/base/builtinCostModel.json
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@
"type": "quadratic_in_x_and_y"
}
},
"type": "const_below_diagonal"
"type": "const_above_diagonal"
},
"memory": {
"arguments": {
Expand Down

0 comments on commit 46befff

Please sign in to comment.