From: Vivien Maisonneuve Date: Wed, 25 Jun 2014 11:57:32 +0000 (+0200) Subject: Add demonstration file X-Git-Tag: 1.0~204 X-Git-Url: https://svn.cri.ensmp.fr/git/linpy.git/commitdiff_plain/a66c02fdc562e59fb06097529bb378663579cb27?ds=sidebyside Add demonstration file --- 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))