GitHub PullRequestReviewCommentEvent at 2014-01-30 19:27:44
Repository: sympy
Actor: skirpichev
Payload: {"comment":{"url":"https://api.github.com/repos/sympy/sympy/pulls/comments/9319348","id":9319348,"diff_hunk":"@@ -1466,3 +1466,79 @@ def bool_equal(bool1, bool2, info=False):\n     if info:\n         return mapping\n     return True\n+\n+\n+def tseitin_transformation(formula):\n+    \"\"\"\n+    Converts any propositional formula into an equisatisfiable CNF\n+    form with auxilliary literals using Tseitin Transformation.\n+    This is mainly for use by SAT solvers as it prevents the\n+    exponential blowup of formula when converted to CNF. To get\n+    the CNF of any particular formula use to_cnf function.\n+\n+    References\n+    ==========\n+\n+    .. [1] http://en.wikipedia.org/wiki/Tseitin-Transformation\n+    \"\"\"\n+\n+    from sympy import numbered_symbols, Dummy\n+\n+    if formula.is_Atom is True:\n+        return formula\n+\n+    q = list()\n+    dct = dict()\n+    clauses = list()\n+    sym_factory = numbered_symbols('s', cls=Dummy)\n+\n+    q.append(formula)\n+    s = sym_factory.next()","path":"sympy/logic/boolalg.py","position":40,"original_position":40,"commit_id":"174ba8a4828253e413f69cf81487113b48c7d6b4","original_commit_id":"174ba8a4828253e413f69cf81487113b48c7d6b4","user":{"login":"skirpichev","id":2155800,"avatar_url":"https://gravatar.com/avatar/0621cf21f5cba395eaa48c7541265738?d=https%3A%2F%2Fidenticons.github.com%2F660d88d07c9b26a3b23f48ac6d83ca6c.png&r=x","gravatar_id":"0621cf21f5cba395eaa48c7541265738","url":"https://api.github.com/users/skirpichev","html_url":"https://github.com/skirpichev","followers_url":"https://api.github.com/users/skirpichev/followers","following_url":"https://api.github.com/users/skirpichev/following{/other_user}","gists_url":"https://api.github.com/users/skirpichev/gists{/gist_id}","starred_url":"https://api.github.com/users/skirpichev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skirpichev/subscriptions","organizations_url":"https://api.github.com/users/skirpichev/orgs","repos_url":"https://api.github.com/users/skirpichev/repos","events_url":"https://api.github.com/users/skirpichev/events{/privacy}","received_events_url":"https://api.github.com/users/skirpichev/received_events","type":"User","site_admin":false},"body":"http://stackoverflow.com/questions/10414210/python-why-should-i-use-next-and-not-obj-next\r\n\r\n```\r\ns = next(sym_factory)\r\n```\r\n(and the same below)","created_at":"2014-01-30T19:27:44Z","updated_at":"2014-01-30T19:27:44Z","html_url":"https://github.com/sympy/sympy/pull/2852#discussion_r9319348","pull_request_url":"https://api.github.com/repos/sympy/sympy/pulls/2852","_links":{"self":{"href":"https://api.github.com/repos/sympy/sympy/pulls/comments/9319348"},"html":{"href":"https://github.com/sympy/sympy/pull/2852#discussion_r9319348"},"pull_request":{"href":"https://api.github.com/repos/sympy/sympy/pulls/2852"}}}}