Skip to content

Conversation

@Tragicus
Copy link
Contributor

@Tragicus Tragicus commented Mar 19, 2024

Adds a few utility functions in engine/evd.ml (a few accessors) and pretyping/structures.ml (a way to obtain the position of a projection in a structure and a printer for canonical solutions).

Fixes / closes #????

  • [ ] Added changelog.

@Tragicus Tragicus requested review from a team as code owners March 19, 2024 10:01
@coqbot-app coqbot-app bot added the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label Mar 19, 2024

let projection_number env cst =
let s = find_from_projection cst in
CList.index (Option.equal (Environ.QConstant.equal env)) (Some cst) (List.map (fun x -> x.proj_body) s.projections) - 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
CList.index (Option.equal (Environ.QConstant.equal env)) (Some cst) (List.map (fun x -> x.proj_body) s.projections) - 1
CList.index0 (Option.equal (Environ.QConstant.equal env)) (Some cst)
(List.map (fun x -> x.proj_body) s.projections)

Comment on lines 57 to 58
(** [projection_number env p] returns the position of the projection p in
the structure it corresponds to. *)
Copy link
Contributor

Choose a reason for hiding this comment

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

It should not be necessary to write it down, but in this context I would add that we count from 0.

@SkySkimmer SkySkimmer changed the title Some utilities APIs for elpi stuff May 23, 2024
@SkySkimmer SkySkimmer self-assigned this May 23, 2024
@SkySkimmer SkySkimmer added kind: internal API, ML documentation... and removed needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. labels May 23, 2024
@SkySkimmer SkySkimmer added this to the 8.20+rc1 milestone May 23, 2024
@SkySkimmer
Copy link
Contributor

@coqbot merge now

@coqbot-app coqbot-app bot merged commit cbea2e0 into rocq-prover:master May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind: internal API, ML documentation...

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants