Skip to content

Add DependGraph TypeOnly flag for type-only dependency collection #176

Draft
JasonGross wants to merge 4 commits into
rocq-community:coq-masterfrom
JasonGross:typeonly-option
Draft

Add DependGraph TypeOnly flag for type-only dependency collection #176
JasonGross wants to merge 4 commits into
rocq-community:coq-masterfrom
JasonGross:typeonly-option

Conversation

@JasonGross

Copy link
Copy Markdown
Member

When set, only the type of constants (never the body, even for transparent definitions) and only the arity of inductives (not
constructor types) are used for dependency collection.

On top of #173 to avoid merge conflicts

When a module is constrained by a module type using `:`, the constant
bodies appear as Undef in the global environment but still exist in
the module structure. This caused dpdgraph to incorrectly report
body=no for such constants.

Following the approach used by Print Assumptions in vernac/assumptions.ml,
implement a ModLookup module that traverses the module structure to find
the actual constant body when the environment lookup returns Undef.

This ensures that module-type-locked constants like:
  Module Foo : FooT. Definition T := O. End Foo.
correctly report body=yes instead of body=no.

We need to add fallback behaviors for doing anything with names that
might not be in the nametab.

Add test cases to verify the behavior.
When set, only the type of constants (never the body, even for
transparent definitions) and only the arity of inductives (not
constructor types) are used for dependency collection. This enables
a three-way split: proofs.dpd (full), statements_body.dpd (no opaque
bodies), and statements_type.dpd (types/arities only).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants