From 28f72e11c05c58ae162b79f0fc3dce7151628703 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Fri, 23 Oct 2015 09:55:45 +0200 Subject: [PATCH] unified code style ar --- ar/assignment1/Makefile | 4 +++- ar/assignment1/src/a2.py | 25 ++++++++++++------------- ar/assignment1/src/a3.py | 4 +--- ar/assignment1/src/a4.py | 4 +--- 4 files changed, 17 insertions(+), 20 deletions(-) diff --git a/ar/assignment1/Makefile b/ar/assignment1/Makefile index 918eb44..376182a 100644 --- a/ar/assignment1/Makefile +++ b/ar/assignment1/Makefile @@ -2,12 +2,14 @@ LATEX:=pdflatex DOCUMENT:=ar SOURCES:=$(filter-out preamble.tex,$(shell ls *.tex)) +LISTINGS:=$(shell ls src/*) +IMAGES:=$(shell ls *.png) .SECONDARY: $(addsuffix .fmt,$(DOCUMENT)) all: $(DOCUMENT).pdf -%.pdf: %.tex %.fmt $(SOURCES) +%.pdf: %.tex %.fmt $(SOURCES) $(LISTINGS) $(IMAGES) $(LATEX) $(basename $@) $(LATEX) $(basename $@) diff --git a/ar/assignment1/src/a2.py b/ar/assignment1/src/a2.py index 85473a3..529f6b8 100644 --- a/ar/assignment1/src/a2.py +++ b/ar/assignment1/src/a2.py @@ -5,21 +5,20 @@ mx = 29 my = 22 pd = 17 -# Print preamble -print("(benchmark a4.smt") -print(":logic QF_UFLIA") -# Print variables -print(":extrafuns (") +# Print variables and preamble +print('(benchmark a4.smt') +print(':logic QF_UFLIA') +print(':extrafuns (') for i, (w, h) in enumerate(pc+rc, 1): - print("(c{}x Int)".format(i), end=' ') - print("(c{}y Int)".format(i), end=' ') - print("(c{}w Int)".format(i), end=' ') - print("(c{}h Int)".format(i)) -print(")") + print('(c{}x Int)'.format(i), end=' ') + print('(c{}y Int)'.format(i), end=' ') + print('(c{}w Int)'.format(i), end=' ') + print('(c{}h Int)'.format(i)) +print(')') -print(":formula") -print("(and") +print(':formula') +print('(and') # Print the PC and RC subformulas for i, (w, h) in enumerate(pc+rc, 1): @@ -63,4 +62,4 @@ for i, _ in enumerate(rc, 1+len(pc)): print(')') # Close the and,benchmark parenthesis -print("))") +print('))') diff --git a/ar/assignment1/src/a3.py b/ar/assignment1/src/a3.py index 7d79135..1d7a848 100644 --- a/ar/assignment1/src/a3.py +++ b/ar/assignment1/src/a3.py @@ -18,11 +18,9 @@ pi = { 12: {9, 11} } -# Print preamble +# Print variables and preamble print('(benchmark a4.smt') print(':logic QF_UFLIA') - -# Print variables print(':extrafuns (') for i in J: print('(j{} Int)'.format(i), end=' ') diff --git a/ar/assignment1/src/a4.py b/ar/assignment1/src/a4.py index f33f57c..8883695 100644 --- a/ar/assignment1/src/a4.py +++ b/ar/assignment1/src/a4.py @@ -7,11 +7,9 @@ if len(sys.argv) != 2: iterations = int(sys.argv[1]) if len(sys.argv) > 1 else 11 numa = 7 -# Print preamble +# Print variables and preamble print("(benchmark a4.smt") print(":logic QF_UFLIA") - -# Print variables print(":extrafuns (") print("(a{} Int)".format(1)) print("(a{} Int)".format(numa)) -- 2.20.1