-
Notifications
You must be signed in to change notification settings - Fork 38
[determinacy] static analysis #290
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
Draft
FissoreD
wants to merge
215
commits into
LPCIC:master
Choose a base branch
from
FissoreD:scoped-term-wip
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+6,935
−3,348
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6cf6c26
to
597abd9
Compare
gares
reviewed
Nov 28, 2024
please run |
gares
reviewed
Nov 28, 2024
overall looks good |
75009b3
to
c2e5dae
Compare
4dbd943
to
9ffb686
Compare
6630341
to
259241a
Compare
ccb0db7
to
bdb45a7
Compare
6ff57dc
to
fd972ab
Compare
…ue_type_id - AST has no modes - in the old representation the predicate `type p int -> prop.` did not produce a mode for p. - therefore, Structured.program has no more a modes field - we delegate the computation of modes to Scoped_Quotation_Macro.run - flatten_arrows - objects with type `TArr (l, r)` where `r` has Prop as rightmost type, is transformed into `TPred (...)` by flatten_arrows. - the result of this call to flatten_arrows is used next to build modes and determinacy relations of predicates - IdPos.t - IdPos is a new module representing unique identifiers for elpi objects. - using integers is not possible due to the potential fusion of different units - therefore we use the position of a parsed terms as its id - unique ids are used by the typechecker which sets a unique id to the type of global constants - type of bound variables - the type of bound variables is attached to the lam node by the typechecker - determinacy checker - input arguments functionality setting - body premise inference and check
…` in the head of clauses
spilling is performend in Check.check this allows determinacy check to be performed on spilled terms
It is not known a priori the functionality of a fresh unification variable, for example: the variable `X` in `t1 :- pi x\ u (y\ X x y), std.assert! (X 1 2 = 2) "bug".` cannot be deduced from `u` without typechecking. We reuse the type assignment given by the typechecker to the term `X x y` to deduce the functionality of `X` New: - typeassignment translation to functionality - get_functionality_of_term instead returning none if a variable is not in the env, returns the conversion of its type assignment to functionality -
- add get_name api to MutableOnce module - check if Uvar is set before calling get - if the Uvar is unset return a Functionality.BoundVar
gares
reviewed
Apr 15, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TODO:
NOTE: in the current parser, we already have a special case when a function has no output.
In this case the arrow in the type signature is optional
,
)Ok, but in infer_fold for constants other than comma, we could stop if the call
is_wrong
, in commawe should continue since the cut could make the predicate again deterministic
A similar example below:
t = (Spill({ty;it},_)
thenty
is wrong, butit.ty
is ok{{fun x => f (H x)}}
and{{fun y => g (G y)}}
are both replaced with a uvar combined with a constraint relating the uvar with the original term. Wrt overlapping check, this will cause a compilation error of the DB...For example,
X = f rel, X => f Y, Y
withfunc f -> func