Hello SMTLIB list,
I wonder what would be the best practice for modeling in SMTLIB, and
efficiently solve, problems involving a function known to be injective.
That is something like
(declare-sort A B)
(declare-fun f (A) B)
(assert (forall ((x A) (y A)) (=> (= (f x) (f y)) (= x y)))
With a quick search on the web I found
https://rise4fun.com/Z3/tutorial/guide
where a trick is proposed to avoid a quadratic explosion of quantifier
instanciation, by introducing a converse function
(declare-fun g (B) A)
(assert (forall ((x A)) (= (g (f x)) x)))
I also found a paper about datatypes
https://www.ijcai.org/Proceedings/16/Papers/631.pdf
where the handling of injectivity of constructors is considered.
Generally speaking, it seems to me that an SMT solver could efficiently
handle injectivity if it was natively supported in its congruence
closure engine. Are there any theoretical studies about this?
implementations?
To be complete, my problem specifically concerns the modeling of finite
intervals of integers. Say if one wants to model the type of integers
between 17 and 42, one could write
(declare-sort I)
(declare-fun toint (I) Int)
(assert (forall ((x I)) (and (<= 17 (toint x)) (<= (toint y) 42)
but what would be the best way to express injectivity?
Thanks in advance for any advice
- Claude
--
Claude Marché | tel:
+33 1 69 15 66 08
INRIA Saclay - Île-de-France |
Université Paris-sud, Bat. 650 |
http://www.lri.fr/~marche/
F-91405 ORSAY Cedex |