Skip to content

Add some ops missing from aslp generator - #237

Open
agle wants to merge 7 commits into
mainfrom
aslp-missing-ops
Open

Add some ops missing from aslp generator#237
agle wants to merge 7 commits into
mainfrom
aslp-missing-ops

Conversation

@agle

@agle agle commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator
  • cvt_bool_bv
  • replicate_bits
  • fix missing cases of \NEQ` in Ops.ml
  • try not emit assert(or())

@katrinafyi katrinafyi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM modulo comments. Thanks :)

Comment thread lib/transforms/aslp/bincaml_ibi_make.ml Outdated
let f_gen_replicate_bits : bigint -> bigint -> expr -> expr -> expr =
fun _ -> failwith "f_gen_replicate_bits"
fun targ0 targ1 opr nr ->
try_const_unsigned_value nr |> Z.to_int |> fun repeats ->

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should be no need for try_const_unsigned_value; it should be in targ1 which should be a bigint equal to nr's value.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Are you sure its not just the bitwidth of the result?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reasonably. Did you find it to not be the case?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No but I can't tell from this example

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

k

Comment on lines +34 to +36
|> function
| [] -> Expr.BasilExpr.boolconst true
| args -> Expr.BasilExpr.applyintrin ~op:`OR args

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did this cause a problem somewhere downstream? Generally, it would be nice to handle 0-ary associative operations sensibly.

@agle agle Aug 14, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Generally I just give them semantics, SMTLib and boogie don't like it tho so the expr simplifier converts them to unit. Replacing them in the constructor would be unexpected I think.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If it is to be replaced in this one place, you could imagine that it would also need similar replacements in other random places. Regardless of how it's done, it would be nice to centralise this somewhere to avoid needing ad-hoc patches. But not necessarily in this PR, sure.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It is centralised in Expr_simp :)

@agle
agle force-pushed the aslp-missing-ops branch from 24d236c to a41c370 Compare August 14, 2026 09:30
@agle
agle force-pushed the aslp-missing-ops branch from a823b06 to 8382e2b Compare August 14, 2026 09:44
@agle
agle enabled auto-merge (squash) August 14, 2026 09:45
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.

2 participants