DECLARE PLUGIN "coq-relation-algebra.fold"

{
  open Ltac_plugin
  open Stdarg
  open Fold
}

(* tactic grammar entries *)
TACTIC EXTEND ra_fold
  | [ "ra_fold" constr(ops) ] -> { ra_fold_concl ops None }
  | [ "ra_fold" constr(ops) constr(ob)] -> { ra_fold_concl ops (Some ob) }
  | [ "ra_fold" constr(ops) "in" var_list(l)] -> { ra_fold_hyps ops None l }
  | [ "ra_fold" constr(ops) constr(ob) "in" var_list(l)] -> { ra_fold_hyps ops (Some ob) l }
END

TACTIC EXTEND ra_fold_in_star
  | [ "ra_fold" constr(ops) "in" "*"] -> { ra_fold_all ops None }
  | [ "ra_fold" constr(ops) constr(ob) "in" "*"] -> { ra_fold_all ops (Some ob) }
END
