From 499ed5d8445607c03c4bd11e5cba27a91dfec578 Mon Sep 17 00:00:00 2001
From: Nuno Lopes <nuno.lopes@tecnico.ulisboa.pt>
Date: Mon, 23 Sep 2024 12:57:54 +0100
Subject: [PATCH] remove unneeded iterator functions

---
 src/ast/euf/euf_ac_plugin.h        |  3 +--
 src/ast/euf/euf_enode.h            |  6 ++----
 src/ast/for_each_expr.cpp          | 24 ++++++++----------------
 src/ast/for_each_expr.h            |  2 --
 src/math/dd/dd_pdd.h               |  4 +---
 src/math/hilbert/heap_trie.h       |  1 -
 src/math/hilbert/hilbert_basis.cpp |  2 --
 src/math/hilbert/hilbert_basis.h   |  1 -
 src/math/lp/emonics.h              |  7 ++-----
 src/math/lp/explanation.h          |  5 ++---
 src/math/lp/factorization.cpp      | 12 +++++-------
 src/math/lp/factorization.h        |  3 +--
 src/math/lp/lar_constraints.h      |  2 --
 src/math/lp/lar_term.h             |  3 +--
 src/math/lp/var_eqs.h              |  1 -
 src/math/simplex/bit_matrix.h      |  2 --
 src/math/simplex/sparse_matrix.h   |  2 --
 src/muz/rel/dl_table.cpp           |  2 +-
 src/qe/qe.h                        |  1 -
 src/sat/dimacs.h                   |  1 -
 src/sat/sat_clause.h               |  1 -
 src/sat/smt/pb_constraint.h        |  1 -
 src/smt/smt_enode.h                |  3 +--
 src/util/approx_set.h              |  4 ----
 src/util/bit_vector.h              |  1 -
 src/util/chashtable.h              |  1 -
 src/util/distribution.h            |  1 -
 src/util/dlist.h                   |  7 +------
 src/util/list.h                    |  1 -
 src/util/scoped_vector.h           |  3 +--
 src/util/uint_set.h                |  1 -
 src/util/vector.h                  |  6 ------
 32 files changed, 27 insertions(+), 87 deletions(-)

diff --git a/src/ast/euf/euf_ac_plugin.h b/src/ast/euf/euf_ac_plugin.h
index 2963c1f8b..d55d7dbb4 100644
--- a/src/ast/euf/euf_ac_plugin.h
+++ b/src/ast/euf/euf_ac_plugin.h
@@ -61,8 +61,7 @@ namespace euf {
                 node* operator*() { return m_first; }
                 iterator& operator++() { if (!m_last) m_last = m_first; m_first = m_first->next; return *this; }
                 iterator operator++(int) { iterator tmp = *this; ++*this; return tmp; }
-                bool operator==(iterator const& other) const { return m_last == other.m_last && m_first == other.m_first; }
-                bool operator!=(iterator const& other) const { return !(*this == other); }
+                bool operator!=(iterator const& other) const { return m_last != other.m_last || m_first != other.m_first; }
             };
             equiv(node& _n) :n(_n) {}
             equiv(node* _n) :n(*_n) {}
diff --git a/src/ast/euf/euf_enode.h b/src/ast/euf/euf_enode.h
index 50a7ce479..af22a5b2c 100644
--- a/src/ast/euf/euf_enode.h
+++ b/src/ast/euf/euf_enode.h
@@ -280,8 +280,7 @@ namespace euf {
             enode* operator*() { return m_first; }
             iterator& operator++() { if (!m_last) m_last = m_first; m_first = m_first->m_next; return *this; }
             iterator operator++(int) { iterator tmp = *this; ++*this; return tmp; }
-            bool operator==(iterator const& other) const { return m_last == other.m_last && m_first == other.m_first; }
-            bool operator!=(iterator const& other) const { return !(*this == other); }            
+            bool operator!=(iterator const& other) const { return m_last != other.m_last || m_first != other.m_first; }            
         };
         enode_class(enode & _n):n(_n) {}
         enode_class(enode * _n):n(*_n) {}
@@ -300,8 +299,7 @@ namespace euf {
             th_var_list const& operator*() { return *m_th_vars; }
             iterator& operator++() { m_th_vars = m_th_vars->get_next(); return *this; }
             iterator operator++(int) { iterator tmp = *this; ++* this; return tmp; }
-            bool operator==(iterator const& other) const { return m_th_vars == other.m_th_vars; }
-            bool operator!=(iterator const& other) const { return !(*this == other); }
+            bool operator!=(iterator const& other) const { return m_th_vars != other.m_th_vars; }
         };
         enode_th_vars(enode& _n) :n(_n) {}
         enode_th_vars(enode* _n) :n(*_n) {}
diff --git a/src/ast/for_each_expr.cpp b/src/ast/for_each_expr.cpp
index 8feb217db..ebad5760c 100644
--- a/src/ast/for_each_expr.cpp
+++ b/src/ast/for_each_expr.cpp
@@ -146,20 +146,16 @@ subterms::iterator& subterms::iterator::operator++() {
     return *this;
 }
 
-bool subterms::iterator::operator==(iterator const& other) const {
+bool subterms::iterator::operator!=(iterator const& other) const {
     // ignore state of visited
     if (other.m_esp->size() != m_esp->size()) {
-        return false;
+        return true;
     }
     for (unsigned i = m_esp->size(); i-- > 0; ) {
         if (m_esp->get(i) != other.m_esp->get(i))
-            return false;
+            return true;
     }
-    return true;
-}
-
-bool subterms::iterator::operator!=(iterator const& other) const {
-    return !(*this == other);
+    return false;
 }
 
 
@@ -216,18 +212,14 @@ subterms_postorder::iterator& subterms_postorder::iterator::operator++() {
     return *this;
 }
 
-bool subterms_postorder::iterator::operator==(iterator const& other) const {
+bool subterms_postorder::iterator::operator!=(iterator const& other) const {
     // ignore state of visited
     if (other.m_es.size() != m_es.size()) {
-        return false;
+        return true;
     }
     for (unsigned i = m_es.size(); i-- > 0; ) {
         if (m_es.get(i) != other.m_es.get(i))
-            return false;
+            return true;
     }
-    return true;
-}
-
-bool subterms_postorder::iterator::operator!=(iterator const& other) const {
-    return !(*this == other);
+    return false;
 }
diff --git a/src/ast/for_each_expr.h b/src/ast/for_each_expr.h
index 77b01e939..97a171755 100644
--- a/src/ast/for_each_expr.h
+++ b/src/ast/for_each_expr.h
@@ -190,7 +190,6 @@ public:
         expr* operator*();
         iterator operator++(int);
         iterator& operator++();
-        bool operator==(iterator const& other) const;
         bool operator!=(iterator const& other) const;
     };
 
@@ -220,7 +219,6 @@ public:
         expr* operator*();
         iterator operator++(int);
         iterator& operator++();
-        bool operator==(iterator const& other) const;
         bool operator!=(iterator const& other) const;
     };
     static subterms_postorder all(expr_ref_vector const& es) { return subterms_postorder(es, true); }
diff --git a/src/math/dd/dd_pdd.h b/src/math/dd/dd_pdd.h
index fa545c06e..4fe208429 100644
--- a/src/math/dd/dd_pdd.h
+++ b/src/math/dd/dd_pdd.h
@@ -571,8 +571,7 @@ namespace dd {
         pdd_monomial const* operator->() const { return &m_mono; }
         pdd_iterator& operator++() { next(); return *this; }
         pdd_iterator operator++(int) { auto tmp = *this; next(); return tmp; }
-        bool operator==(pdd_iterator const& other) const { return m_nodes == other.m_nodes; }
-        bool operator!=(pdd_iterator const& other) const { return !operator==(other); }
+        bool operator!=(pdd_iterator const& other) const { return m_nodes != other.m_nodes; }
     };
 
     class pdd_linear_iterator {
@@ -591,7 +590,6 @@ namespace dd {
         pointer operator->() const { return &m_mono; }
         pdd_linear_iterator& operator++() { next(); return *this; }
         pdd_linear_iterator operator++(int) { auto tmp = *this; next(); return tmp; }
-        bool operator==(pdd_linear_iterator const& other) const { return m_next == other.m_next; }
         bool operator!=(pdd_linear_iterator const& other) const { return m_next != other.m_next; }
     };
 
diff --git a/src/math/hilbert/heap_trie.h b/src/math/hilbert/heap_trie.h
index b492fb7ee..3feb68ba6 100644
--- a/src/math/hilbert/heap_trie.h
+++ b/src/math/hilbert/heap_trie.h
@@ -369,7 +369,6 @@ public:
         }
         iterator& operator++() { fwd(); return *this; }
         iterator operator++(int) { iterator tmp = *this; ++*this; return tmp; }
