Skip to content

Quantifier.getBody() again throws Cast Error in Java API (Issue #2460 is still not fixed) #7953

@ruijiefang

Description

@ruijiefang

TLDR: It seems like the fix in #2460 has been reverted, and the bug has resurfaced again.

Array values in the Z3 model sometimes show up as lambda terms, but in Z3 Java API, they get represented as a Quantifier instead --- but Quantifier.getBody is no longer guaranteed to be a BoolExpr. Thus, if I call Quantifier.getBody on a lambda term, sometimes Java throws a cast error, and there is no good way to overcome this. In particular, it seems like the fix in the above issue has been reverted in the commit 3bca1fb

From a user point of view, it would be great if lambda values in the Z3 model actually get represented as a z3.Lambda AST node in the Java API (or alternatively, not have Quantifier be a subclass of BoolExpr) --- but at a minimum, it would be good if Quantifier.getBody can be fixed again to not perform a forced cast.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions