Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pyk/src/pyk/klean/k2lean4.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"Lbl'UndsStar'Int'Unds'", # *Int
"Lbl'UndsSlsh'Int'Unds'", # /Int
"Lbl'Unds'modInt'Unds'", # modInt
"Lbl'UndsXor-Perc'Int'UndsUnds'", # ^%Int
"LblmaxInt'LParUndsCommUndsRParUnds'INT-COMMON'Unds'Int'Unds'Int'Unds'Int", # maxInt
"Lbl'Tild'Int'Unds'", # ~Int
"Lbl'Unds-LT-Eqls'Int'Unds'", # <=Int
Expand All @@ -87,6 +88,7 @@

_SYMBOL_OVERRIDES: Final = {
'Lblite': 'kite',
'Lblabs': 'kabs',
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,13 @@ def «_-Int_» (x0 x1 : SortInt) : Option SortInt := some (x0 - x1)
def «_*Int_» (x0 x1 : SortInt) : Option SortInt := some (x0 * x1)
def «_/Int_» (x0 x1 : SortInt) : Option SortInt :=
ite (x1 == 0) none (Int.tdiv x0 x1)
def _modInt_ (x0 : SortInt) (x1 : SortInt) : Option SortInt :=
def _modInt_ (x0 x1 : SortInt) : Option SortInt :=
ite (x1 == 0) none (Int.emod x0 x1)
def «_^%Int__» (x0 x1 x2 : SortInt) : Option SortInt :=
if x2 == 0 then none else
match x1 with -- TODO: Revisit this implementation
| .ofNat n => some (Int.emod (Int.pow x0 n) x2)
| _ => none
def «maxInt(_,_)_INT-COMMON_Int_Int_Int» (x0 x1 : SortInt) :=
some (ite (x0 < x1) x1 x0)
def «log2Int(_)_INT-COMMON_Int_Int» (x0 : SortInt) : Option SortInt :=
Expand Down