Skip to content

Expose uses in TModels produced by Rascal typechecker#2803

Draft
sungshik wants to merge 2 commits into
mainfrom
fix2165
Draft

Expose uses in TModels produced by Rascal typechecker#2803
sungshik wants to merge 2 commits into
mainfrom
fix2165

Conversation

@sungshik

@sungshik sungshik commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46%. Comparing base (6cff72e) to head (e637cb7).

Additional details and impacted files
@@           Coverage Diff           @@
##              main   #2803   +/-   ##
=======================================
- Coverage       46%     46%   -1%     
- Complexity    6722    6725    +3     
=======================================
  Files          839     839           
  Lines        66766   66766           
  Branches      9983    9983           
=======================================
- Hits         30782   30774    -8     
- Misses       33601   33607    +6     
- Partials      2383    2385    +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sungshik sungshik changed the title Uses in TModels Expose uses in TModels produced by Rascal typechecker Jun 16, 2026
@PaulKlint

Copy link
Copy Markdown
Member

Hi @sungshik, the changes look good. But ... do we need this? And I admit that I should have spotted this earlier. In fact, uses is an "internal" field of the TModel, i.e. it used by the Solver but not exposed externally. There are two reasons for this:

  • uses can easily be derived from the useDef relation using domain(tm.useDef) for some tm.
  • it saves some space by not storing it.
    By the way, similar considerations apply to the fields calculators and requirements: for internal use only.

A cleaner solution would be to create two data types: TModel and ExtendedTModel, where TModel is the public interface and is a subset of ExtendedTModel . We need a discussion on this.

@sungshik sungshik marked this pull request as ready for review June 16, 2026 08:36
@sungshik

Copy link
Copy Markdown
Contributor Author

Thanks, Paul! Summary of the offline discussion (with also Davy, Toine, and Rodin):

  • TModel should be divided over two modules. Details: Divide TModel over two modules typepal#51.
  • Use values contain more information than just occurrence locations. As such they might be useful outside the Rascal typechecker to define language services.
  • However, we cannot think of any such language services right now (and we don't remember what exactly was the underlying reason for uses field of TModel does not contain use #2165). Therefore, at least for now, this PR won't be merged.

@DavyLandman

Copy link
Copy Markdown
Member

I want to add that one of the particular problems with the uses field (also true for the same field in Summary) is that it's only scoped to the current module. While most analysis & IDE features don't care for this constrained module-only-uses view.

We could only find use-cases for the uses field if you would merge the uses of all modules into a single relation/set.

@DavyLandman DavyLandman marked this pull request as draft June 17, 2026 06:18
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.

uses field of TModel does not contain use

3 participants