-
Notifications
You must be signed in to change notification settings - Fork 76
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
Allow serialization and deserialization of Apron Analysis results for precision comparison #423
Comments
I'm doubtful about how fixable this really is because Apron defines custom OCaml runtime object types in C, where the (de)serialization functions must also be defined. And that for all Apron's data structures, probably including its own GMP and MPFR bindings. This would be an Apron fork... For just comparison it would be a lot simpler to export the constraints textually and implement their comparison in a separate program, a la |
In the Apron documentation some |
This might also be relevant, it allows for the serialization of an |
Serialization is implemented for some data structures: The functions you have linked are probably ones that need to be manually called, but that would be separate from OCaml's marshaling. |
But there's this There seem to be |
This Looking at the C-implementation of Abtract1, the deserialize also seems to be only a dummy implementation yieliding top. For Abstract0, there seems to be a more meaningful implementation. But this serialization and deserialization are not exposed in the OCaml API. @sim642 Would the serialization / deserialization of this Abstract0 already suffice for our purposes? If so, the best thing might be to ask the Apron maintainers why serilazation/deserialization is not exposed to the OCaml API. If there are bigger problems with it, we would have to think about some alternative way to compare these Apron domains, as suggested #423 (comment). |
This |
But doesn't marshalling work directly on If we're going to use a special-purpose (de)serialization for the comparison, then it shouldn't be too difficult to have custom logic for environments. If we want marshaling to work in entirety, it'd have to be implemented in C for environments (and then it should also be easy for |
I tested serialization of
But serializing octagons should suffice -- we would translate the intervals to octagons before serialization. |
Marshalling/Unmarshalling now also works for Now one would have to serialize all abstract values using this mechanism. One option would be to add a |
Adding new transfer function for everything just to have some Apron-specific marshaling is quite ugly. I think it'd be easier to add a hack into This would only do locals though. For globals it might be necessary to extract a part of the The other question is what will actually get compared: only box vs oct of a fixed privatization or also between privatizations? Because the latter would have different domains. I'm not sure if it's possible to do anything in |
If one were to create a hashmap |
That's true. The contexts, which might contain relations themselves, would be different and possibly incomparable anyway. |
I am working on creating a version of privPrecCompare that works for the Apron analysis, with as much code reuse of |
I'm not exactly sure anymore. I guess we just wanted it to be as independent from our internal structures as possible. I suppose it could happen that CIL does its transformations and creates auxiliary nodes that all correspond to the same statement in the program (e.g. ternary operator, short-circuiting logic). |
The serialization of results of the Apron analysis currently fails with execption:
Fatal error: exception Invalid_argument("output_value: abstract value (Custom)")
.This needs to be fixed
for the incremental analysis andfor comparing different runs with the Apron analysis.Edit: For now we only need to focus on allowing a comparison.
The text was updated successfully, but these errors were encountered: