Exemplo n.º 1
0
	def test_implies(self):
		expr = ForAll(x, sp.Implies(x > 0, x >= 0))
		out = run_qepcad(expr, [], [x])
		self.assertEqual(out, TRUE)

		expr = ForAll(x, sp.Implies(x > 0, x < 0))
		out = run_qepcad(expr, [], [x])
		self.assertEqual(out, FALSE)
Exemplo n.º 2
0
	def test_not_equal(self):
		expr = ForAll(x, NotEqual(x, x + 1))
		out = run_qepcad(expr, [], [x])
		self.assertEqual(out, TRUE)

		expr = ForAll(x, NotEqual(x, 2 * x))
		out = run_qepcad(expr, [], [x])
		self.assertEqual(out, FALSE)
Exemplo n.º 3
0
	def test_for_all_but_finitely_many(self):
		expr = ForAllButFinitelyMany(x,
		       ForAll(y,
		       Exists(z, sp.Eq(y, z * x))))
		out = run_qepcad(expr, [], [x, y, z])
		self.assertEqual(out, TRUE)

		expr = ForAll(x,
		       ForAll(y,
		       Exists(z, sp.Eq(y, z * x))))
		out = run_qepcad(expr, [], [x, y, z])
		self.assertEqual(out, FALSE)
Exemplo n.º 4
0
	def test_forall_does_not_exist(self):
		expr = ForAll(x, Exists(y, sp.Eq(x, y**2)))
		out = run_qepcad(expr, [], [x, y])
		self.assertEqual(out, FALSE)
Exemplo n.º 5
0
	def test_forall_exists(self):
		expr = ForAll(x, Exists(y, sp.Eq(x, 2 * y)))
		out = run_qepcad(expr, [], [x, y])
		self.assertEqual(out, TRUE)
Exemplo n.º 6
0
	def test_forall(self):
		expr = ForAll(x, x >= 22)
		out = run_qepcad(expr, [], [x])
		self.assertEqual(out, FALSE)
Exemplo n.º 7
0
	def test_equivalent(self):
		expr = ForAll(x, sp.Equivalent(x >= 0, x**3 >= 0))
		out = run_qepcad(expr, [], [x])
		self.assertEqual(out, TRUE)
Exemplo n.º 8
0
	def test_and(self):
		expr = ForAll(x, sp.And(x >= 5, x < 1))
		out = run_qepcad(expr, [], [x])
		self.assertEqual(out, FALSE)
Exemplo n.º 9
0
	def test_or(self):
		expr = ForAll(x, sp.Or(x >= 22, x < 22))
		out = run_qepcad(expr, [], [x])
		self.assertEqual(out, TRUE)