Skip to content
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

Safety checker: avoid list concatenation #669

Merged
merged 1 commit into from
Dec 21, 2023
Merged

Safety checker: avoid list concatenation #669

merged 1 commit into from
Dec 21, 2023

Conversation

vbgl
Copy link
Member

@vbgl vbgl commented Dec 19, 2023

The standard @ has known issues

@vbgl vbgl marked this pull request as ready for review December 20, 2023 05:01
Copy link
Contributor

@bgregoir bgregoir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are sure, the order in the list is not important it is ok.

let thrs_v v =
List.map (fun inv ->
let thrs_v v tl =
List.fold_left (fun acc inv ->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be fold_right ?

List.map (fun v -> thresholds_uint env (avar_of_mvar v)) vars
|> List.flatten in
let thrs_vars tl =
List.fold_left (fun acc v -> thresholds_uint env (avar_of_mvar v) acc) tl vars
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is a set it is ok

@vbgl vbgl merged commit 4a70f8b into main Dec 21, 2023
1 check passed
@vbgl vbgl deleted the safety-concat branch December 21, 2023 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants