From a66c02fdc562e59fb06097529bb378663579cb27 Mon Sep 17 00:00:00 2001 From: Vivien Maisonneuve Date: Wed, 25 Jun 2014 13:57:32 +0200 Subject: [PATCH 1/1] Add demonstration file --- demo.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 demo.py diff --git a/demo.py b/demo.py new file mode 100755 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)) -- 2.20.1