From 39670979819f1ea00844601237a81373d3daed0a Mon Sep 17 00:00:00 2001
From: Daniel Plagge <plagge@cs.uni-duesseldorf.de>
Date: Mon, 17 Sep 2012 14:56:40 +0000
Subject: [PATCH] using DIVIDE operation (added in a recent Kodkod version)

git-svn-id: https://cobra.cs.uni-duesseldorf.de/prob/trunk/experimental/plagge/probkodkod@11758 7aec93f6-bc54-0410-ac70-7d7c9efa889a
---
 src/de/stups/probkodkod/KodkodAnalysis.java | 2 ++
 src/problem.grammar                         | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/de/stups/probkodkod/KodkodAnalysis.java b/src/de/stups/probkodkod/KodkodAnalysis.java
index 3b01b56..8e11a9f 100644
--- a/src/de/stups/probkodkod/KodkodAnalysis.java
+++ b/src/de/stups/probkodkod/KodkodAnalysis.java
@@ -48,6 +48,7 @@ import de.stups.probkodkod.parser.node.AConstInnerexpression;
 import de.stups.probkodkod.parser.node.AConstInnerformula;
 import de.stups.probkodkod.parser.node.AConstInnerintexpression;
 import de.stups.probkodkod.parser.node.ADiffExprBinop;
+import de.stups.probkodkod.parser.node.ADivIntexprBinop;
 import de.stups.probkodkod.parser.node.AEmptyExprConst;
 import de.stups.probkodkod.parser.node.AEqualsIntCompOp;
 import de.stups.probkodkod.parser.node.AEqualsLogopRel;
@@ -195,6 +196,7 @@ public class KodkodAnalysis extends DepthFirstAdapter {
 		BININTEXPROPS.put(ASubIntexprBinop.class.getName(), IntOperator.MINUS);
 		BININTEXPROPS.put(AMulIntexprBinop.class.getName(),
 				IntOperator.MULTIPLY);
+		BININTEXPROPS.put(ADivIntexprBinop.class.getName(), IntOperator.DIVIDE);
 
 		BININTCOMPS.put(AEqualsIntCompOp.class.getName(), IntCompOperator.EQ);
 		BININTCOMPS.put(AGreaterIntCompOp.class.getName(), IntCompOperator.GT);
diff --git a/src/problem.grammar b/src/problem.grammar
index ff4ed48..20a42d6 100644
--- a/src/problem.grammar
+++ b/src/problem.grammar
@@ -67,6 +67,7 @@ Tokens
   keyword_addition = 'add';
   keyword_subtraction = 'sub';
   keyword_multiplication = 'mul';
+  keyword_division = 'div';
   keyword_greater = 'gt';
   keyword_greater_equal = 'gte';
   keyword_lesser = 'lt';
@@ -199,7 +200,8 @@ Productions
   intexpr_binop =
       {add}       keyword_addition
     | {sub}       keyword_subtraction
-    | {mul}       keyword_multiplication;  
+    | {mul}       keyword_multiplication
+    | {div}       keyword_division;  
 
   request = keyword_request [problem]:identifier [size]:number reqtype [al]:parenl [arguments]:argument* [ar]:parenr;
   argument = parenl identifier [tuples]:tuple* parenr;
-- 
GitLab