Support non-monotonic modifications in .olean files
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
Originally from module.cpp (RIP)
-
Persistent
set_option. We want to be able to store the option settings in .olean files.
The main issue is conflict between imported modules. That is, each imported module wants to
set a particular option with a different value. This can create counter-intuitive behavior.
Consider the following scenarioA.olean: sets optionfooto trueB.olean: imports A.oleanC.olean: sets optionfooto false- We create
D.leancontaining the following import clause:
The user may expect thatimport B C Afoois set to true sinceAis the last module to be imported,
but this is not the case.Bis imported first, thenA(which sets optionfooto true),
thenC(which sets optionfooto false), the last importAis skipped sinceAhas already
been imported, and we getfooset to false.
To address this issue we consider a persistent option import validator. The validator
signs an error if there are two direct imports which try to set the same option to different
values. For example, in the example above,BandCare conflicting, and an error would
be signed when trying to importC. Then, users would have to resolve the conflict by
creating an auxiliary import. For example, they could create the moduleC_aux.leancontainingimport C set_option persistent foo trueand replace
import B C Awithimport B C_aux A -
Removing attributes. The validation procedure for persistent options can be extended to attribute deletion. In the latest version, we can only locally remove attributes. The validator for attribute deletion would sign an error if there are two direct imports where one adds an attribute
[foo]to a declarationblaand the other removes it. -
Parametric attributes. This is not a missing feature, but a bug. In the current version, we have
parametric attributes and different modules may set the same declaration with different parameter values.
We can fix this bug by using an attribute validator which will check parametric attributes, or we can allow parametric attributes to be set only once. That is, we sign an error if the user tries to reset them.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue points to the former module.cpp entry point and to .olean import validation; start by locating the current code responsible for importing and validating .olean files. Done means defining and implementing conflict handling for persistent options, attribute removal, and parametric attributes, including the described conflicting-import cases.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100