Coq is a formal proof management system. It provides a formal language to write mathematical definitions, executable algorithms and theorems together with an environment for semi-interactive development of machine-checked proofs.
Require Ltac2.Ltac2.
Require Import Ltac2.Init Ltac2.Control Ltac2.Notations.
Goal (fun (x : nat) => let y := x in fun x : nat => y + x) = (fun x y : nat => x).
cbv beta iota zeta.
(*match goal with
| [ |- (fun a b => ?C) = _ ]
=> idtac a b
end.*)
let g := Control.goal () in
let matches := Pattern.matches pattern:((fun a b => _) = _) g in
(). (* success *)
let g := Control.goal () in
let matches := Pattern.matches pattern:((fun a b => ?C) = _) g in
(). (* failure *)