From 931351f869d0197c78ac85ba4ba7718525969dc3 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Tue, 20 Oct 2015 20:21:47 +0200 Subject: [PATCH] update report, added solution to 2 image --- ar/assignments/2.tex | 58 +++++++++++++++++++++++++++--- ar/assignments/Makefile | 7 ++-- ar/assignments/a.tex | 9 +++++ ar/assignments/ar.tex | 10 ++++++ ar/assignments/preamble.tex | 5 +-- ar/assignments/s2.png | Bin 0 -> 14250 bytes ar/assignments/src/2.py | 68 ++++++++++++------------------------ 7 files changed, 101 insertions(+), 56 deletions(-) create mode 100644 ar/assignments/s2.png diff --git a/ar/assignments/2.tex b/ar/assignments/2.tex index 7bd482d..f4789d8 100644 --- a/ar/assignments/2.tex +++ b/ar/assignments/2.tex @@ -38,10 +38,10 @@ specified width and height. \nonumber & \qquad\qquad\qquad \vee c_iy>c_jy+c_jh\\ \nonumber & \qquad\qquad\qquad \vee c_iy+c_jh15\\ - \nonumber & \vee c_jx+\frac{c_jw}{2}-c_ix+\frac{c_iw}{2}>15\\ - \nonumber & \vee c_iy+\frac{c_ih}{2}-c_jy+\frac{c_jh}{2}>15\\ - \nonumber & \vee c_jy+\frac{c_jh}{2}-c_iy+\frac{c_ih}{2}>15\Biggr)\wedge\\ + \nonumber & \vee c_ix+\frac{c_iw}{2}-c_jx+\frac{c_jw}{2}>17\\ + \nonumber & \vee c_jx+\frac{c_jw}{2}-c_ix+\frac{c_iw}{2}>17\\ + \nonumber & \vee c_iy+\frac{c_ih}{2}-c_jy+\frac{c_jh}{2}>17\\ + \nonumber & \vee c_jy+\frac{c_jh}{2}-c_iy+\frac{c_ih}{2}>17\Biggr)\wedge\\ \bigwedge_{i\in RC}\bigvee_{j\in PC}\neg\Biggl( & (c_ix-1>c_jx+c_jw\\ \nonumber & \vee c_ix+1+c_jwWPLzyII+e}2!G_lwNTIcM*E*4pb@*Sgj=Nd1`tF%caR1_lPP;!{~o3=FJ$7#Nu0 z1X#c?tg}}xz#nXL6Nt-n{I z)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git a/ar/assignments/src/2.py b/ar/assignments/src/2.py index 2b5ed99..e5852e6 100644 --- a/ar/assignments/src/2.py +++ b/ar/assignments/src/2.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 - pc = [(4, 2), (4, 2), (4, 2)] rc = [(9, 7), (12, 6), (10, 7), (18, 5), (20, 4), (10, 6), (8, 6), (10, 8)] mx = 29 @@ -19,7 +18,6 @@ for i, (w, h) in enumerate(pc+rc, 1): print("(c{:02d}h Int)".format(i)) print(")") -# Preamble2 print(":formula") print("(and") @@ -27,67 +25,47 @@ print("(and") for i, (w, h) in enumerate(pc+rc, 1): # Print the width and height print(( - '\t(or ' + '(or ' '(and (= c{0:02d}w {1}) (= c{0:02d}h {2})) ' - '(and (= c{0:02d}w {2}) (= c{0:02d}h {1}))' - ')').format(i, w-1, h-1)) + '(and (= c{0:02d}w {2}) (= c{0:02d}h {1})))').format(i, w-1, h-1)) - # Print the bounds of the coordinates + # Print the bounds of the coordinates print(( - '\t(> c{0:02d}x 0) (> c{0:02d}y 0)\n' - '\t(<= (+ c{0:02d}x c{0:02d}w) {1}) (<= (+ c{0:02d}y c{0:02d}h) {2})\n' - ).format(i, mx, my)) + '(> c{0:02d}x 0) (> c{0:02d}y 0)' + '(<= (+ c{0:02d}x c{0:02d}w) {1}) (<= (+ c{0:02d}y c{0:02d}h) {2})' + ).format(i, mx, my)) - # Print the non overlap with others + # Print the non overlap with others for j in range(1, 1+len(pc+rc)): if i != j: print(( - '\t(or \n' - '\t\t(> c{0:02d}x (+ c{1:02d}x c{1:02d}w)) ' - '(< (+ c{0:02d}x c{0:02d}w) c{1:02d}x)\n' - '\t\t(> c{0:02d}y (+ c{1:02d}y c{1:02d}h)) ' - '(< (+ c{0:02d}y c{0:02d}h) c{1:02d}y)' - ')').format(i, j)) + '(or ' + '(> c{0:02d}x (+ c{1:02d}x c{1:02d}w)) (< (+ c{0:02d}x c{0:02d}w) c{1:02d}x) ' + '(> c{0:02d}y (+ c{1:02d}y c{1:02d}h)) (< (+ c{0:02d}y c{0:02d}h) c{1:02d}y)' + ')').format(i, j)) -# Print the PC distance to eachother + # Print the PC distance to eachother for i, _ in enumerate(pc, 1): for j, _ in enumerate(pc, 1): if i != j: print(( - '\t(or \n' - '\t\t(> \n' - '\t\t\t(- \n' - '\t\t\t\t(+ \n' - '\t\t\t\t\tc{0:02d}x \n' - '\t\t\t\t\t(/ c{0:02d}w 2) \n' - '\t\t\t\t) \n' - '\t\t\t\t(+ \n' - '\t\t\t\t\tc{1:02d}x \n' - '\t\t\t\t\t(/ c{1:02d}w 2) \n' - '\t\t\t\t) \n' - '\t\t\t) \n' - '\t\t\t{2} \n' - '\t\t)\n' - '\t\t(> (- (+ c{1:02d}x (/ c{1:02d}w 2)) ' - '(+ c{0:02d}x (/ c{0:02d}w 2))) {2})\n' - '\t\t(> (- (+ c{0:02d}y (/ c{0:02d}h 2)) ' - '(+ c{1:02d}y (/ c{1:02d}h 2))) {2})\n' - '\t\t(> (- (+ c{1:02d}y (/ c{1:02d}h 2)) ' - '(+ c{0:02d}y (/ c{0:02d}h 2))) {2})' + '(or ' + '(> (- (+ c{0:02d}x (/ c{0:02d}w 2) ) (+ c{1:02d}x (/ c{1:02d}w 2) ) ) {2} ) ' + '(> (- (+ c{1:02d}x (/ c{1:02d}w 2)) (+ c{0:02d}x (/ c{0:02d}w 2))) {2}) ' + '(> (- (+ c{0:02d}y (/ c{0:02d}h 2)) (+ c{1:02d}y (/ c{1:02d}h 2))) {2}) ' + '(> (- (+ c{1:02d}y (/ c{1:02d}h 2)) (+ c{0:02d}y (/ c{0:02d}h 2))) {2})' ')').format(i, j, pd)) -# Print the constraint that they have to be connected to a ps + # Print the constraint that they have to be connected to a ps for i, _ in enumerate(rc, 1+len(pc)): - print('\t(or') + print('(or') for j, _ in enumerate(pc, 1): print(( - '\t(not (or \n' - '\t\t(> c{0:02d}x (+ c{1:02d}x 1 c{1:02d}w)) ' - '(< (+ c{0:02d}x c{0:02d}w) (- c{1:02d}x 1))\n' - '\t\t(> c{0:02d}y (+ c{1:02d}y 1 c{1:02d}h)) ' - '(< (+ c{0:02d}y c{0:02d}h) (- c{1:02d}y 1))' + '(not (or ' + '(> c{0:02d}x (+ c{1:02d}x 1 c{1:02d}w)) (< (+ c{0:02d}x c{0:02d}w) (- c{1:02d}x 1)) ' + '(> c{0:02d}y (+ c{1:02d}y 1 c{1:02d}h)) (< (+ c{0:02d}y c{0:02d}h) (- c{1:02d}y 1))' '))').format(i, j)) - print('\t)') + print(')') # Close the and,benchmark parenthesis print("))") -- 2.20.1