-        bool operator==(iterator const& it) const {return m_count == it.m_count; }
         bool operator!=(iterator const& it) const {return m_count != it.m_count; }
 
     private:
diff --git a/src/math/hilbert/hilbert_basis.cpp b/src/math/hilbert/hilbert_basis.cpp
index 586027103..308adf54f 100644
--- a/src/math/hilbert/hilbert_basis.cpp
+++ b/src/math/hilbert/hilbert_basis.cpp
@@ -455,7 +455,6 @@ public:
         offset_t operator*() const { return p.m_passive[m_idx]; }
         iterator& operator++() { ++m_idx; fwd(); return *this; }
         iterator operator++(int) { iterator tmp = *this; ++*this; return tmp; }
-        bool operator==(iterator const& it) const {return m_idx == it.m_idx; }
         bool operator!=(iterator const& it) const {return m_idx != it.m_idx; }
     };
 
@@ -614,7 +613,6 @@ public:
         offset_t sos() const { return (p.hb.vec(pas()).weight().is_pos()?p.m_neg_sos:p.m_pos_sos)[p.m_psos[m_idx]]; }
         iterator& operator++() { ++m_idx; fwd(); return *this; }
         iterator operator++(int) { iterator tmp = *this; ++*this; return tmp; }
-        bool operator==(iterator const& it) const {return m_idx == it.m_idx; }
         bool operator!=(iterator const& it) const {return m_idx != it.m_idx; }
     };
 
diff --git a/src/math/hilbert/hilbert_basis.h b/src/math/hilbert/hilbert_basis.h
index 1bd87d60c..f743f32ca 100644
--- a/src/math/hilbert/hilbert_basis.h
+++ b/src/math/hilbert/hilbert_basis.h
@@ -115,7 +115,6 @@ class hilbert_basis {
         offset_t operator*() const { return hb.m_basis[m_idx]; }
         iterator& operator++() { ++m_idx; return *this; }
         iterator operator++(int) { iterator tmp = *this; ++*this; return tmp; }
-        bool operator==(iterator const& it) const {return m_idx == it.m_idx; }
         bool operator!=(iterator const& it) const {return m_idx != it.m_idx; }
     };
 
diff --git a/src/math/lp/emonics.h b/src/math/lp/emonics.h
index 55086515d..f6326c044 100644
--- a/src/math/lp/emonics.h
+++ b/src/math/lp/emonics.h
@@ -51,9 +51,8 @@ class emonics {
         unsigned     m_index;
     };
     struct head_tail {
-        head_tail(): m_head(nullptr), m_tail(nullptr) {}
-        cell* m_head;
-        cell* m_tail;
+        cell* m_head = nullptr;
+        cell* m_tail = nullptr;
     };
     struct hash_canonical {
         emonics& em;
@@ -205,7 +204,6 @@ public:
         monic & operator*() { return m.m_monics[m_cell->m_index]; }
         iterator& operator++() { m_touched = true; m_cell = m_cell->m_next; return *this; }
         iterator operator++(int) { iterator tmp = *this; ++*this; return tmp; }
-        bool operator==(iterator const& other) const { return m_cell == other.m_cell && m_touched == other.m_touched; }
         bool operator!=(iterator const& other) const { return m_cell != other.m_cell || m_touched != other.m_touched; }
     };
         
@@ -239,7 +237,6 @@ public:
         }
         pf_iterator& operator++() { ++m_it; fast_forward(); return *this; }
         pf_iterator operator++(int) { pf_iterator tmp = *this; ++*this; return tmp; }
-        bool operator==(pf_iterator const& other) const { return m_it == other.m_it; }
         bool operator!=(pf_iterator const& other) const { return m_it != other.m_it; }
     };
 
