alt-ergo
alt-ergo copied to clipboard
Replace fresh terms by abstract values in all subterms
This PR fixes the issue #1270. More precisely,
- Add a new argument to the function
X.to_model_term. The purpose ofto_model_termis to generate a model term from constant semantic values. Unfortunately, these model terms are not exactly the model values of the SMT-LIB standard because they can contain fresh terms. The new argument ofX.to_model_termis a function of typeE.t -> E.tthat is used to create abstract values from fresh terms. A cache is hidden in the closure of this function to prevent from duplicating abstract values for the same fresh terms. - Improve and update some comments.
- Remove the
term_valuesfield inModels. This field was only used to cache the result ofmodel_repr_of_terminUf. I replaced it by a local cache in the closure ofextract_concrete_model.
Now the output of the example of #1270 is:
unknown
(
(define-fun q ((arg_0 t)) Int
(ite (= arg_0 (as @a2 t)) 1 (ite (= arg_0 (as @a4 t)) 0 (- 1))))
(define-fun o ((arg_0 Int)) t
(ite (= arg_0 1) (as @a3 t) (ite (= arg_0 0) (as @a5 t) (as @a7 t))))
)