Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if numbers are not float equals method return false (e.g., 2 instead of 2.0). @G... #123

Open
github-actions bot opened this issue Aug 10, 2022 · 0 comments
Labels

Comments

@github-actions
Copy link

# TODO: if numbers are not float equals method return false (e.g., 2 instead of 2.0). @Giovanni 2ppy

import unittest
from tuprolog.theory import mutable_theory, theory
from tuprolog.theory.parsing import parse_theory
from psyke.utils.logic import simplify


class TestSimplify(unittest.TestCase):

    def test_simplify(self):
        # TODO: if numbers are not float equals method return false (e.g., 2 instead of 2.0). @Giovanni 2ppy
        textual_theory = "p(X, Y, inside) :- ('=<'(X, 1.0), '>'(Y, 2.0), '=<'(X, 0.5))."
        textual_simplified_theory = "p(X, Y, inside) :- ('=<'(X, 0.5), '>'(Y, 2.0))."
        long_theory = mutable_theory(parse_theory(textual_theory))
        simplified_theory = theory(parse_theory(textual_simplified_theory))

        self.assertTrue(simplified_theory.equals(simplify(long_theory), False))


if __name__ == '__main__':
    unittest.main()
@github-actions github-actions bot added the todo label Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants