From 839764bd955d2bddedb4a38ab1d4d92c797c56b9 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Tue, 27 Nov 2012 18:20:06 +1100 Subject: Thesis and performance testing related stuff. --- impl/systems/generate-random.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'impl/systems') diff --git a/impl/systems/generate-random.py b/impl/systems/generate-random.py index 66467b6..5b54bef 100644 --- a/impl/systems/generate-random.py +++ b/impl/systems/generate-random.py @@ -11,8 +11,9 @@ def generate_variable(size): def generate_expression(size): if random.randint(1, 5) < 3: - operator = random.choice(['+', '-']) - return generate_variable(size) + operator + generate_expression(size); + operator = random.choice(['add', 'mul']) + args = (generate_expression(size) for i in xrange(random.randint(2, 4))) + return "%s(%s)" % (operator, ",".join(args)) else: return generate_variable(size) -- cgit v1.2.3