diff --git a/src/math/lp/explanation.h b/src/math/lp/explanation.h
index 9d8099c1e..850e59cd4 100644
--- a/src/math/lp/explanation.h
+++ b/src/math/lp/explanation.h
@@ -106,11 +106,10 @@ public:
         iterator(bool run_on_vector, pair_vec::const_iterator vi, ci_set::iterator cii) :
             m_run_on_vector(run_on_vector), m_vi(vi), m_ci(cii)
         {}
-        bool operator==(const iterator &other) const {
+        bool operator!=(const iterator &other) const {
             SASSERT(m_run_on_vector == other.m_run_on_vector);
-            return  m_run_on_vector? m_vi == other.m_vi : m_ci == other.m_ci;
+            return  m_run_on_vector ? m_vi != other.m_vi : m_ci != other.m_ci;
         }
-        bool operator!=(const iterator &other) const { return !(*this == other); }
     };
 
     iterator begin() const {
diff --git a/src/math/lp/factorization.cpp b/src/math/lp/factorization.cpp
index e1dcff626..89c16ec91 100644
--- a/src/math/lp/factorization.cpp
+++ b/src/math/lp/factorization.cpp
@@ -97,14 +97,12 @@ const_iterator_mon::const_iterator_mon(const bool_vector& mask, const factorizat
     m_ff(f) ,
     m_full_factorization_returned(false)
 {}
-            
-bool const_iterator_mon::operator==(const const_iterator_mon::self_type &other) const {
-    return
-        m_full_factorization_returned == other.m_full_factorization_returned &&
-        m_mask == other.m_mask;
-}
 
-bool const_iterator_mon::operator!=(const const_iterator_mon::self_type &other) const { return !(*this == other); }
+bool const_iterator_mon::operator!=(const const_iterator_mon::self_type &other) const {
+    return
+        m_full_factorization_returned != other.m_full_factorization_returned ||
+        m_mask != other.m_mask;
+}
             
 factorization const_iterator_mon::create_binary_factorization(factor j, factor k) const {
     factorization f(nullptr);
diff --git a/src/math/lp/factorization.h b/src/math/lp/factorization.h
index be3a024e3..128b269fa 100644
--- a/src/math/lp/factorization.h
+++ b/src/math/lp/factorization.h
@@ -88,8 +88,7 @@ struct const_iterator_mon {
     self_type operator++(int);
 
     const_iterator_mon(const bool_vector& mask, const factorization_factory *f);
-    
-    bool operator==(const self_type &other) const;
+
     bool operator!=(const self_type &other) const;
             
     factorization create_binary_factorization(factor j, factor k) const;
diff --git a/src/math/lp/lar_constraints.h b/src/math/lp/lar_constraints.h
index b9069625f..1105382e7 100644
--- a/src/math/lp/lar_constraints.h
+++ b/src/math/lp/lar_constraints.h
@@ -203,7 +203,6 @@ public:
             lar_base_constraint const* operator->() const { return &cs[m_index]; }
             iterator& operator++() { next(); return *this; }
             iterator operator++(int) { auto tmp = *this; next(); return tmp; }
-            bool operator==(iterator const& other) const { return m_index == other.m_index; }
             bool operator!=(iterator const& other) const { return m_index != other.m_index; }
         };
         iterator begin() const { return iterator(cs, 0); }
@@ -229,7 +228,6 @@ public:
             constraint_index const* operator->() const { return &m_index; }
             iterator& operator++() { next(); return *this; }
             iterator operator++(int) { auto tmp = *this; next(); return tmp; }
-            bool operator==(iterator const& other) const { return m_index == other.m_index; }
             bool operator!=(iterator const& other) const { return m_index != other.m_index; }
         };
         iterator begin() const { return iterator(cs, 0); }
diff --git a/src/math/lp/lar_term.h b/src/math/lp/lar_term.h
index 87a0c282a..8f8dd2f4a 100644
--- a/src/math/lp/lar_term.h
+++ b/src/math/lp/lar_term.h
@@ -170,8 +170,7 @@ public:
         const_iterator operator++() { const_iterator i = *this; m_it++; return i;  }
         const_iterator operator++(int) { m_it++; return *this; }
         const_iterator(u_map<mpq>::iterator it) : m_it(it) {}
-        bool operator==(const const_iterator &other) const { return m_it == other.m_it; }
-        bool operator!=(const const_iterator &other) const { return !(*this == other); }
+        bool operator!=(const const_iterator &other) const { return m_it != other.m_it; }
     };
    
     bool is_normalized() const {
diff --git a/src/math/lp/var_eqs.h b/src/math/lp/var_eqs.h
index 56c39c460..b2b3f24cf 100644
--- a/src/math/lp/var_eqs.h
+++ b/src/math/lp/var_eqs.h
@@ -302,7 +302,6 @@ public:
             return signed_var(m_idx);
         }
         iterator& operator++() { m_idx = m_ve.m_uf.next(m_idx); m_touched = true; return *this; }
-        bool operator==(iterator const& other) const { return m_idx == other.m_idx && m_touched == other.m_touched; }
         bool operator!=(iterator const& other) const { return m_idx != other.m_idx || m_touched != other.m_touched; }
     };
 
diff --git a/src/math/simplex/bit_matrix.h b/src/math/simplex/bit_matrix.h
index c827690ec..13ca2b7ba 100644
--- a/src/math/simplex/bit_matrix.h
+++ b/src/math/simplex/bit_matrix.h
@@ -71,7 +71,6 @@ public:
         unsigned const* operator->() const { return &m_column; }
         col_iterator& operator++() { next(); return *this; }
         col_iterator operator++(int) { auto tmp = *this; next(); return tmp; }
-        bool operator==(col_iterator const& other) const { return m_column == other.m_column; }
         bool operator!=(col_iterator const& other) const { return m_column != other.m_column; }  
     };
 
@@ -88,7 +87,6 @@ public:
         row* operator->() { return &m_row; }
         row_iterator& operator++() { next(); return *this; }
         row_iterator operator++(int) { auto tmp = *this; next(); return tmp; }
-        bool operator==(row_iterator const& other) const { return m_index == other.m_index; }
         bool operator!=(row_iterator const& other) const { return m_index != other.m_index; }  
     };
 
diff --git a/src/math/simplex/sparse_matrix.h b/src/math/simplex/sparse_matrix.h
index 9333e9ddb..0dfd1a2ad 100644
--- a/src/math/simplex/sparse_matrix.h
+++ b/src/math/simplex/sparse_matrix.h
@@ -198,7 +198,6 @@ namespace simplex {
             row_entry * operator->() const { return &(operator*()); }
             row_iterator & operator++() { ++m_curr; move_to_used(); return *this; }
             row_iterator operator++(int) { row_iterator tmp = *this; ++*this; return tmp; }
-            bool operator==(row_iterator const & it) const { return m_curr == it.m_curr; }
             bool operator!=(row_iterator const & it) const { return m_curr != it.m_curr; }           
         };
 
@@ -308,7 +307,6 @@ namespace simplex {
             row operator*() { return row(m_curr); }
             all_row_iterator & operator++() { m_curr++; move_to_next(); return *this; }
             all_row_iterator operator++(int) { all_row_iterator tmp = *this; ++*this; return tmp; }
-            bool operator==(all_row_iterator const& it) const { return m_curr == it.m_curr; }
             bool operator!=(all_row_iterator const& it) const { return m_curr != it.m_curr; }
         };
         
diff --git a/src/muz/rel/dl_table.cpp b/src/muz/rel/dl_table.cpp
index e0ea17739..fec4e5c98 100644
--- a/src/muz/rel/dl_table.cpp
+++ b/src/muz/rel/dl_table.cpp
@@ -122,7 +122,7 @@ namespace datalog {
             m_end(t.m_data.end()), m_row_obj(*this) {}
 
         bool is_finished() const override {
-            return m_inner==m_end;
+            return !(m_inner != m_end);
         }
 
         row_interface & operator*() override {
diff --git a/src/qe/qe.h b/src/qe/qe.h
index 55729d0b5..05251a2e0 100644
--- a/src/qe/qe.h
+++ b/src/qe/qe.h
@@ -123,7 +123,6 @@ namespace qe {
             iterator(conj_enum& c, bool first) : m_super(&c), m_index(first?0:c.m_conjs.size()) {}
             expr* operator*() { return m_super->m_conjs[m_index].get(); }
             iterator& operator++() { m_index++; return *this; }
-            bool operator==(iterator const& it) const { return m_index == it.m_index; }
             bool operator!=(iterator const& it) const { return m_index != it.m_index; }
         };
 
diff --git a/src/sat/dimacs.h b/src/sat/dimacs.h
index ca6aae07b..3ca8102ff 100644
--- a/src/sat/dimacs.h
+++ b/src/sat/dimacs.h
@@ -94,7 +94,6 @@ namespace dimacs {
             iterator(drat_parser& p, bool is_eof):p(p), m_eof(is_eof) { if (!m_eof) m_eof = !p.next(); }
             drat_record const& operator*() { return p.m_record; }
             iterator& operator++() { if (!p.next()) m_eof = true; return *this;}
-            bool operator==(iterator const& other) const { return m_eof == other.m_eof; }
             bool operator!=(iterator const& other) const { return m_eof != other.m_eof; }
         };
         
diff --git a/src/sat/sat_clause.h b/src/sat/sat_clause.h
index f1a44296e..0129febbf 100644
--- a/src/sat/sat_clause.h
+++ b/src/sat/sat_clause.h
@@ -188,7 +188,6 @@ namespace sat {
             iterator(clause_wrapper const& c, unsigned idx): m_idx(idx), m_cw(c) {}
             iterator& operator++() { ++m_idx; return *this; }
             literal operator*() { return m_cw[m_idx]; }
-            bool operator==(iterator const& other) const { SASSERT(&m_cw == &other.m_cw); return m_idx == other.m_idx; }
             bool operator!=(iterator const& other) const { SASSERT(&m_cw == &other.m_cw); return m_idx != other.m_idx; }
         };
         iterator begin() const { return iterator(*this, 0); }
diff --git a/src/sat/smt/pb_constraint.h b/src/sat/smt/pb_constraint.h
index 26c5f8b08..4c6f69e07 100644
--- a/src/sat/smt/pb_constraint.h
+++ b/src/sat/smt/pb_constraint.h
@@ -125,7 +125,6 @@ namespace pb {
             iterator(constraint const& c, unsigned idx) : c(c), idx(idx) {}
             literal operator*() { return c.get_lit(idx); }
             iterator& operator++() { ++idx; return *this; }
-            bool operator==(iterator const& other) const { SASSERT(&c == &other.c); return idx == other.idx; }
             bool operator!=(iterator const& other) const { SASSERT(&c == &other.c); return idx != other.idx; }
         };
         
diff --git a/src/smt/smt_enode.h b/src/smt/smt_enode.h
index 92902ea0b..3f488a3b7 100644
--- a/src/smt/smt_enode.h
+++ b/src/smt/smt_enode.h
@@ -360,8 +360,7 @@ namespace smt {
             enode* operator*() { return m_first; }
             iterator& operator++() { if (!m_last) m_last = m_first; m_first = m_first->m_next; return *this; }
             iterator operator++(int) { iterator tmp = *this; ++*this; return tmp; }
-            bool operator==(iterator const& other) const { return m_last == other.m_last && m_first == other.m_first; }
-            bool operator!=(iterator const& other) const { return !(*this == other); }            
+            bool operator!=(iterator const& other) const { return m_last != other.m_last || m_first != other.m_first; }            
         };
 
         iterator begin() { return iterator(this, nullptr); }
diff --git a/src/util/approx_set.h b/src/util/approx_set.h
index a1835be6f..011a8017d 100644
--- a/src/util/approx_set.h
+++ b/src/util/approx_set.h
@@ -197,10 +197,6 @@ public:
             ++*this; 
             return tmp; 
         }
-
-        bool operator==(iterator const & it) const { 
-            return m_set == it.m_set;
-        }
         
         bool operator!=(iterator const & it) const { 
             return m_set != it.m_set; 
diff --git a/src/util/bit_vector.h b/src/util/bit_vector.h
index 12f86dd00..7b87e045a 100644
--- a/src/util/bit_vector.h
+++ b/src/util/bit_vector.h
@@ -220,7 +220,6 @@ public:
         bool operator*() const { return b.get(m_curr); }
         iterator& operator++() { ++m_curr; return *this; }
         iterator operator++(int) { iterator tmp = *this; ++* this; return tmp; }
-        bool operator==(iterator const& it) const { return m_curr == it.m_curr; }
         bool operator!=(iterator const& it) const { return m_curr != it.m_curr; }        
     };
 
diff --git a/src/util/chashtable.h b/src/util/chashtable.h
index da7cb5b31..f245a047c 100644
--- a/src/util/chashtable.h
+++ b/src/util/chashtable.h
@@ -551,7 +551,6 @@ public:
             return *this;
         }
         iterator operator++(int) { iterator tmp = *this; ++*this; return tmp; }
-        bool operator==(iterator const & it) const { return m_list_it == it.m_list_it; }
         bool operator!=(iterator const & it) const { return m_list_it != it.m_list_it; }
     };
     
diff --git a/src/util/distribution.h b/src/util/distribution.h
index 0ed63d510..92aa4d805 100644
--- a/src/util/distribution.h
+++ b/src/util/distribution.h
@@ -95,7 +95,6 @@ public:
             next_index();
             return *this;
         }
-        bool operator==(iterator const& other) const { return m_sz == other.m_sz; }
         bool operator!=(iterator const& other) const { return m_sz != other.m_sz; }
     };
 
diff --git a/src/util/dlist.h b/src/util/dlist.h
index 4c0e51e58..1ed183d3d 100644
--- a/src/util/dlist.h
+++ b/src/util/dlist.h
@@ -213,13 +213,8 @@ public:
     T const& operator*() const {
         return *m_elem;
     }
-
-    bool operator==(dll_iterator const& other) const {
-        return m_elem == other.m_elem && m_first == other.m_first;
-    }
-
     bool operator!=(dll_iterator const& other) const {
-        return !operator==(other);
+        return m_elem != other.m_elem || m_first != other.m_first;
     }
 };
 
diff --git a/src/util/list.h b/src/util/list.h
index 208828ea0..a9c33fd33 100644
--- a/src/util/list.h
+++ b/src/util/list.h
@@ -44,7 +44,6 @@ public:
         T const & operator*() const { return m_curr->head(); }
         iterator & operator++() { m_curr = m_curr->tail(); return *this; }
         iterator operator++(int) { iterator tmp = *this; ++*this; return tmp; }
-        bool operator==(iterator const & it) { return m_curr == it.m_curr; }
         bool operator!=(iterator const & it) { return m_curr != it.m_curr; }
     };        
 
diff --git a/src/util/scoped_vector.h b/src/util/scoped_vector.h
index 7d0cec472..6a5c1228d 100644
--- a/src/util/scoped_vector.h
+++ b/src/util/scoped_vector.h
@@ -106,8 +106,7 @@ public:
         unsigned m_index;
     public:
         iterator(scoped_vector const& v, unsigned idx): m_vec(v), m_index(idx) {}
-        
-        bool operator==(iterator const& other) const { return &other.m_vec == &m_vec && other.m_index == m_index; }
+
         bool operator!=(iterator const& other) const { return &other.m_vec != &m_vec || other.m_index != m_index; }
         T const& operator*() { return m_vec[m_index]; }
 
diff --git a/src/util/uint_set.h b/src/util/uint_set.h
index 73c3bce1f..f936f1134 100644
--- a/src/util/uint_set.h
+++ b/src/util/uint_set.h
@@ -194,7 +194,6 @@ public:
             SASSERT(invariant());
         }
         unsigned operator*() const { return m_index; }
-        bool operator==(iterator const& it) const { return m_index == it.m_index; }
         bool operator!=(iterator const& it) const { return m_index != it.m_index; }
         iterator & operator++() { ++m_index; scan(); return *this; }
         iterator operator++(int) { iterator tmp = *this; ++*this; return tmp; }
diff --git a/src/util/vector.h b/src/util/vector.h
index 79e51d545..1f51ac775 100644
--- a/src/util/vector.h
+++ b/src/util/vector.h
@@ -311,9 +311,6 @@ public:
             return *this;
         }
 
-        bool operator==(reverse_iterator const& other) const {
-            return other.v == v;
-        }
         bool operator!=(reverse_iterator const& other) const {
             return other.v != v;
         }
@@ -883,9 +880,6 @@ public:
             return *this;
         }
 
-        bool operator==(reverse_iterator const& other) const {
-            return other.v == v;
-        }
         bool operator!=(reverse_iterator const& other) const {
             return other.v != v;
         }