-
Notifications
You must be signed in to change notification settings - Fork 33
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
Complete model #1019
Merged
Merged
Complete model #1019
Commits on Jan 17, 2024
-
Configuration menu - View commit details
-
Copy full SHA for b29a119 - Browse repository at this point
Copy the full SHA b29a119View commit details -
This PR fixes the issue OCamlPro#778. The suggested solution by this PR is as follows: - Collect user-declared symbols in `D_cnf`; - As the function `make` of the module `D_cnf` returns a list of commands, we add a new command `Decl` in `Frontend` to declare symbols; - The declared symbols are given to the SAT solver through a new function `declaration` in `sat_solver_sig`. - These symbols are collected in vectors and we keep indexes in another PR in order to manage properly the push/pop mechanism. - Finally the declared symbols are given to `Uf` and we create the empty model with them. Another annoying point comes from the current datastructure used in `ModelMap`. The type of `ModelMap` saves model values in the form of graphs. A graph is a finite set of constraints but there is no appropriate representation for the graph without constraints. Let's imagine we have the input: ```smt2 (set-option :produce-models true) (set-logic ALL) (declare-fun (Int) Int) (check-sat) (get-model) ``` We expect an output as follows: ```smt2 ( (define-fun f (_x Int) (@A as Int)) ) ``` But `Graph.empty` cannot hold the abstract value `@a`. A naive solution consists in using an ADT: ```ocaml type graph = | Empty of Id.typed | G of Graph.t ``` But we'll add an extra indirection. Probably the best solution would be to use a custom datastructure instead of a map to store the constraints. In this PR, we detect in `ModelMap.add` if the only constraint in the graph is of the form `something -> abstract value`. In this case we remove this constraint. This solution isn't perfect as explained in issue OCamlPro#1018. The biggest drawback of this solution is the fact we have to declare symbols in the SAT API, otherwise models returned by `get_model` could be incomplete.
Configuration menu - View commit details
-
Copy full SHA for 959bf7b - Browse repository at this point
Copy the full SHA 959bf7bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8a556a4 - Browse repository at this point
Copy the full SHA 8a556a4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3e2d501 - Browse repository at this point
Copy the full SHA 3e2d501View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6e499aa - Browse repository at this point
Copy the full SHA 6e499aaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 02208a1 - Browse repository at this point
Copy the full SHA 02208a1View commit details -
Configuration menu - View commit details
-
Copy full SHA for e07bfa0 - Browse repository at this point
Copy the full SHA e07bfa0View commit details -
Configuration menu - View commit details
-
Copy full SHA for b073017 - Browse repository at this point
Copy the full SHA b073017View commit details -
Configuration menu - View commit details
-
Copy full SHA for ad415e5 - Browse repository at this point
Copy the full SHA ad415e5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 14e729d - Browse repository at this point
Copy the full SHA 14e729dView commit details -
Configuration menu - View commit details
-
Copy full SHA for c65d8f2 - Browse repository at this point
Copy the full SHA c65d8f2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 359ac56 - Browse repository at this point
Copy the full SHA 359ac56View commit details -
Configuration menu - View commit details
-
Copy full SHA for 98899b9 - Browse repository at this point
Copy the full SHA 98899b9View commit details
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.