Skip to content

Commit

Permalink
lean: add support for int_mult (#752)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasgrosser authored Oct 30, 2024
1 parent 262cab4 commit 9e228eb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/arith.sail
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ overload negate = {negate_atom, negate_int}
val mult_atom = pure {ocaml: "mult", interpreter: "mult", lem: "integerMult", coq: "Z.mul", _: "mult_int"} : forall 'n 'm.
(int('n), int('m)) -> int('n * 'm)

val mult_int = pure {ocaml: "mult", interpreter: "mult", lem: "integerMult", coq: "Z.mul", _: "mult_int"} : (int, int) -> int
val mult_int = pure {ocaml: "mult", interpreter: "mult", lem: "integerMult", coq: "Z.mul", lean: "Int.mul", _: "mult_int"} : (int, int) -> int

overload operator * = {mult_atom, mult_int}

Expand Down
5 changes: 4 additions & 1 deletion test/lean/extern.expected.lean
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
def foo : Int :=
def extern_negate : Int :=
(Int.neg 5)

def extern_mult : Int :=
(Int.mul 5 4)

def initialize_registers : Unit :=
()

6 changes: 5 additions & 1 deletion test/lean/extern.sail
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ default Order dec

$include <prelude.sail>

function foo() -> int = {
function extern_negate() -> int = {
return negate_int(5)
}

function extern_mult() -> int = {
return mult_int(5, 4)
}

0 comments on commit 9e228eb

Please sign in to comment.