Skip to content

Commit

Permalink
Merge PR #15294: Remove custom extraction of comparison to int in Ext…
Browse files Browse the repository at this point in the history
…rOCamlInt63

Reviewed-by: vbgl
Ack-by: proux01
Co-authored-by: herbelin <herbelin@users.noreply.github.com>
  • Loading branch information
coqbot-app[bot] and herbelin committed Dec 14, 2021
2 parents 5bf5e7b + 8531e96 commit 0af7ced
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions dev/ci/user-overlays/15294-Lysxia-extract-comparison.sh
@@ -0,0 +1 @@
overlay metacoq https://github.com/Lysxia/metacoq overlay-15294 15294
@@ -0,0 +1,6 @@
- **Changed:**
`ExtrOCamlInt63` no longer extracts `comparison` to `int` in OCaml;
the extraction of `Uint63.compare` and `Sint63.compare` was also adapted accordingly
(`#15294 <https://github.com/coq/coq/pull/15294>`_,
fixes `#15280 <https://github.com/coq/coq/issues/15280>`_,
by Li-yao Xia).
5 changes: 2 additions & 3 deletions theories/extraction/ExtrOCamlInt63.v
Expand Up @@ -16,7 +16,6 @@ From Coq Require Uint63 Sint63 Extraction.

Extract Inductive bool => bool [ true false ].
Extract Inductive prod => "( * )" [ "" ].
Extract Inductive comparison => int [ "0" "(-1)" "1" ].
Extract Inductive DoubleType.carry => "Uint63.carry" [ "Uint63.C0" "Uint63.C1" ].

(** Primitive types and operators. *)
Expand Down Expand Up @@ -56,8 +55,8 @@ Extract Constant Uint63.diveucl => "Uint63.diveucl".
Extract Constant Uint63.diveucl_21 => "Uint63.div21".
Extract Constant Uint63.addmuldiv => "Uint63.addmuldiv".

Extract Constant Uint63.compare => "Uint63.compare".
Extract Constant Sint63.compare => "Uint63.compares".
Extract Constant Uint63.compare => "(fun x y -> let c = Uint63.compare x y in if c = 0 then Eq else if c < 0 then Lt else Gt)".
Extract Constant Sint63.compare => "(fun x y -> let c = Uint63.compares x y in if c = 0 then Eq else if c < 0 then Lt else Gt)".

Extract Constant Uint63.head0 => "Uint63.head0".
Extract Constant Uint63.tail0 => "Uint63.tail0".

0 comments on commit 0af7ced

Please sign in to comment.