Encode unknown generic type parameters with (declare-forall-sort)#93
Draft
coeff-aij wants to merge 12 commits into
Draft
Encode unknown generic type parameters with (declare-forall-sort)#93coeff-aij wants to merge 12 commits into
(declare-forall-sort)#93coeff-aij wants to merge 12 commits into
Conversation
coeff-aij
commented
May 24, 2026
| termcolor::ColorSpec::new() | ||
| } | ||
| } | ||
| pub type TypeParamIdx = chc::ForallSortIdx; |
Collaborator
Author
There was a problem hiding this comment.
It looks like ForallSortIdx could replace TypeParamIdx.
Should we unify them into ForallSortIdx, or keep both in ParamType?
coeff-aij
commented
May 24, 2026
Comment on lines
+1836
to
+1837
| pub forall_sorts: Vec<ForallSortIdx>, | ||
| pub num_forall_sort_idx: ForallSortIdx, |
Collaborator
Author
There was a problem hiding this comment.
forall_sorts is actually redundant because we know it only contains the range 0..num_forall_sort_idx.
This file contains hidden or 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
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.
This PR introduces an extension to SMT-LIB2 to encode unknown type parameters (like
Tinf<T: PartialOrd>()) as a universally quantified sort.For example, a universally quantified sort
a0is first declared using(declare-forall-sort a0)and then used everywhere like a normal sort.This feature lays the groundwork for the future verification of generic functions involving unknown types.
Example