Add demonstration file
authorVivien Maisonneuve <v.maisonneuve@gmail.com>
Wed, 25 Jun 2014 11:57:32 +0000 (13:57 +0200)
committerVivien Maisonneuve <v.maisonneuve@gmail.com>
Wed, 25 Jun 2014 12:12:33 +0000 (14:12 +0200)
demo.py [new file with mode: 0755]

diff --git a/demo.py b/demo.py
new file mode 100755 (executable)
index 0000000..7f1aa30
--- /dev/null
+++ b/demo.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+
+from pypol import *
+
+x, y = symbols('x y')
+
+sq1 = Le(0, x) & Le(x, 2) & Le(0, y) & Le(y, 2)
+sq2 = Le(2, x) & Le(x, 4) & Le(2, y) & Le(y, 4)
+
+print('sq1 =', sq1)
+print('sq2 =', sq2)
+print()
+print('¬sq1 =', ~sq1)
+print()
+print('sq1 - sq2 =', sq1 - sq2)
+print('sq1 - sq2 =', Polyhedron(sq1 - sq2))
+print()
+print('sq1 ∩ sq2 =', sq1 & sq2)
+print('sq1 ∪ sq2 =', sq1 | sq2)
+print()
+print('sq1 ⊔ sq2 =', Polyhedron(sq1 | sq2))