Skip to content

Ltac2 local env APIs#21654

Open
SkySkimmer wants to merge 8 commits into
rocq-prover:masterfrom
SkySkimmer:ltac2-ctx
Open

Ltac2 local env APIs#21654
SkySkimmer wants to merge 8 commits into
rocq-prover:masterfrom
SkySkimmer:ltac2-ctx

Conversation

@SkySkimmer

Copy link
Copy Markdown
Contributor

Return of #20206, now with unsafe APIs marked unsafe

@SkySkimmer SkySkimmer requested review from a team as code owners February 18, 2026 15:17
@SkySkimmer SkySkimmer added the request: full CI Use this label when you want your next push to trigger a full CI. label Feb 18, 2026
@coqbot-app coqbot-app Bot removed the request: full CI Use this label when you want your next push to trigger a full CI. label Feb 18, 2026
@SkySkimmer SkySkimmer added kind: feature New user-facing feature request or implementation. part: ltac2 Issues and PRs related to the (in development) Ltac2 tactic langauge. labels Feb 18, 2026
@SkySkimmer SkySkimmer added this to the 9.3+rc1 milestone Feb 18, 2026
@SkySkimmer SkySkimmer added needs: changelog entry This should be documented in doc/changelog. request: full CI Use this label when you want your next push to trigger a full CI. and removed needs: changelog entry This should be documented in doc/changelog. labels Feb 18, 2026
@SkySkimmer SkySkimmer requested a review from a team as a code owner February 20, 2026 14:42
@coqbot-app coqbot-app Bot removed the request: full CI Use this label when you want your next push to trigger a full CI. label Feb 20, 2026
@SkySkimmer SkySkimmer added the request: full CI Use this label when you want your next push to trigger a full CI. label Feb 20, 2026
@coqbot-app coqbot-app Bot removed the request: full CI Use this label when you want your next push to trigger a full CI. label Feb 20, 2026
@github-actions github-actions Bot added the needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. label Feb 24, 2026
@SkySkimmer SkySkimmer added the request: full CI Use this label when you want your next push to trigger a full CI. label Feb 24, 2026
@coqbot-app coqbot-app Bot removed request: full CI Use this label when you want your next push to trigger a full CI. needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. labels Feb 24, 2026
@ppedrot ppedrot self-assigned this Feb 25, 2026
@cpitclaudel

Copy link
Copy Markdown
Contributor

Should these new APIs be documented in the Ltac2 chapter or are they too internal?

@thomas-lamiaux

Copy link
Copy Markdown
Contributor

@cpitclaudel to me its part of the corelib for Ltac2, it does not need any further documentation. One can write a tutorial or how-to for Platform Docs, if the they want to discuss how to use them

@github-actions github-actions Bot added the needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. label Mar 18, 2026
@SkySkimmer SkySkimmer force-pushed the ltac2-ctx branch 2 times, most recently from f071bf4 to fe3a440 Compare March 18, 2026 13:27
@coqbot-app coqbot-app Bot added needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. and removed needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. labels Mar 18, 2026
@SkySkimmer SkySkimmer added the request: full CI Use this label when you want your next push to trigger a full CI. label Mar 24, 2026
@coqbot-app coqbot-app Bot removed request: full CI Use this label when you want your next push to trigger a full CI. needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. labels Mar 24, 2026
@SkySkimmer

Copy link
Copy Markdown
Contributor Author

changed to use result instead of backtracking exceptions

@github-actions github-actions Bot added the needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. label Mar 27, 2026
@coqbot-app coqbot-app Bot added needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. and removed needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. labels Mar 27, 2026
Comment thread theories/Ltac2/Std.v
Comment on lines +402 to +403
Ltac2 @external eval_in_env : env -> Std.Red.t -> constr -> constr
:= "rocq-runtime.plugins.ltac2" "reduce_constr_in_env".

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we route Ltac2 eval through this function?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are you calling Ltac2 eval?

Comment thread theories/Ltac2/Sort.v
Ltac2 Type t := sort.

(** [sort_of_product s s'] is [s''] such that if [A : s] and [B : s'] then [A -> B : s'']. *)
Ltac2 @external sort_of_product : t -> t -> t

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure we want Sort.sort_of_product rather than Sort.of_product?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDK

Comment thread theories/Ltac2/Message.v

Module UnsafeEnv.
(** Print the given term in the given environment (does not print the environment). *)
Ltac2 @external message_of_constr_in_env : env -> constr -> message

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should presumably be of_constr_in_env to match with all of the other names here. And plausibly we should route of_constr through this function

Comment thread theories/Ltac2/Constr.v
Comment on lines +43 to +46
(** Early declaration, see [Relevance.UnsafeEnv]. *)
Local Ltac2 @external relevance_of_type_in_env : env -> constr -> relevance
:= "rocq-runtime.plugins.ltac2" "relevance_of_type_in_env".

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we just move Module Relevance up and do Ltac2 Type relevance := Relevance.t instead of the other way around

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have Ltac2 Import Type so we could use that to avoid breaking references to Binder.Relevant
not sure I want to do it in this PR

Comment thread theories/Ltac2/Judge.v Outdated
Co-authored-by: Jason Gross <jasongross9@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind: feature New user-facing feature request or implementation. needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. part: ltac2 Issues and PRs related to the (in development) Ltac2 tactic langauge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants