aboutsummaryrefslogtreecommitdiff
path: root/plugins/micromega/zify.ml
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2020-11-25 14:06:15 +0100
committerPierre-Marie Pédrot2020-11-25 14:06:15 +0100
commitbfd6a47d45f61055398dec4b98ae6515c067a343 (patch)
treeaf1dab2172e5faa415c310ea65448ad9e917d0d7 /plugins/micromega/zify.ml
parent075811dc6424d9c7663e7913b7d7d7735e9c2dac (diff)
parent0f0581b8d37168a54bd8b9f447317cc2cdd6c2d0 (diff)
Merge PR #13228: [micromega] Performance of lia
Reviewed-by: ppedrot Ack-by: vbgl
Diffstat (limited to 'plugins/micromega/zify.ml')
-rw-r--r--plugins/micromega/zify.ml22
1 files changed, 22 insertions, 0 deletions
diff --git a/plugins/micromega/zify.ml b/plugins/micromega/zify.ml
index 917961fdcd..d1403558ad 100644
--- a/plugins/micromega/zify.ml
+++ b/plugins/micromega/zify.ml
@@ -1070,6 +1070,28 @@ let pp_trans_expr env evd e res =
Feedback.msg_debug Pp.(str "\ntrans_expr " ++ pp_prf evd inj e.constr res);
res
+let declared_term env evd hd args =
+ let match_operator (t, d) =
+ let decomp t i =
+ let n = Array.length args in
+ let t' = EConstr.mkApp (hd, Array.sub args 0 (n - i)) in
+ if is_convertible env evd t' t then Some (t, Array.sub args (n - i) i)
+ else None
+ in
+ match t with
+ | OtherTerm t -> ( match d with InjTyp _ -> None | _ -> Some (t, args) )
+ | Application t -> (
+ match d with
+ | CstOp _ -> decomp t 0
+ | UnOp _ -> decomp t 1
+ | BinOp _ -> decomp t 2
+ | BinRel _ -> decomp t 2
+ | PropOp _ -> decomp t 2
+ | PropUnOp _ -> decomp t 1
+ | _ -> None )
+ in
+ find_option match_operator (HConstr.find_all hd !table)
+
let rec trans_expr env evd e =
let inj = e.inj in
let e = e.constr in