{"action":"opened","issue":{"url":"https://api.github.com/repos/jonasmit15/CNF-Evaluator/issues/9","repository_url":"https://api.github.com/repos/jonasmit15/CNF-Evaluator","labels_url":"https://api.github.com/repos/jonasmit15/CNF-Evaluator/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/jonasmit15/CNF-Evaluator/issues/9/comments","events_url":"https://api.github.com/repos/jonasmit15/CNF-Evaluator/issues/9/events","html_url":"https://github.com/jonasmit15/CNF-Evaluator/issues/9","id":444960068,"node_id":"MDU6SXNzdWU0NDQ5NjAwNjg=","number":9,"title":"long main part","user":{"login":"samestep","id":8246041,"node_id":"MDQ6VXNlcjgyNDYwNDE=","avatar_url":"https://avatars2.githubusercontent.com/u/8246041?v=4","gravatar_id":"","url":"https://api.github.com/users/samestep","html_url":"https://github.com/samestep","followers_url":"https://api.github.com/users/samestep/followers","following_url":"https://api.github.com/users/samestep/following{/other_user}","gists_url":"https://api.github.com/users/samestep/gists{/gist_id}","starred_url":"https://api.github.com/users/samestep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samestep/subscriptions","organizations_url":"https://api.github.com/users/samestep/orgs","repos_url":"https://api.github.com/users/samestep/repos","events_url":"https://api.github.com/users/samestep/events{/privacy}","received_events_url":"https://api.github.com/users/samestep/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-05-16T13:35:18Z","updated_at":"2019-05-16T13:35:18Z","closed_at":null,"author_association":"NONE","body":"It seems like the main part of the code is [lines 49-95][code], which is very long and deeply nested, and I didn't really feel like reading through it in detail this morning... instead, here's how I would write it if I didn't already have your code:\r\n```python\r\nimport itertools\r\n\r\ndef all_assignments():\r\n    valses = itertools.product([True, False], repeat=len(term_set))\r\n    return [dict(zip(term_set, vals)) for vals in valses]\r\n\r\ndef term_satisfied(assignment, term):\r\n    var = term.replace('~', '')\r\n    val = assignment[var]\r\n    return val if var == term else not val\r\n\r\ndef disjunct_satisfied(assignment, disjunct):\r\n    return any([term_satisfied(assignment, t) for t in disjunct])\r\n\r\ndef formula_satisfied(assignment):\r\n    return all([disjunct_satisfied(assignment, d) for d in total_disjunct_list])\r\n\r\nmeta_truth_list = [formula_satisfied(a) for a in all_assignments()]\r\n```\r\n\r\n[code]: https://github.com/jonasmit15/CNF-Evaluator/blob/f447e9390c26cea3d438ce6c49d09d0af65c9cf2/CNF%20Evaluator.py#L49-L95"}}
{"actor":{"display_login":"samestep"}}