Skip to content

Commit

Permalink
Merge pull request Deducteam#280 from Deducteam/francois@convertibili…
Browse files Browse the repository at this point in the history
…ty-optimisation

Kernel: Optimise conversion
  • Loading branch information
francoisthire authored Jun 16, 2022
2 parents 291d2fa + f9e6854 commit a704208
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kernel/reduction.ml
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,12 @@ module Make (C : ConvChecker) (M : Matching.Matcher) : S = struct
let rec are_convertible_lst sg : (term * term) list -> bool = function
| [] -> true
| (t1, t2) :: lst ->
(* Check physical equality first for optimisation. *)
are_convertible_lst sg
(if term_eq t1 t2 then lst
(if t1 == t2 then lst
(* This test can be less expensive than computing the `whnf` if the
two terms are equal. *)
else if term_eq t1 t2 then lst
else conversion_step sg (whnf sg t1, whnf sg t2) lst)

(* Convertibility Test *)
Expand Down

0 comments on commit a704208

Please sign in to comment.