@@ -764,11 +764,17 @@ namespace smt {
764
764
765
765
Therefore:
766
766
767
- epsilon <= (n_y + n_c - n_x) / (k_x - k_y - k_c)
767
+ epsilon <= (n_y + n_c - n_x) / 2*(k_x - k_y - k_c)
768
+
769
+ Division by 2 is introduced to avoid introducing new equalities.
770
+ Consider when n_x = n_y = k_x = k_y = 0, n_c = 4, k_c = -1,
771
+ then n_c / -k_c = n_c, hence setting epsilon to n_c introduces a value
772
+ that is not smaller than the smallest integral difference.
768
773
*/
769
774
template <typename Ext>
770
775
void theory_dense_diff_logic<Ext>::compute_epsilon() {
771
776
m_epsilon = rational (1 , 2 );
777
+ TRACE (" ddl" , display (tout););
772
778
typename edges::const_iterator it = m_edges.begin ();
773
779
typename edges::const_iterator end = m_edges.end ();
774
780
// first edge is null
@@ -783,11 +789,15 @@ namespace smt {
783
789
rational k_y = m_assignment[e.m_source ].get_infinitesimal ().to_rational ();
784
790
rational n_c = e.m_offset .get_rational ().to_rational ();
785
791
rational k_c = e.m_offset .get_infinitesimal ().to_rational ();
786
- TRACE (" epsilon" , tout << " (n_x,k_x): " << n_x << " , " << k_x << " , (n_y,k_y): " << n_y << " , " << k_y << " , (n_c,k_c): " << n_c << " , " << k_c << " \n " ;);
792
+ TRACE (" ddl" ,
793
+ tout << e.m_source << " - " << e.m_target << " <= " << e.m_offset << " \n " ;
794
+ tout << " (n_x,k_x): " << n_x << " , " << k_x <<
795
+ " , (n_y,k_y): " << n_y << " , " << k_y <<
796
+ " , (n_c,k_c): " << n_c << " , " << k_c << " \n " ;);
787
797
if (n_x < n_y + n_c && k_x > k_y + k_c) {
788
- rational new_epsilon = (n_y + n_c - n_x) / (k_x - k_y - k_c);
798
+ rational new_epsilon = (n_y + n_c - n_x) / (2 *( k_x - k_y - k_c) );
789
799
if (new_epsilon < m_epsilon) {
790
- TRACE (" epsilon " , tout << " new epsilon: " << new_epsilon << " \n " ;);
800
+ TRACE (" ddl " , tout << " new epsilon: " << new_epsilon << " \n " ;);
791
801
m_epsilon = new_epsilon;
792
802
}
793
803
}
0 commit comments