Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print information about the origin of constraints in Print Universes #8460

Closed
wants to merge 3 commits into from

Conversation

SkySkimmer
Copy link
Contributor

Current limitations:

  • constraints not associated with a constant or inductive have no origin
  • the information is only about constraints in currently-open modules, so it's lost after module End and when loading files
  • equality constraints have no origin (I didn't want to figure out how to deal with collapsing a cycle)
  • constraints foo <(=) Set from declaring a universe have no origin (probably easily could be made to have one)

I think removing these limitations (especially the second one) won't require rewriting these patches so it's worth submitting now.

Here's how it looks after the Logic_lemmas section in Init/Logic.v:

Top.14 <= Top.9 (from eq_rect_r)
Top.13 <= Top.10 (from eq_rect_r)
       <= Top.8 (from eq_rect_r)
Top.12 <= Top.10 (from eq_rec_r)
       <= Top.8 (from eq_rec_r)
Top.11 <= Top.10 (from eq_ind_r)
       <= Top.8 (from eq_ind_r)
Top.10 <= Top.8 (from eq_sym)
Top.7 <= Top.6 (from inst)
Set < Top.14
    < Top.13
    < Top.12
    < Top.11
    < Top.10
    < Top.9
    < Top.8
    < Top.7
    < Top.6
    < Top.5
    < Top.4
    < Top.3
    < Top.2
    < Top.1
Prop < Set

@SkySkimmer SkySkimmer added kind: feature New user-facing feature request or implementation. needs: documentation Documentation was not added or updated. kind: user messages Improvement of error messages, new warnings, etc. part: universes The universe system. needs: benchmarking Performance testing is required. labels Sep 11, 2018
@SkySkimmer SkySkimmer added this to the 8.9+beta1 milestone Sep 11, 2018
@SkySkimmer
Copy link
Contributor Author

IIRC @JasonGross was interested in some such feature.

Copy link
Member

@ppedrot ppedrot left a comment

Choose a reason for hiding this comment

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

I don't think that this should go in the kernel. I am struggling to get rid of monomorphic constraints registered in definitions, because they're completely broken (e.g. side-effects). Instead, this should be registered in some upper layers like declare.

@SkySkimmer
Copy link
Contributor Author

I don't see how to make that work though.

@ppedrot
Copy link
Member

ppedrot commented Sep 11, 2018

Good question. I don't really know how to explain the semantics of your proposal though, IIUC it only attaches to edges, and this information is not preserved by transitivity (you drop the eq constraints), so I am slightly wary.

@ppedrot
Copy link
Member

ppedrot commented Sep 11, 2018

Also, we should strive for efficiency of the universe graph structure. It is not uncommon to have hundreds of thousands of universes in there, so every allocation is going to be critical. We should not make our users pay for data that is only for debugging purposes.

@JasonGross
Copy link
Member

Nice!
Perhaps relatedly: I'd also like to see where the universe itself came from. That is, I'd like to be able to get an answer to the query "Given a global universe u, what is the list of definitions which have Type@{u} somewhere in their type or in their body (or list of constructor types, for (co)inductives), and which also do not transitively depend on any other definition in this list (except for (co)inductives and their constructors, which are allowed to depend on each other)?" Should I open a separate feature request for this?

@JasonGross
Copy link
Member

I don't really know how to explain the semantics of your proposal though

@ppedrot Here are some semantics (which might or might not line up with this proposal) which would already be quite useful, even if not complete: The definition associated to a constraint i < j is a definition d such that, if Reset worked across module boundaries, and if all of the dependencies of the current file were inlined, then after Reset d the constraint i < j would no longer appear, and also there is no Reset command that keeps d but removes the constraint i < j.

@maximedenes maximedenes removed their request for review September 13, 2018 16:04
@SkySkimmer
Copy link
Contributor Author

I'm going to drop this for now.

@SkySkimmer SkySkimmer closed this Oct 9, 2018
@SkySkimmer SkySkimmer deleted the ugraph-origin branch October 9, 2018 11:44
@coqbot coqbot removed this from the 8.9+beta1 milestone Oct 9, 2018
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. kind: user messages Improvement of error messages, new warnings, etc. needs: benchmarking Performance testing is required. needs: documentation Documentation was not added or updated. part: universes The universe system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants