mboratko / aima-python

Automatically exported from code.google.com/p/aima-python
0 stars 1 forks source link

Logic expression does not support not-equal comparison #14

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

>>> from logic import *
>>> expr("a") == expr("a")
True
>>> expr("a") != expr("a")
True
>>>

What is the expected output? What do you see instead?

The expected output is that  expr("a") != expr("a")  will return False

What version of the product are you using? On what operating system?

Tested on pyhton 2.6.3 and 2.5.2 on linux

Please provide any additional information below.

Easy fix - add this method to the Expr class:

  def __ne__(self, other):
        return not self.__eq__(other)

Original issue reported on code.google.com by karp...@gmail.com on 3 Dec 2009 at 1:15

GoogleCodeExporter commented 8 years ago
This causes DPLL to return incorrect answers (since remove_all is used there, 
and it
uses !=)

Original comment by karp...@gmail.com on 3 Dec 2009 at 1:16

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r74.

Original comment by wit...@gmail.com on 15 Sep 2011 at 4:13