[jboss-svn-commits] JBL Code SVN: r7241 - in labs/jbossrules: . benchmarks benchmarks/lib benchmarks/src benchmarks/src/java benchmarks/src/java/benchmarks benchmarks/src/java/benchmarks/manners benchmarks/src/java/benchmarks/waltz benchmarks/src/java/benchmarks/waltzdb benchmarks/src/resources benchmarks/src/resources/benchmarks benchmarks/src/resources/benchmarks/manners benchmarks/src/resources/benchmarks/waltz benchmarks/src/rules benchmarks/src/rules/benchmarks benchmarks/src/rules/benchmarks/manners benchmarks/src/rules/benchmarks/waltz

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Oct 30 19:34:59 EST 2006


Author: mark.proctor at jboss.com
Date: 2006-10-30 19:33:08 -0500 (Mon, 30 Oct 2006)
New Revision: 7241

Added:
   labs/jbossrules/benchmarks/
   labs/jbossrules/benchmarks/build.xml
   labs/jbossrules/benchmarks/lib/
   labs/jbossrules/benchmarks/lib/antlr-2.7.6.jar
   labs/jbossrules/benchmarks/lib/antlr-3.0ea8.jar
   labs/jbossrules/benchmarks/lib/commons-io-1.1.jar
   labs/jbossrules/benchmarks/lib/commons-jci-core-1.0-406301.jar
   labs/jbossrules/benchmarks/lib/commons-jci-eclipse-3.2.0.666.jar
   labs/jbossrules/benchmarks/lib/commons-lang-2.1.jar
   labs/jbossrules/benchmarks/lib/commons-logging-api-1.0.4.jar
   labs/jbossrules/benchmarks/lib/core-3.2.0.666.jar
   labs/jbossrules/benchmarks/lib/drools-compiler-7240.jar
   labs/jbossrules/benchmarks/lib/drools-core-7240.jar
   labs/jbossrules/benchmarks/lib/stringtemplate-2.3b6.jar
   labs/jbossrules/benchmarks/src/
   labs/jbossrules/benchmarks/src/java/
   labs/jbossrules/benchmarks/src/java/benchmarks/
   labs/jbossrules/benchmarks/src/java/benchmarks/Benchmark.java
   labs/jbossrules/benchmarks/src/java/benchmarks/manners/
   labs/jbossrules/benchmarks/src/java/benchmarks/manners/Chosen.java
   labs/jbossrules/benchmarks/src/java/benchmarks/manners/Context.java
   labs/jbossrules/benchmarks/src/java/benchmarks/manners/Count.java
   labs/jbossrules/benchmarks/src/java/benchmarks/manners/DroolsManners.java
   labs/jbossrules/benchmarks/src/java/benchmarks/manners/Guest.java
   labs/jbossrules/benchmarks/src/java/benchmarks/manners/Hobby.java
   labs/jbossrules/benchmarks/src/java/benchmarks/manners/JessJavaBeanManners.java
   labs/jbossrules/benchmarks/src/java/benchmarks/manners/JessManners.java
   labs/jbossrules/benchmarks/src/java/benchmarks/manners/LastSeat.java
   labs/jbossrules/benchmarks/src/java/benchmarks/manners/MannersBenchmark.java
   labs/jbossrules/benchmarks/src/java/benchmarks/manners/Path.java
   labs/jbossrules/benchmarks/src/java/benchmarks/manners/Seating.java
   labs/jbossrules/benchmarks/src/java/benchmarks/manners/Sex.java
   labs/jbossrules/benchmarks/src/java/benchmarks/waltz/
   labs/jbossrules/benchmarks/src/java/benchmarks/waltz/DroolsWaltz.java
   labs/jbossrules/benchmarks/src/java/benchmarks/waltz/Edge.java
   labs/jbossrules/benchmarks/src/java/benchmarks/waltz/JessWaltz.java
   labs/jbossrules/benchmarks/src/java/benchmarks/waltz/Junction.java
   labs/jbossrules/benchmarks/src/java/benchmarks/waltz/Line.java
   labs/jbossrules/benchmarks/src/java/benchmarks/waltz/Make3Junction.java
   labs/jbossrules/benchmarks/src/java/benchmarks/waltz/Stage.java
   labs/jbossrules/benchmarks/src/java/benchmarks/waltz/WaltzBenchmark.java
   labs/jbossrules/benchmarks/src/java/benchmarks/waltz/WaltzFile.java
   labs/jbossrules/benchmarks/src/java/benchmarks/waltz/WaltzUtil.java
   labs/jbossrules/benchmarks/src/java/benchmarks/waltzdb/
   labs/jbossrules/benchmarks/src/java/benchmarks/waltzdb/EdgeLable.java
   labs/jbossrules/benchmarks/src/java/benchmarks/waltzdb/Label.java
   labs/jbossrules/benchmarks/src/java/benchmarks/waltzdb/Line.java
   labs/jbossrules/benchmarks/src/resources/
   labs/jbossrules/benchmarks/src/resources/benchmarks/
   labs/jbossrules/benchmarks/src/resources/benchmarks/manners/
   labs/jbossrules/benchmarks/src/resources/benchmarks/manners/manners128.dat
   labs/jbossrules/benchmarks/src/resources/benchmarks/waltz/
   labs/jbossrules/benchmarks/src/resources/benchmarks/waltz/waltz50.dat
   labs/jbossrules/benchmarks/src/rules/
   labs/jbossrules/benchmarks/src/rules/benchmarks/
   labs/jbossrules/benchmarks/src/rules/benchmarks/manners/
   labs/jbossrules/benchmarks/src/rules/benchmarks/manners/manners-javabean-withprints.clp
   labs/jbossrules/benchmarks/src/rules/benchmarks/manners/manners-javabean.clp
   labs/jbossrules/benchmarks/src/rules/benchmarks/manners/manners-withprints.drl
   labs/jbossrules/benchmarks/src/rules/benchmarks/manners/manners.clp
   labs/jbossrules/benchmarks/src/rules/benchmarks/manners/manners.drl
   labs/jbossrules/benchmarks/src/rules/benchmarks/waltz/
   labs/jbossrules/benchmarks/src/rules/benchmarks/waltz/waltz-withprints.clp
   labs/jbossrules/benchmarks/src/rules/benchmarks/waltz/waltz-withprints.drl
   labs/jbossrules/benchmarks/src/rules/benchmarks/waltz/waltz.clp
   labs/jbossrules/benchmarks/src/rules/benchmarks/waltz/waltz.drl
Log:


Added: labs/jbossrules/benchmarks/build.xml
===================================================================
--- labs/jbossrules/benchmarks/build.xml	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/build.xml	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,258 @@
+<project name="Drools" basedir="." xmlns:artifact="urn:maven-artifact-ant" default="help">
+    <property name="version"   value="3.1"/>                            
+    
+    <!--
+    drools.removeIdentities = <true|false>
+    drools.shareAlphaNodes  = <true|false>
+    drools.shareBetaNodes = <true|false>
+    drools.alphaMemory = <true/false>
+    drools.alphaNodeHashingThreshold = <1...n>
+    drools.compositeKeyDepth = <1..3>
+    drools.indexLeftBetaMemory = <true/false>
+    drools.indexRightBetaMemory = <true/false>
+    drools.assertBehaviour = <IDENTITY|EQUALITY>
+    drools.logicalOverride = <DISCARD|PRESERVE>
+    -->
+    
+    <target name="help">
+        <echo>usage:</echo>
+        <echo>run-drools-waltz50</echo>
+        <echo>run-drools-waltz50-withprints</echo>
+        <echo>run-drools-manners128</echo>
+        <echo>run-drools-manners128-withprints</echo>
+        <echo>run-drools-manners128-noLeftIndexing</echo>
+        <echo></echo>
+        <echo>run-jess-waltz50</echo>
+        <echo>run-jess-waltz50-withprints</echo>
+        <echo>run-jess-manners128</echo>
+        <echo>run-jess-manners128-withprints</echo>        
+        <echo>run-jess-javabean-manners128</echo>
+        <echo>run-jess-javabean-manners128-withprints</echo>
+		</target>
+
+		<target name="clean">
+      <delete>        
+        <fileset dir="target" includes="**/**"/>        
+      </delete>  		    
+		</target>
+
+    <target name="compile">
+      <mkdir dir="target"/>
+      <mkdir dir="target/classes"/>  
+      
+      <copy todir="target/classes">
+        <fileset dir="src/resources"/>
+        <fileset dir="src/rules"/>
+      </copy>                     
+     
+      <javac srcdir="src/java"
+             destdir="target/classes"
+             source="1.5">
+        <classpath>            
+          <fileset dir="lib">
+            <include name="*.jar"/>
+          </fileset>
+        </classpath>
+      </javac>                          
+    </target>  
+
+    <target name="run-drools-waltz50">                    
+      <java classname="benchmarks.waltz.WaltzBenchmark"
+      			fork="true">
+        <classpath>            
+          <pathelement path="target/classes" />            
+          <fileset dir="lib">
+            <include name="*.jar"/>
+          </fileset>
+        </classpath>
+        <arg value="drools"/>
+        <arg value="waltz.drl"/>
+        <arg value="waltz50.dat"/>
+        <jvmarg value="-Xmx512M" />
+        <jvmarg value="-Xms512M" />
+        <jvmarg value="-server" />
+      </java>                          
+    </target>         
+
+    <target name="run-drools-waltz50-withprints">                    
+      <java classname="benchmarks.waltz.WaltzBenchmark"
+      			fork="true">
+        <classpath>            
+          <pathelement path="target/classes" />            
+          <fileset dir="lib">
+            <include name="*.jar"/>
+          </fileset>
+        </classpath>
+        <arg value="drools"/>
+        <arg value="waltz-withprints.drl"/>
+        <arg value="waltz50.dat"/>
+        <jvmarg value="-Xmx512M" />
+        <jvmarg value="-Xms512M" />
+        <jvmarg value="-server" />
+      </java>                          
+    </target>         
+
+    <target name="run-drools-manners128">                    
+      <java classname="benchmarks.manners.MannersBenchmark"
+      			fork="true">
+        <classpath>            
+          <pathelement path="target/classes" />            
+          <fileset dir="lib">
+            <include name="*.jar"/>
+          </fileset>
+        </classpath>
+        <arg value="drools"/>
+        <arg value="manners.drl"/>       
+        <arg value="manners128.dat"/>  
+        <jvmarg value="-Xmx512M" />
+        <jvmarg value="-Xms512M" />
+        <jvmarg value="-server" />
+      </java>                          
+    </target> 
+    
+    <target name="run-drools-manners128-noLeftIndexing">                    
+      <java classname="benchmarks.manners.MannersBenchmark"
+      			fork="true">
+        <classpath>            
+          <pathelement path="target/classes" />            
+          <fileset dir="lib">
+            <include name="*.jar"/>
+          </fileset>
+        </classpath>
+        <arg value="drools"/>
+        <arg value="manners.drl"/>       
+        <arg value="manners128.dat"/>  
+        <sysproperty key="drools.indexLeftBetaMemory" value="false"/>
+        <jvmarg value="-Xmx512M" />
+        <jvmarg value="-Xms512M" />
+        <jvmarg value="-server" />
+      </java>                          
+    </target>                 
+    
+    <target name="run-drools-manners128-withprints">                    
+      <java classname="benchmarks.manners.MannersBenchmark"
+      			fork="true">
+        <classpath>            
+          <pathelement path="target/classes" />            
+          <fileset dir="lib">
+            <include name="*.jar"/>
+          </fileset>
+        </classpath>
+        <arg value="drools"/>
+        <arg value="manners-withprints.drl"/>       
+        <arg value="manners128.dat"/>  
+        <jvmarg value="-Xmx512M" />
+        <jvmarg value="-Xms512M" />
+        <jvmarg value="-server" />
+      </java>                          
+    </target>        
+
+    <target name="run-jess-waltz50">                    
+      <java classname="benchmarks.waltz.WaltzBenchmark"
+      			fork="true">
+        <classpath>            
+          <pathelement path="target/classes" />            
+          <fileset dir="lib">
+            <include name="*.jar"/>
+          </fileset>
+        </classpath>
+        <arg value="jess"/>
+        <arg value="waltz.clp"/>
+        <arg value="waltz50.dat"/>
+        <jvmarg value="-Xmx512M" />
+        <jvmarg value="-Xms512M" />
+        <jvmarg value="-server" />
+      </java>                          
+    </target>  
+    
+    <target name="run-jess-waltz50-withprints">                    
+      <java classname="benchmarks.waltz.WaltzBenchmark"
+      			fork="true">
+        <classpath>            
+          <pathelement path="target/classes" />            
+          <fileset dir="lib">
+            <include name="*.jar"/>
+          </fileset>
+        </classpath>
+        <arg value="jess"/>
+        <arg value="waltz-withprints.clp"/>
+        <arg value="waltz50.dat"/>
+        <jvmarg value="-Xmx512M" />
+        <jvmarg value="-Xms512M" />
+        <jvmarg value="-server" />
+      </java>                          
+    </target>      
+        
+        
+    <target name="run-jess-manners128">                    
+      <java classname="benchmarks.manners.MannersBenchmark"
+      			fork="true">
+        <classpath>            
+          <pathelement path="target/classes" />            
+          <fileset dir="lib">
+            <include name="*.jar"/>
+          </fileset>
+        </classpath>
+        <arg value="jess"/>
+        <arg value="manners.clp"/>       
+        <arg value="manners128.dat"/>  
+        <jvmarg value="-Xmx512M" />
+        <jvmarg value="-Xms512M" />
+        <jvmarg value="-server" />
+      </java>                          
+    </target>              
+    
+    <target name="run-jess-manners128-withprints">                    
+      <java classname="benchmarks.manners.MannersBenchmark"
+      			fork="true">
+        <classpath>            
+          <pathelement path="target/classes" />            
+          <fileset dir="lib">
+            <include name="*.jar"/>
+          </fileset>
+        </classpath>
+        <arg value="jess"/>
+        <arg value="manners-withprints.clp"/>       
+        <arg value="manners128.dat"/>  
+        <jvmarg value="-Xmx512M" />
+        <jvmarg value="-Xms512M" />
+        <jvmarg value="-server" />
+      </java>                          
+    </target>  
+    
+    <target name="run-jess-javabean-manners128">                    
+      <java classname="benchmarks.manners.MannersBenchmark"
+      			fork="true">
+        <classpath>            
+          <pathelement path="target/classes" />            
+          <fileset dir="lib">
+            <include name="*.jar"/>
+          </fileset>
+        </classpath>
+        <arg value="jess-javabean"/>
+        <arg value="manners-javabean.clp"/>       
+        <arg value="manners128.dat"/>  
+        <jvmarg value="-Xmx512M" />
+        <jvmarg value="-Xms512M" />
+        <jvmarg value="-server" />
+      </java>                          
+    </target>   
+    
+    <target name="run-jess-javabean-manners128-withprints">                    
+      <java classname="benchmarks.manners.MannersBenchmark"
+      			fork="true">
+        <classpath>            
+          <pathelement path="target/classes" />            
+          <fileset dir="lib">
+            <include name="*.jar"/>
+          </fileset>
+        </classpath>
+        <arg value="jess-javabean"/>
+        <arg value="manners-javabean-withprints.clp"/>  
+        <arg value="manners128.dat"/>  
+        <jvmarg value="-Xmx512M" />
+        <jvmarg value="-Xms512M" />
+        <jvmarg value="-server" />
+      </java>                          
+    </target>                     
+</project>

Added: labs/jbossrules/benchmarks/lib/antlr-2.7.6.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossrules/benchmarks/lib/antlr-2.7.6.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossrules/benchmarks/lib/antlr-3.0ea8.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossrules/benchmarks/lib/antlr-3.0ea8.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossrules/benchmarks/lib/commons-io-1.1.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossrules/benchmarks/lib/commons-io-1.1.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossrules/benchmarks/lib/commons-jci-core-1.0-406301.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossrules/benchmarks/lib/commons-jci-core-1.0-406301.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossrules/benchmarks/lib/commons-jci-eclipse-3.2.0.666.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossrules/benchmarks/lib/commons-jci-eclipse-3.2.0.666.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossrules/benchmarks/lib/commons-lang-2.1.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossrules/benchmarks/lib/commons-lang-2.1.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossrules/benchmarks/lib/commons-logging-api-1.0.4.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossrules/benchmarks/lib/commons-logging-api-1.0.4.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossrules/benchmarks/lib/core-3.2.0.666.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossrules/benchmarks/lib/core-3.2.0.666.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossrules/benchmarks/lib/drools-compiler-7240.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossrules/benchmarks/lib/drools-compiler-7240.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossrules/benchmarks/lib/drools-core-7240.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossrules/benchmarks/lib/drools-core-7240.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossrules/benchmarks/lib/stringtemplate-2.3b6.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossrules/benchmarks/lib/stringtemplate-2.3b6.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossrules/benchmarks/src/java/benchmarks/Benchmark.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/Benchmark.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/Benchmark.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,17 @@
+package benchmarks;
+
+import java.util.List;
+
+import benchmarks.BaseBenchmark.Stats;
+
+public interface Benchmark {
+
+    public void init(String fileName, boolean buildStats) throws Exception;
+
+    public Stats getStats();
+    
+    public void assertObjects(String fileName) throws Exception;
+
+    public void fireAllRules() throws Exception;
+
+}
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/java/benchmarks/manners/Chosen.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/manners/Chosen.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/manners/Chosen.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,57 @@
+package benchmarks.manners;
+
+/*
+ * Copyright 2005 JBoss Inc
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.Serializable;
+
+public class Chosen
+    implements
+    Serializable {
+
+    private int    id;
+
+    private String guestName;
+
+    private Hobby  hobby;
+        
+    public Chosen() {
+    }
+
+    public Chosen(int id,
+                  String guestName,
+                  Hobby hobby) {
+        this.id = id;
+        this.guestName = guestName;
+        this.hobby = hobby;
+    }
+
+    public int getId() {
+        return this.id;
+    }
+
+    public String getGuestName() {
+        return this.guestName;
+    }
+
+    public Hobby getHobby() {
+        return this.hobby;
+    }
+
+    public String toString() {
+        return "{Chosen id=" + this.id + ", name=" + this.guestName + ", hobbies=" + this.hobby + "}";
+    }
+}
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/java/benchmarks/manners/Context.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/manners/Context.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/manners/Context.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,79 @@
+package benchmarks.manners;
+/*
+ * Copyright 2005 JBoss Inc
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+
+
+import java.io.Serializable;
+
+public class Context
+    implements
+    Serializable {
+
+    public static int START_UP      = 0;
+    public static int ASSIGN_SEATS  = 1;
+    public static int MAKE_PATH     = 2;
+    public static int CHECK_DONE    = 3;
+    public static int PRINT_RESULTS = 4;
+    
+    public static String[] stateStrings = {
+                                  "START_UP",
+                                  "ASSIGN_SEATS",
+                                  "MAKE_PATH",
+                                  "CHECK_DONE",
+                                  "PRINT_RESULTS"
+    };
+
+    private int             state;
+
+    public Context() {
+        
+    }
+    
+    public Context(String state) {
+        if ( "\"startup\"".equals( state ) ) {
+            this.state = Context.START_UP;
+        } else {
+            throw new RuntimeException( "Context '" + state + "' does not exist for Context Enum" );
+        }
+    }
+
+    public Context(int state) {
+        this.state = state;
+    }
+
+    public void setState(int state) {
+        this.state = state;
+    }
+
+    public boolean isState(int state) {
+        return this.state == state;
+    }
+
+    public int getState() {
+        return this.state;
+    }
+
+    public String getStringValue() {
+        return stateStrings[this.state];
+    }
+
+    public String toString() {
+        return "[Context state=" + getStringValue() + "]";
+    }
+}
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/java/benchmarks/manners/Count.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/manners/Count.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/manners/Count.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,43 @@
+package benchmarks.manners;
+/*
+ * Copyright 2005 JBoss Inc
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+public class Count {
+    private int value;
+
+    public Count() {
+        
+    }
+    public Count(int value) {
+        super();
+        this.value = value;
+    }
+
+    public int getValue() {
+        return this.value;
+    }
+
+    public void setValue(int value) {
+        this.value = value;
+    }
+
+    public String toString() {
+        return "[Count value=" + this.value + "]";
+    }
+
+}
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/java/benchmarks/manners/DroolsManners.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/manners/DroolsManners.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/manners/DroolsManners.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,133 @@
+package benchmarks.manners;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+import org.drools.RuleBase;
+import org.drools.RuleBaseFactory;
+import org.drools.WorkingMemory;
+import org.drools.compiler.PackageBuilder;
+import org.drools.event.ActivationCancelledEvent;
+import org.drools.event.ActivationCreatedEvent;
+import org.drools.event.AfterActivationFiredEvent;
+import org.drools.event.AgendaEventListener;
+import org.drools.event.DefaultAgendaEventListener;
+import org.drools.rule.Package;
+
+import benchmarks.Benchmark;
+import benchmarks.BaseBenchmark.Stats;
+
+public class DroolsManners
+    implements
+    Benchmark {
+
+    private WorkingMemory workingMemory;
+    private final Stats stats  = new Stats();
+
+    public void init(String fileName, boolean buildStats) throws Exception {
+        PackageBuilder builder = new PackageBuilder();
+        builder.addPackageFromDrl( new InputStreamReader( DroolsManners.class.getResourceAsStream( fileName ) ) );
+        Package pkg = builder.getPackage();
+
+        RuleBase ruleBase = RuleBaseFactory.newRuleBase();
+        ruleBase.addPackage( pkg );
+        workingMemory = ruleBase.newWorkingMemory();
+                
+        
+        AgendaEventListener listener = new DefaultAgendaEventListener() {
+            public void activationCreated(ActivationCreatedEvent event,
+                                          WorkingMemory workingMemory) {
+                stats.created( event.getActivation().getRule().getName() );
+            }
+            
+            public void activationCancelled(ActivationCancelledEvent event,
+                                            WorkingMemory workingMemory) {
+                stats.cancelled( event.getActivation().getRule().getName() );
+            }           
+            
+            public void afterActivationFired(AfterActivationFiredEvent event,
+                                             WorkingMemory workingMemory) {
+                stats.fired( event.getActivation().getRule().getName() );
+            }            
+        };
+        
+        if( buildStats ) {
+            workingMemory.addEventListener( listener );
+        }
+    }   
+    
+    public Stats getStats() {
+        return this.stats;
+    }
+    
+    public void assertObjects(String fileName) throws Exception {
+        loadLines( this.workingMemory,
+                   fileName );
+    }
+
+    public void fireAllRules() throws Exception {
+        workingMemory.fireAllRules();
+    }
+
+    private void loadLines(WorkingMemory wm,
+                           String filename) throws IOException {
+        BufferedReader br = new BufferedReader( new InputStreamReader( DroolsManners.class.getResourceAsStream( filename ) ) );
+
+        String line;
+        while ( (line = br.readLine()) != null ) {
+            if ( line.trim().length() == 0 || line.trim().startsWith( ";" ) ) {
+                continue;
+            }
+            StringTokenizer st = new StringTokenizer( line,
+                                                      "() " );
+            String type = st.nextToken();
+
+            if ( "guest".equals( type ) ) {
+                if ( !"name".equals( st.nextToken() ) ) {
+                    throw new IOException( "expected 'name' in: " + line );
+                }
+                String name = st.nextToken();
+                if ( !"sex".equals( st.nextToken() ) ) {
+                    throw new IOException( "expected 'sex' in: " + line );
+                }
+                String sex = st.nextToken();
+                if ( !"hobby".equals( st.nextToken() ) ) {
+                    throw new IOException( "expected 'hobby' in: " + line );
+                }
+                String hobby = st.nextToken();
+
+                Guest guest = new Guest( name,
+                                         Sex.resolve( sex ),
+                                         Hobby.resolve( hobby ) );
+
+                wm.assertObject( guest );
+            }
+
+            if ( "last_seat".equals( type ) ) {
+                if ( !"seat".equals( st.nextToken() ) ) {
+                    throw new IOException( "expected 'seat' in: " + line );
+                }
+                wm.assertObject( new LastSeat( new Integer( st.nextToken() ).intValue() ) );
+            }
+
+            if ( "context".equals( type ) ) {
+                if ( !"name".equals( st.nextToken() ) ) {
+                    throw new IOException( "expected 'state' in: " + line );
+                }
+                wm.assertObject( new Context( st.nextToken() ) );
+            }
+            
+            if ( "count".equals( type ) ) {
+                if ( !"c".equals( st.nextToken() ) ) {
+                    throw new IOException( "expected 'value' in: " + line );
+                }
+                wm.assertObject( new Count( new Integer( st.nextToken() ).intValue() ) );
+            }            
+        }
+        br.close();
+    }
+}
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/java/benchmarks/manners/Guest.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/manners/Guest.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/manners/Guest.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,60 @@
+package benchmarks.manners;
+/*
+ * Copyright 2005 JBoss Inc
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+
+
+import java.io.Serializable;
+
+public class Guest
+    implements
+    Serializable {
+    private String name;
+
+    private Sex    sex;
+
+    private Hobby  hobby;
+
+    public Guest() {
+        
+    }
+    
+    public Guest(String name,
+                 Sex sex,
+                 Hobby hobby) {
+        this.name = name;
+        this.sex = sex;
+        this.hobby = hobby;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public Hobby getHobby() {
+        return this.hobby;
+    }
+
+    public Sex getSex() {
+        return this.sex;
+    }
+
+    public String toString() {
+        return "[Guest name=" + this.name + ", sex=" + this.sex + ", hobbies=" + this.hobby + "]";
+    }
+}
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/java/benchmarks/manners/Hobby.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/manners/Hobby.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/manners/Hobby.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,85 @@
+package benchmarks.manners;
+/*
+ * Copyright 2005 JBoss Inc
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+public class Hobby {
+    public static String stringH1 = "h1";
+    public static String stringH2 = "h2";
+    public static String stringH3 = "h3";
+    public static String stringH4 = "h4";
+    public static String stringH5 = "h5";
+    
+    public static String[] hobbyStrings = new String[] {
+                                                 stringH1, 
+                                                 stringH2,
+                                                 stringH3,
+                                                 stringH4,
+                                                 stringH5
+    };
+
+    public static Hobby  H1       = new Hobby( 1 );
+    public static Hobby  H2       = new Hobby( 2 );
+    public static Hobby  H3       = new Hobby( 3 );
+    public static Hobby  H4       = new Hobby( 4 );
+    public static Hobby  H5       = new Hobby( 5 );
+
+    private String         hobbyStr;
+    private int            hobbyIndex; 
+    
+
+    private Hobby() {
+        
+    }
+    private Hobby(int hobby) {
+        this.hobbyIndex = hobby-1;
+        this.hobbyStr = hobbyStrings[this.hobbyIndex];
+    }
+
+    public String getHobby() {
+        return this.hobbyStr;
+    }
+
+    public static Hobby resolve(String hobby) {
+        if ( stringH1.equals( hobby ) ) {
+            return Hobby.H1;
+        } else if ( stringH2.equals( hobby ) ) {
+            return Hobby.H2;
+        } else if ( stringH3.equals( hobby ) ) {
+            return Hobby.H3;
+        } else if ( stringH4.equals( hobby ) ) {
+            return Hobby.H4;
+        } else if ( stringH5.equals( hobby ) ) {
+            return Hobby.H5;
+        } else {
+            throw new RuntimeException( "Hobby '" + hobby + "' does not exist for Hobby Enum" );
+        }
+    }
+
+    public String toString() {
+        return getHobby();
+    }
+
+    public boolean equals(Object object) {
+        return (this == object);
+    }
+
+    public int hashCode() {
+        return this.hobbyIndex;
+    }
+
+}
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/java/benchmarks/manners/JessJavaBeanManners.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/manners/JessJavaBeanManners.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/manners/JessJavaBeanManners.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,103 @@
+package benchmarks.manners;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.StringTokenizer;
+
+import org.drools.WorkingMemory;
+
+import benchmarks.Benchmark;
+import benchmarks.BaseBenchmark.Stats;
+
+import jess.Funcall;
+import jess.RU;
+import jess.Rete;
+import jess.Value;
+
+public class JessJavaBeanManners
+    implements
+    Benchmark {    
+    Rete rete = new Rete();
+
+    public void init(String fileName, boolean buildStats) throws Exception {
+        rete.executeCommand("(clear)");
+        rete.executeCommand("(batch \"benchmarks/manners/"+fileName+"\")");
+        rete.executeCommand("(reset)");
+    }
+
+    public void assertObjects(String fileName) throws Exception {
+        loadLines( this.rete,
+                   fileName );
+    }
+    
+    public Stats getStats() {
+        return null;
+    }
+
+    public void fireAllRules() throws Exception {
+        rete.executeCommand( "(run)" );
+    }
+
+    private void loadLines(Rete rete,
+                           String filename) throws Exception {
+        BufferedReader br = new BufferedReader( new InputStreamReader( DroolsManners.class.getResourceAsStream( filename ) ) );
+
+        String line;
+        while ( (line = br.readLine()) != null ) {
+            if ( line.trim().length() == 0 || line.trim().startsWith( ";" ) ) {
+                continue;
+            }
+            StringTokenizer st = new StringTokenizer( line,
+                                                      "() " );
+            String type = st.nextToken();
+            
+            if ( "guest".equals( type ) ) {
+                if ( !"name".equals( st.nextToken() ) ) {
+                    throw new IOException( "expected 'name' in: " + line );
+                }
+                String name = st.nextToken();
+                if ( !"sex".equals( st.nextToken() ) ) {
+                    throw new IOException( "expected 'sex' in: " + line );
+                }
+                String sex = st.nextToken();
+                if ( !"hobby".equals( st.nextToken() ) ) {
+                    throw new IOException( "expected 'hobby' in: " + line );
+                }
+                String hobby = st.nextToken();
+
+                Guest guest = new Guest( name,
+                                         Sex.resolve( sex ),
+                                         Hobby.resolve( hobby ) );
+
+                rete.definstance( "guest", guest,  false );            
+            }
+
+            if ( "last_seat".equals( type ) ) {
+                if ( !"seat".equals( st.nextToken() ) ) {
+                    throw new IOException( "expected 'seat' in: " + line );
+                }
+                LastSeat seat =  new LastSeat( new Integer( st.nextToken() ).intValue() );
+                rete.definstance( "last_seat", seat,  false );
+            }
+
+            if ( "context".equals( type ) ) {
+                if ( !"name".equals( st.nextToken() ) ) {
+                    throw new IOException( "expected 'state' in: " + line );
+                }
+                Context context = new Context( st.nextToken() );
+                rete.definstance( "context", context,  false );              
+            }
+            
+            if ( "count".equals( type ) ) {
+                if ( !"c".equals( st.nextToken() ) ) {
+                    throw new IOException( "expected 'value' in: " + line );
+                }
+                Count count = new Count( new Integer( st.nextToken() ).intValue() );
+                rete.definstance( "count", count,  false );
+            }            
+        }
+        br.close();
+    }    
+
+}
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/java/benchmarks/manners/JessManners.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/manners/JessManners.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/manners/JessManners.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,32 @@
+package benchmarks.manners;
+
+import benchmarks.Benchmark;
+import benchmarks.BaseBenchmark.Stats;
+
+import jess.Rete;
+
+public class JessManners
+    implements
+    Benchmark {    
+    Rete rete = new Rete();
+
+    public void init(String fileName, boolean buildStats) throws Exception {
+        rete.executeCommand("(clear)");
+        rete.executeCommand("(batch \"benchmarks/manners/"+fileName+"\")");
+        rete.executeCommand("(reset)");
+    }
+    
+    public Stats getStats() {
+        return null;
+    }
+
+    public void assertObjects(String fileName) throws Exception {
+        rete.executeCommand("(load-facts \"benchmarks/manners/" + fileName + "\")");
+    }
+
+    public void fireAllRules() throws Exception {
+        rete.executeCommand( "(run)" );
+    }
+
+
+}
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/java/benchmarks/manners/LastSeat.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/manners/LastSeat.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/manners/LastSeat.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,44 @@
+package benchmarks.manners;
+/*
+ * Copyright 2005 JBoss Inc
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+
+
+import java.io.Serializable;
+
+public class LastSeat
+    implements
+    Serializable {
+    private int seat;
+
+    public LastSeat() {
+        
+    }
+    
+    public LastSeat(int seat) {
+        this.seat = seat;
+    }
+
+    public int getSeat() {
+        return this.seat;
+    }
+
+    public String toString() {
+        return "[LastSeat seat=" + this.seat + "]";
+    }
+}
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/java/benchmarks/manners/MannersBenchmark.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/manners/MannersBenchmark.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/manners/MannersBenchmark.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,34 @@
+package benchmarks.manners;
+
+import benchmarks.BaseBenchmark;
+import benchmarks.Benchmark;
+import benchmarks.waltz.DroolsWaltz;
+import benchmarks.waltz.JessWaltz;
+
+/**
+ * This is a sample file to launch a rule package from a rule source file.
+ */
+public class MannersBenchmark extends BaseBenchmark {
+    public void help() {
+        System.out.println("USAGE: java benchmark.manners.MannersBenchmark <engine> <ruleFile> <ruleData>");
+        System.exit( 0 );
+    }
+    
+    
+    public Benchmark initEngine(String engine) {
+        Benchmark benchmark = null;
+        if  ( engine.equals( "drools" ) ) {
+            benchmark = new DroolsManners();
+        } else if ( engine.equals( "jess" ) ) {
+            benchmark = new JessManners();
+        }  else if ( engine.equals( "jess-javabean" ) ) {
+            benchmark = new JessJavaBeanManners();
+        }      
+        return benchmark;
+    }
+    
+    public static void main(String[] args) {
+        MannersBenchmark benchmark = new MannersBenchmark();
+        benchmark.run( args );
+    }
+}

Added: labs/jbossrules/benchmarks/src/java/benchmarks/manners/Path.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/manners/Path.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/manners/Path.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,52 @@
+package benchmarks.manners;
+/*
+ * Copyright 2005 JBoss Inc
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+public class Path {
+    private int    id;
+    private String guestName;
+    private int    seat;
+
+    public Path() {
+        
+    }
+    public Path(int id,
+                int seat,
+                String guestName) {
+        this.id = id;
+        this.seat = seat;
+        this.guestName = guestName;
+    }
+
+    public int getSeat() {
+        return this.seat;
+    }
+
+    public String getGuestName() {
+        return this.guestName;
+    }
+
+    public int getId() {
+        return this.id;
+    }
+
+    public String toString() {
+        return "[Path id=" + this.id + ", seat=" + this.seat + ", guest=" + this.guestName + "]";
+    }
+
+}
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/java/benchmarks/manners/Seating.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/manners/Seating.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/manners/Seating.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,89 @@
+package benchmarks.manners;
+
+/*
+ * Copyright 2005 JBoss Inc
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.Serializable;
+
+public class Seating
+    implements
+    Serializable {
+    private int id, pid;
+
+    private int leftSeat, rightSeat;
+
+    private String leftGuestName, rightGuestName;
+
+    private boolean      pathDone;
+
+    public Seating() {
+        
+    }
+    
+    public Seating(int id,
+                   int pid,
+                   boolean pathDone,
+                   int leftSeat,
+                   String leftGuestName,
+                   int rightSeat,
+                   String rightGuestName) {
+        super();
+        this.id = id;
+        this.pid = pid;
+        this.pathDone = pathDone;
+        this.leftSeat = leftSeat;
+        this.leftGuestName = leftGuestName;
+        this.rightSeat = rightSeat;
+        this.rightGuestName = rightGuestName;
+    }
+
+    public boolean isPathDone() {
+        return this.pathDone;
+    }
+
+    public void setPathDone(boolean pathDone) {
+        this.pathDone = pathDone;
+    }
+
+    public int getId() {
+        return this.id;
+    }
+
+    public String getLeftGuestName() {
+        return this.leftGuestName;
+    }
+
+    public int getLeftSeat() {
+        return this.leftSeat;
+    }
+
+    public int getPid() {
+        return this.pid;
+    }
+
+    public String getRightGuestName() {
+        return this.rightGuestName;
+    }
+
+    public int getRightSeat() {
+        return this.rightSeat;
+    }
+
+    public String toString() {
+        return "[Seating id=" + this.id + " , pid=" + this.pid + " , pathDone=" + this.pathDone + " , leftSeat=" + this.leftSeat + ", leftGuestName=" + this.leftGuestName + ", rightSeat=" + this.rightSeat + ", rightGuestName=" + this.rightGuestName
+               + "]";
+    }
+}
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/java/benchmarks/manners/Sex.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/manners/Sex.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/manners/Sex.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,64 @@
+package benchmarks.manners;
+/*
+ * Copyright 2005 JBoss Inc
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+public class Sex {
+    public static Sex    M       = new Sex( 0 );
+    public static Sex    F       = new Sex( 1 );
+
+    public static String stringM = "m";
+    public static String stringF = "f";
+    public static String[] sexList = new String[] { stringM, stringF };
+
+    private int          sex;
+
+    private Sex() {
+        
+    }
+    
+    private Sex(int sex) {
+        this.sex = sex;
+    }
+
+    public String getSex() {
+        return sexList[this.sex];
+    }
+
+    public static Sex resolve(String sex) {
+        if ( stringM.equals( sex ) ) {
+            return Sex.M;
+        } else if ( stringF.equals( sex ) ) {
+            return Sex.F;
+        } else {
+            throw new RuntimeException( "Sex '" + sex + "' does not exist for Sex Enum" );
+        }
+    }
+
+    public String toString() {
+        return getSex();
+    }
+
+    public boolean equals(Object object) {
+        return this == object;
+    }
+
+    public int hashCode() {
+        return this.sex;
+    }
+
+}
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/java/benchmarks/waltz/DroolsWaltz.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/waltz/DroolsWaltz.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/waltz/DroolsWaltz.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,119 @@
+package benchmarks.waltz;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.StringTokenizer;
+
+import org.drools.RuleBase;
+import org.drools.RuleBaseFactory;
+import org.drools.WorkingMemory;
+import org.drools.compiler.PackageBuilder;
+import org.drools.event.ActivationCancelledEvent;
+import org.drools.event.ActivationCreatedEvent;
+import org.drools.event.AfterActivationFiredEvent;
+import org.drools.event.AgendaEventListener;
+import org.drools.event.DefaultAgendaEventListener;
+import org.drools.rule.Package;
+
+import benchmarks.Benchmark;
+import benchmarks.BaseBenchmark.Stats;
+import benchmarks.manners.Context;
+import benchmarks.manners.DroolsManners;
+
+public class DroolsWaltz
+    implements
+    Benchmark {
+        
+    private WorkingMemory workingMemory;
+    private final Stats stats  = new Stats();
+
+    public void init(String fileName, boolean buildStats) throws Exception {
+        PackageBuilder builder = new PackageBuilder();
+        builder.addPackageFromDrl( new InputStreamReader( DroolsWaltz.class.getResourceAsStream( fileName ) ) );
+        Package pkg = builder.getPackage();
+
+        RuleBase ruleBase = RuleBaseFactory.newRuleBase();
+        ruleBase.addPackage( pkg );
+        workingMemory = ruleBase.newWorkingMemory();
+                
+        
+        AgendaEventListener listener = new DefaultAgendaEventListener() {
+            public void activationCreated(ActivationCreatedEvent event,
+                                          WorkingMemory workingMemory) {
+                stats.created( event.getActivation().getRule().getName() );
+            }
+            
+            public void activationCancelled(ActivationCancelledEvent event,
+                                            WorkingMemory workingMemory) {
+                stats.cancelled( event.getActivation().getRule().getName() );
+            }           
+            
+            public void afterActivationFired(AfterActivationFiredEvent event,
+                                             WorkingMemory workingMemory) {
+                stats.fired( event.getActivation().getRule().getName() );
+            }            
+        };
+        
+        if( buildStats ) {
+            workingMemory.addEventListener( listener );
+        }
+    }   
+    
+    public Stats getStats() {
+        return this.stats;
+    }
+
+    public void assertObjects(String file) throws Exception {
+        loadLines( this.workingMemory,
+                   file );  
+    }
+
+    public void fireAllRules() throws Exception {
+        workingMemory.fireAllRules();
+    }
+
+    private void loadLines(final WorkingMemory wm,
+                           final String filename) throws IOException {
+      final BufferedReader br = new BufferedReader( new InputStreamReader( DroolsWaltz.class.getResourceAsStream( filename ) ) );
+
+        String textLine;
+        while ( (textLine = br.readLine()) != null ) {
+            if ( textLine.trim().length() == 0 || textLine.trim().startsWith( ";" ) ) {
+                continue;
+            }
+            final StringTokenizer st = new StringTokenizer( textLine,
+                                                            "() " );
+            final String type = st.nextToken();
+
+            if ( "line".equals( type ) ) {
+                Line line = new Line();
+                String  field = st.nextToken();
+                if ( field.equals( "p1" ) ){
+                    String value = st.nextToken(); 
+                    line.setP1( Integer.parseInt( value ) );
+                } 
+                
+                field = st.nextToken();
+                if ( field.equals( "p2" ) ) {
+                    String value = st.nextToken();
+                    line.setP2( Integer.parseInt( value ) );
+                } 
+
+                wm.assertObject( line );
+            }
+
+            if ( "stage".equals( type ) ) {
+                if ( !"value".equals( st.nextToken() ) ) {
+                    throw new IOException( "expected 'value' in: " + textLine );
+                }
+                String value = st.nextToken();
+                if ( "duplicate".equals( value ) ) {
+                    wm.assertObject( new Stage( Stage.DUPLICATE ) );
+                }
+            }
+        }
+        br.close();
+
+    }
+}
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/java/benchmarks/waltz/Edge.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/waltz/Edge.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/waltz/Edge.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,102 @@
+package benchmarks.waltz;
+
+
+/*
+ * Copyright 2005 JBoss Inc
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author Alexander Bagerman
+ * 
+ */
+public class Edge {
+    private int                p1;
+
+    private int                p2;
+
+    private boolean            joined;
+
+    private String             label;
+
+    private boolean            plotted;
+
+    final public static String NIL   = "NILL";
+
+    final public static String B     = "B";
+
+    final public static String PLUS  = "+";
+
+    final public static String MINUS = "-";
+
+    public Edge() {
+        
+    }
+    
+    public Edge(final int p1,
+                final int p2,
+                final boolean joined,
+                final String label,
+                final boolean plotted) {
+        this.p1 = p1;
+        this.p2 = p2;
+        this.joined = joined;
+        this.label = label;
+        this.plotted = plotted;
+    }
+
+    public int getP1() {
+        return this.p1;
+    }
+
+    public void setP1(final int p1) {
+        this.p1 = p1;
+    }
+
+    public int getP2() {
+        return this.p2;
+    }
+
+    public void setP2(final int p2) {
+        this.p2 = p2;
+    }
+
+    public String toString() {
+        return "( Edge p1=" + this.p1 + ", p2=" + this.p2 + ", joined=" + this.joined + ", label=" + this.label + ", plotted=" + this.plotted + " )";
+    }
+
+    public boolean isJoined() {
+        return this.joined;
+    }
+
+    public void setJoined(final boolean joined) {
+        this.joined = joined;
+    }
+
+    public String getLabel() {
+        return this.label;
+    }
+
+    public void setLabel(final String label) {
+        this.label = label;
+    }
+
+    public boolean getPlotted() {
+        return this.plotted;
+    }
+
+    public void setPlotted(final boolean plotted) {
+        this.plotted = plotted;
+    }
+}
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/java/benchmarks/waltz/JessWaltz.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/waltz/JessWaltz.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/waltz/JessWaltz.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,42 @@
+package benchmarks.waltz;
+
+import java.util.Iterator;
+import java.util.List;
+
+import benchmarks.Benchmark;
+import benchmarks.BaseBenchmark.Stats;
+
+import jess.Funcall;
+import jess.RU;
+import jess.Rete;
+import jess.Value;
+
+public class JessWaltz
+    implements
+    Benchmark {
+    
+    Rete rete = new Rete();
+
+    public void init(String fileName, boolean buildStats) throws Exception {
+        WaltzFile file = new WaltzFile();
+        file.add( this.rete );        
+        rete.executeCommand("(clear)");
+        rete.executeCommand("(batch \"benchmarks/waltz/"+fileName+"\")");
+        rete.executeCommand("(reset)");
+
+    }
+    
+    public Stats getStats() {
+        return null;
+    }
+
+    public void assertObjects(String fileName) throws Exception {
+        rete.executeCommand("(load-facts \"benchmarks/waltz/" + fileName + "\")");
+    }
+
+    public void fireAllRules() throws Exception {
+        rete.executeCommand( "(run)" );
+    }
+
+
+}
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/java/benchmarks/waltz/Junction.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/waltz/Junction.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/waltz/Junction.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,103 @@
+package benchmarks.waltz;
+
+
+/*
+ * Copyright 2005 JBoss Inc
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author Alexander Bagerman
+ * 
+ */
+
+public class Junction {
+    public static String TEE   = "tee";
+
+    public static String FORK  = "fork";
+
+    public static String ARROW = "arrow";
+
+    public static String L     = "L";
+
+    private int          p1;
+
+    private int          p2;
+
+    private int          p3;
+
+    private int          basePoint;
+
+    private String       type;
+    
+    public Junction() {
+        
+    }
+    
+    public Junction(final int p1,
+                    final int p2,
+                    final int p3,
+                    final int basePoint,
+                    final String type) {
+        this.p1 = p1;
+        this.p2 = p2;
+        this.p3 = p3;
+        this.basePoint = basePoint;
+        this.type = type;
+    }
+
+    public int getP1() {
+        return this.p1;
+    }
+
+    public void setP1(final int p1) {
+        this.p1 = p1;
+    }
+
+    public int getP2() {
+        return this.p2;
+    }
+
+    public void setP2(final int p2) {
+        this.p2 = p2;
+    }
+
+    public String toString() {
+        return "{Junction p1=" + this.p1 + ", p2=" + this.p2 + ", p3=" + this.p3 + ", basePoint=" + this.basePoint + ", type=" + this.type + "}";
+    }
+
+    public int getBasePoint() {
+        return this.basePoint;
+    }
+
+    public void setBasePoint(final int basePoint) {
+        this.basePoint = basePoint;
+    }
+
+    public int getP3() {
+        return this.p3;
+    }
+
+    public void setP3(final int p3) {
+        this.p3 = p3;
+    }
+
+    public String getType() {
+        return this.type;
+    }
+
+    public void setType(final String type) {
+        this.type = type;
+    }
+}
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/java/benchmarks/waltz/Line.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/waltz/Line.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/waltz/Line.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,59 @@
+package benchmarks.waltz;
+
+
+/*
+ * Copyright 2005 JBoss Inc
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author Alexander Bagerman
+ * 
+ */
+
+public class Line {
+    private int p1;
+
+    private int p2;
+
+    public Line() {
+        
+    }
+    
+    public Line(final int p1,
+                final int p2) {
+        this.p1 = p1;
+        this.p2 = p2;
+    }
+
+    public int getP1() {
+        return this.p1;
+    }
+
+    public void setP1(final int p1) {
+        this.p1 = p1;
+    }
+
+    public int getP2() {
+        return this.p2;
+    }
+
+    public void setP2(final int p2) {
+        this.p2 = p2;
+    }
+
+    public String toString() {
+        return "{Line p1=" + this.p1 + ", p2=" + this.p2 + "}";
+    }
+}
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/java/benchmarks/waltz/Make3Junction.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/waltz/Make3Junction.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/waltz/Make3Junction.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,151 @@
+package benchmarks.waltz;
+import jess.*;
+
+public class Make3Junction implements Userfunction {
+    private static final int MOD_NUM = 10000;
+    private int p1_offset, p2_offset, p3_offset;
+    private int type_off, bp_off;
+    private String tee = "tee", fork = "fork", arrow = "arrow";
+    
+    Make3Junction() {        
+	p1_offset = 2 ;
+	p2_offset = 3 ;
+	p3_offset = 4 ;
+	bp_off = 5 ;
+	type_off = 6 ;
+    }
+
+    private int get_y(int val) {
+        return val % MOD_NUM;
+    }
+    private int get_x(int val) {
+        return (int) (val / MOD_NUM);
+    }
+
+    /**********************************************************************
+     * This function is passed two points and calculates the angle between the
+     * line defined by these points and the x-axis.
+     **********************************************************************/
+    private double get_angle(int p1, int p2) {
+        /* Calculate (x2 - x1) and (y2 - y1).  The points are passed in the
+         * form x1y1 and x2y2.  get_x() and get_y() are passed these points
+         * and return the x and y values respectively.  For example,
+         * get_x(1020) returns 10. */
+        int delta_x = get_x(p2) - get_x(p1);
+        int delta_y = get_y(p2) - get_y(p1);
+        
+        if (delta_x == 0) {
+            if (delta_y > 0)
+                return(Math.PI/2);
+            else if (delta_y < 0)
+                return(-Math.PI/2);
+        }
+        else if (delta_y == 0) {
+            if (delta_x > 0)
+                return(0.0);
+            else if (delta_x < 0)
+                return(Math.PI);
+        }
+        
+        return(Math.atan2((double) delta_y, (double) delta_x));
+    }
+    
+    /**********************************************************************
+     * This procedure is passed the basepoint of the intersection of two lines
+     * as well as the other two endpoints of the lines and calculates the
+     * angle inscribed by these three points.
+     **********************************************************************/
+    private double inscribed_angle(int basepoint, int p1, int p2) {
+
+	/* Get the angle between line #1 and the origin and the angle
+	 * between line #2 and the origin, and then subtract these values. */
+	double angle1 = get_angle(basepoint,p1);
+	double angle2 = get_angle(basepoint,p2);
+	double temp = angle1 - angle2;
+	if (temp < 0.0)
+            temp = -temp;
+
+	/* We always want the smaller of the two angles inscribed, so if the
+	 * answer is greater than 180 degrees, calculate the smaller angle and
+	 * return it. */
+	if (temp > Math.PI)
+            temp = 2*Math.PI - temp;
+	if (temp < 0.0)
+            return(-temp);
+	return(temp);
+    }
+    
+
+    void make_3_junction(int basepoint, int p1, int p2, int p3, Rete engine)
+        throws JessException {
+
+	int shaft,barb1,barb2;
+        double sum = 0;
+	double delta = 0;
+
+	double angle12 = inscribed_angle(basepoint,p1,p2);
+	double angle13 = inscribed_angle(basepoint,p1,p3);
+	double angle23 = inscribed_angle(basepoint,p2,p3);
+
+	double sum1213 = angle12 + angle13;
+	double sum1223 = angle12 + angle23;
+	double sum1323 = angle13 + angle23;
+
+	if (sum1213 < sum1223) {
+		if (sum1213 < sum1323) {
+			sum = sum1213;
+			shaft = p1; barb1 = p2; barb2 = p3;
+		}
+		else {
+			sum = sum1323;
+			shaft = p3; barb1 = p1; barb2 = p2;
+		}
+	}
+	else {
+		if (sum1223 < sum1323) {
+			sum = sum1223;
+			shaft = p2; barb1 = p1; barb2 = p3;
+		}
+		else {
+			sum = sum1323;
+			shaft = p3; barb1 = p1; barb2 = p2;
+		}
+	}
+
+	delta = sum - Math.PI;
+	if (delta < 0.0)
+            delta = -delta;
+        // This is apparently defining a fact!
+        Fact f = new Fact("junction", engine);
+        f.setSlotValue("p1", new Value(barb1, RU.INTEGER));
+        f.setSlotValue("p2", new Value(shaft, RU.INTEGER));
+        f.setSlotValue("p3", new Value(barb2, RU.INTEGER));
+        f.setSlotValue("base_point", new Value(basepoint, RU.INTEGER));
+	if (delta < 0.001)
+            f.setSlotValue("type", new Value("tee", RU.ATOM));
+	else if (sum > Math.PI)
+            f.setSlotValue("type", new Value("fork", RU.ATOM));
+	else
+            f.setSlotValue("type", new Value("arrow", RU.ATOM));
+	
+//    System.out.println( basepoint + ":" + p1+ ":" + p2 + ":" + p3 );
+//    System.out.println( barb1 + ":" + shaft + ":" + barb2 + ":" + basepoint  + ":" + f.getSlotValue("type") );
+    
+        engine.assertFact(f);
+    }
+
+
+
+    public String getName() {
+        return "make_3_junction";
+    }
+
+    public Value call(ValueVector vv, Context c) throws JessException {
+        double p1 = vv.get(1).floatValue(c);
+        double p2 = vv.get(2).floatValue(c);
+        double p3 = vv.get(3).floatValue(c);
+        double basepoint = vv.get(4).intValue(c);
+        make_3_junction((int) p1, (int) p2, (int) p3, (int) basepoint, c.getEngine());
+        return Funcall.NIL;
+    }
+}

Added: labs/jbossrules/benchmarks/src/java/benchmarks/waltz/Stage.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/waltz/Stage.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/waltz/Stage.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,103 @@
+package benchmarks.waltz;
+
+
+/*
+ * Copyright 2005 JBoss Inc
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author Alexander Bagerman
+ * 
+ */
+
+import java.io.Serializable;
+
+/**
+ * 
+ * @author Alexander Bagerman
+ *
+ */
+public class Stage
+    implements
+    Serializable {
+    private static final long serialVersionUID      = -2143733895059840082L;
+
+    final public static int   START                 = 0;
+
+    final public static int   DUPLICATE             = 1;
+
+    final public static int   DETECT_JUNCTIONS      = 2;
+
+    final public static int   FIND_INITIAL_BOUNDARY = 3;
+
+    final public static int   FIND_SECOND_BOUNDARY  = 4;
+
+    final public static int   LABELING              = 5;
+
+    final public static int   PLOT_REMAINING_EDGES  = 9;
+
+    final public static int   DONE                  = 10;
+
+    private int               value;
+
+    public Stage() {
+        
+    }
+    
+    public Stage(final int value) {
+        this.value = value;
+    }
+
+    public int getValue() {
+        return this.value;
+    }
+
+    public void setValue(final int value) {
+        this.value = value;
+    }
+
+    public static int resolveStageValue(final String str) {
+        if ( str.equals( "start" ) ) {
+            return 0;
+
+        } else if ( str.equals( "duplicate" ) ) {
+            return 1;
+
+        } else if ( str.equals( "detect_junctions" ) ) {
+            return 2;
+
+        } else if ( str.equals( "find_initial_boundary" ) ) {
+            return 3;
+
+        } else if ( str.equals( "find_second_boundary" ) ) {
+            return 4;
+
+        } else if ( str.equals( "labeling" ) ) {
+            return 5;
+
+        } else if ( str.equals( "plot_remaining_edges" ) ) {
+            return 9;
+
+        } else if ( str.equals( "done" ) ) {
+            return 10;
+        } else {
+            return -9999999;
+        }
+    }
+
+    public String toString() {
+        return "{Stage value=" + this.value + "}";
+    }
+}
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/java/benchmarks/waltz/WaltzBenchmark.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/waltz/WaltzBenchmark.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/waltz/WaltzBenchmark.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,31 @@
+package benchmarks.waltz;
+
+import benchmarks.BaseBenchmark;
+import benchmarks.Benchmark;
+import benchmarks.manners.DroolsManners;
+import benchmarks.manners.MannersBenchmark;
+
+/**
+ * This is a sample file to launch a rule package from a rule source file.
+ */
+public class WaltzBenchmark  extends BaseBenchmark {
+    public void help() {
+        System.out.println("USAGE: java benchmark.waltz.WaltzBenchmark <engine> <ruleFile> <ruleData>");
+        System.exit( 0 );
+    }
+    
+    public Benchmark initEngine(String engine) {
+        Benchmark benchmark = null;
+        if  ( engine.equals( "drools" ) ) {
+            benchmark = new DroolsWaltz();
+        } else if ( engine.equals( "jess" ) ) {
+            benchmark = new JessWaltz();
+        }        
+        return benchmark;
+    }
+    
+    public static void main(String[] args) {
+        WaltzBenchmark benchmark = new WaltzBenchmark();
+        benchmark.run( args );
+    }
+}

Added: labs/jbossrules/benchmarks/src/java/benchmarks/waltz/WaltzFile.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/waltz/WaltzFile.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/waltz/WaltzFile.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,8 @@
+package benchmarks.waltz;
+import jess.*;
+
+public class WaltzFile implements Userpackage {
+    public void add(Rete engine) {
+        engine.addUserfunction(new Make3Junction());
+    }
+}

Added: labs/jbossrules/benchmarks/src/java/benchmarks/waltz/WaltzUtil.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/waltz/WaltzUtil.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/waltz/WaltzUtil.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,180 @@
+package benchmarks.waltz;
+/*
+ * Copyright 2005 JBoss Inc
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author Alexander Bagerman
+ * 
+ */
+public class WaltzUtil {
+    private static double PI      = 3.1415927;
+
+    private static final int    MOD_NUM = 10000;
+
+    private static int get_y(final int val) {
+        return val % WaltzUtil.MOD_NUM;
+    }
+
+    private static int get_x(final int val) {
+        return (val / WaltzUtil.MOD_NUM);
+    }
+
+    /***************************************************************************
+     * This function is passed two points and calculates the angle between the
+     * line defined by these points and the x-axis.
+     **************************************************************************/
+    private static double get_angle(final int p1,
+                                    final int p2) {
+        int delta_x, delta_y;
+        double ret = 0.0;
+        /*
+         * Calculate (x2 - x1) and (y2 - y1). The points are passed in the form
+         * x1y1 and x2y2. get_x() and get_y() are passed these points and return
+         * the x and y values respectively. For example, get_x(1020) returns 10.
+         */
+        delta_x = get_x( p2 ) - get_x( p1 );
+        delta_y = get_y( p2 ) - get_y( p1 );
+
+        if ( delta_x == 0 ) {
+            if ( delta_y > 0 ) {
+                ret = WaltzUtil.PI / 2;
+            } else if ( delta_y < 0 ) {
+                ret = -WaltzUtil.PI / 2;
+            }
+        } else if ( delta_y == 0 ) {
+            if ( delta_x > 0 ) {
+                ret = 0.0;
+            } else if ( delta_x < 0 ) {
+                ret = WaltzUtil.PI;
+            }
+        } else {
+            ret = Math.atan2( delta_y,
+                              delta_x );
+        }
+        return ret;
+    }
+
+    /***************************************************************************
+     * This procedure is passed the basepoint of the intersection of two lines
+     * as well as the other two endpoints of the lines and calculates the angle
+     * inscribed by these three points.
+     **************************************************************************/
+    private static double inscribed_angle(final int basepoint,
+                                          final int p1,
+                                          final int p2) {
+        double angle1, angle2, temp;
+
+        /*
+         * Get the angle between line #1 and the origin and the angle between
+         * line #2 and the origin, and then subtract these values.
+         */
+        angle1 = get_angle( basepoint,
+                            p1 );
+        angle2 = get_angle( basepoint,
+                            p2 );
+        temp = angle1 - angle2;
+        if ( temp < 0.0 ) {
+            temp = -temp;
+        }
+
+        /*
+         * We always want the smaller of the two angles inscribed, so if the
+         * answer is greater than 180 degrees, calculate the smaller angle and
+         * return it.
+         */
+        if ( temp > WaltzUtil.PI ) {
+            temp = 2 * WaltzUtil.PI - temp;
+        }
+        if ( temp < 0.0 ) {
+            return (-temp);
+        }
+        return (temp);
+    }
+
+    public static Junction make_3_junction(final int basepoint,
+                                           final int p1,
+                                           final int p2,
+                                           final int p3) {
+        int shaft, barb1, barb2;
+        double angle12, angle13, angle23;
+        double sum, sum1213, sum1223, sum1323;
+        double delta;
+        String j_type;
+
+        angle12 = inscribed_angle( basepoint,
+                                   p1,
+                                   p2 );
+        angle13 = inscribed_angle( basepoint,
+                                   p1,
+                                   p3 );
+        angle23 = inscribed_angle( basepoint,
+                                   p2,
+                                   p3 );
+
+        sum1213 = angle12 + angle13;
+        sum1223 = angle12 + angle23;
+        sum1323 = angle13 + angle23;
+
+        if ( sum1213 < sum1223 ) {
+            if ( sum1213 < sum1323 ) {
+                sum = sum1213;
+                shaft = p1;
+                barb1 = p2;
+                barb2 = p3;
+            } else {
+                sum = sum1323;
+                shaft = p3;
+                barb1 = p1;
+                barb2 = p2;
+            }
+        } else {
+            if ( sum1223 < sum1323 ) {
+                sum = sum1223;
+                shaft = p2;
+                barb1 = p1;
+                barb2 = p3;
+            } else {
+                sum = sum1323;
+                shaft = p3;
+                barb1 = p1;
+                barb2 = p2;
+            }
+        }
+
+        delta = sum - WaltzUtil.PI;
+        if ( delta < 0.0 ) {
+            delta = -delta;
+        }
+
+        if ( delta < 0.001 ) {
+            j_type = Junction.TEE;
+        } else if ( sum > WaltzUtil.PI ) {
+            j_type = Junction.FORK;
+        } else {
+            j_type = Junction.ARROW;
+        }
+
+//        System.out.println( basepoint + ":" + p1+ ":" + p2 + ":" + p3 );
+//        System.out.println( barb1 + ":" + shaft + ":" + barb2 + ":" + basepoint  + ":" + j_type );
+        
+        return new Junction( barb1,
+                             shaft,
+                             barb2,
+                             basepoint,
+                             j_type );
+
+    }
+}
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/java/benchmarks/waltzdb/EdgeLable.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/waltzdb/EdgeLable.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/waltzdb/EdgeLable.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,54 @@
+package benchmarks.waltzdb;
+
+public class EdgeLable {
+    private int p1;
+    private int p2;
+    private String l_name;
+    private int l_id;
+    
+    public EdgeLable(int p1,
+                     int p2,
+                     String l_name,
+                     int l_id) {
+        super();
+        this.p1 = p1;
+        this.p2 = p2;
+        this.l_name = l_name;
+        this.l_id = l_id;
+    }
+
+    public int getL_id() {
+        return l_id;
+    }
+
+    public void setL_id(int l_id) {
+        this.l_id = l_id;
+    }
+
+    public String getL_name() {
+        return l_name;
+    }
+
+    public void setL_name(String l_name) {
+        this.l_name = l_name;
+    }
+
+    public int getP1() {
+        return p1;
+    }
+
+    public void setP1(int p1) {
+        this.p1 = p1;
+    }
+
+    public int getP2() {
+        return p2;
+    }
+
+    public void setP2(int p2) {
+        this.p2 = p2;
+    }
+
+    
+    
+}

Added: labs/jbossrules/benchmarks/src/java/benchmarks/waltzdb/Label.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/waltzdb/Label.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/waltzdb/Label.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,72 @@
+package benchmarks.waltzdb;
+
+public class Label {
+    public final static String VOID = "*****";
+    public final static String FORK = "F";
+    public final static String ARROW = "A";
+    public final static String TEE = "T";   
+    public final static String BEE = "B";
+    public final static String ELL = "L";
+    public final static String PLUS = "+";
+    public final static String MINUS = "-"; 
+
+    private String type;
+    private String name;    
+    private String n1;
+    private String n2;
+    private String n3;
+    private int id;
+            
+    public Label(String type,
+                 String name,
+                 String n1,
+                 String n2,
+                 String n3,
+                 int id) {
+        super();
+        this.type = type;
+        this.name = name;
+        this.n1 = n1;
+        this.n2 = n2;
+        this.n3 = n3;
+        this.id = id;
+    }
+    public int getId() {
+        return id;
+    }
+    public void setId(int id) {
+        this.id = id;
+    }
+    public String getN1() {
+        return n1;
+    }
+    public void setN1(String n1) {
+        this.n1 = n1;
+    }
+    public String getN2() {
+        return n2;
+    }
+    public void setN2(String n2) {
+        this.n2 = n2;
+    }
+    public String getN3() {
+        return n3;
+    }
+    public void setN3(String n3) {
+        this.n3 = n3;
+    }
+    public String getName() {
+        return name;
+    }
+    public void setName(String name) {
+        this.name = name;
+    }
+    public String getType() {
+        return type;
+    }
+    public void setType(String type) {
+        this.type = type;
+    }
+    
+    
+}

Added: labs/jbossrules/benchmarks/src/java/benchmarks/waltzdb/Line.java
===================================================================
--- labs/jbossrules/benchmarks/src/java/benchmarks/waltzdb/Line.java	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/java/benchmarks/waltzdb/Line.java	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,29 @@
+package benchmarks.waltzdb;
+
+public class Line {
+    private int  p1;
+    private int  p2;
+    
+    
+    
+    public Line(int p1,
+                int p2) {
+        super();
+        this.p1 = p1;
+        this.p2 = p2;
+    }
+    public int getP1() {
+        return p1;
+    }
+    public void setP1(int p1) {
+        this.p1 = p1;
+    }
+    public int getP2() {
+        return p2;
+    }
+    public void setP2(int p2) {
+        this.p2 = p2;
+    }
+    
+    
+}

Added: labs/jbossrules/benchmarks/src/resources/benchmarks/manners/manners128.dat
===================================================================
--- labs/jbossrules/benchmarks/src/resources/benchmarks/manners/manners128.dat	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/resources/benchmarks/manners/manners128.dat	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,441 @@
+(guest (name n1) (sex m) (hobby h2) )
+(guest (name n1) (sex m) (hobby h3) )
+(guest (name n1) (sex m) (hobby h1) )
+(guest (name n1) (sex m) (hobby h4) )
+(guest (name n1) (sex m) (hobby h5) )
+(guest (name n2) (sex f) (hobby h3) )
+(guest (name n2) (sex f) (hobby h2) )
+(guest (name n2) (sex f) (hobby h1) )
+(guest (name n2) (sex f) (hobby h4) )
+(guest (name n2) (sex f) (hobby h5) )
+(guest (name n3) (sex f) (hobby h5) )
+(guest (name n3) (sex f) (hobby h4) )
+(guest (name n3) (sex f) (hobby h2) )
+(guest (name n4) (sex m) (hobby h3) )
+(guest (name n4) (sex m) (hobby h2) )
+(guest (name n4) (sex m) (hobby h1) )
+(guest (name n4) (sex m) (hobby h4) )
+(guest (name n5) (sex m) (hobby h2) )
+(guest (name n5) (sex m) (hobby h5) )
+(guest (name n5) (sex m) (hobby h3) )
+(guest (name n6) (sex f) (hobby h1) )
+(guest (name n6) (sex f) (hobby h4) )
+(guest (name n6) (sex f) (hobby h2) )
+(guest (name n6) (sex f) (hobby h5) )
+(guest (name n6) (sex f) (hobby h3) )
+(guest (name n7) (sex f) (hobby h1) )
+(guest (name n7) (sex f) (hobby h2) )
+(guest (name n7) (sex f) (hobby h3) )
+(guest (name n7) (sex f) (hobby h5) )
+(guest (name n8) (sex m) (hobby h3) )
+(guest (name n8) (sex m) (hobby h5) )
+(guest (name n9) (sex m) (hobby h3) )
+(guest (name n9) (sex m) (hobby h5) )
+(guest (name n9) (sex m) (hobby h2) )
+(guest (name n9) (sex m) (hobby h4) )
+(guest (name n10) (sex m) (hobby h2) )
+(guest (name n10) (sex m) (hobby h3) )
+(guest (name n10) (sex m) (hobby h4) )
+(guest (name n10) (sex m) (hobby h5) )
+(guest (name n10) (sex m) (hobby h1) )
+(guest (name n11) (sex m) (hobby h2) )
+(guest (name n11) (sex m) (hobby h4) )
+(guest (name n11) (sex m) (hobby h5) )
+(guest (name n11) (sex m) (hobby h1) )
+(guest (name n12) (sex f) (hobby h3) )
+(guest (name n12) (sex f) (hobby h5) )
+(guest (name n12) (sex f) (hobby h2) )
+(guest (name n13) (sex f) (hobby h5) )
+(guest (name n13) (sex f) (hobby h1) )
+(guest (name n14) (sex m) (hobby h3) )
+(guest (name n14) (sex m) (hobby h5) )
+(guest (name n14) (sex m) (hobby h1) )
+(guest (name n14) (sex m) (hobby h4) )
+(guest (name n15) (sex m) (hobby h5) )
+(guest (name n15) (sex m) (hobby h2) )
+(guest (name n15) (sex m) (hobby h1) )
+(guest (name n15) (sex m) (hobby h3) )
+(guest (name n15) (sex m) (hobby h4) )
+(guest (name n16) (sex m) (hobby h2) )
+(guest (name n16) (sex m) (hobby h5) )
+(guest (name n16) (sex m) (hobby h4) )
+(guest (name n17) (sex m) (hobby h4) )
+(guest (name n17) (sex m) (hobby h3) )
+(guest (name n18) (sex f) (hobby h2) )
+(guest (name n18) (sex f) (hobby h4) )
+(guest (name n18) (sex f) (hobby h5) )
+(guest (name n18) (sex f) (hobby h1) )
+(guest (name n19) (sex m) (hobby h5) )
+(guest (name n19) (sex m) (hobby h2) )
+(guest (name n20) (sex m) (hobby h2) )
+(guest (name n20) (sex m) (hobby h3) )
+(guest (name n21) (sex m) (hobby h4) )
+(guest (name n21) (sex m) (hobby h3) )
+(guest (name n21) (sex m) (hobby h2) )
+(guest (name n21) (sex m) (hobby h1) )
+(guest (name n22) (sex m) (hobby h1) )
+(guest (name n22) (sex m) (hobby h2) )
+(guest (name n22) (sex m) (hobby h4) )
+(guest (name n23) (sex f) (hobby h4) )
+(guest (name n23) (sex f) (hobby h5) )
+(guest (name n23) (sex f) (hobby h2) )
+(guest (name n24) (sex f) (hobby h4) )
+(guest (name n24) (sex f) (hobby h3) )
+(guest (name n24) (sex f) (hobby h2) )
+(guest (name n24) (sex f) (hobby h1) )
+(guest (name n24) (sex f) (hobby h5) )
+(guest (name n25) (sex m) (hobby h4) )
+(guest (name n25) (sex m) (hobby h5) )
+(guest (name n26) (sex m) (hobby h1) )
+(guest (name n26) (sex m) (hobby h2) )
+(guest (name n27) (sex m) (hobby h3) )
+(guest (name n27) (sex m) (hobby h5) )
+(guest (name n27) (sex m) (hobby h2) )
+(guest (name n28) (sex f) (hobby h4) )
+(guest (name n28) (sex f) (hobby h1) )
+(guest (name n28) (sex f) (hobby h3) )
+(guest (name n28) (sex f) (hobby h2) )
+(guest (name n28) (sex f) (hobby h5) )
+(guest (name n29) (sex f) (hobby h3) )
+(guest (name n29) (sex f) (hobby h5) )
+(guest (name n30) (sex m) (hobby h2) )
+(guest (name n30) (sex m) (hobby h1) )
+(guest (name n31) (sex m) (hobby h3) )
+(guest (name n31) (sex m) (hobby h1) )
+(guest (name n31) (sex m) (hobby h4) )
+(guest (name n32) (sex f) (hobby h2) )
+(guest (name n32) (sex f) (hobby h1) )
+(guest (name n32) (sex f) (hobby h5) )
+(guest (name n33) (sex f) (hobby h5) )
+(guest (name n33) (sex f) (hobby h4) )
+(guest (name n34) (sex m) (hobby h4) )
+(guest (name n34) (sex m) (hobby h5) )
+(guest (name n34) (sex m) (hobby h2) )
+(guest (name n35) (sex f) (hobby h3) )
+(guest (name n35) (sex f) (hobby h1) )
+(guest (name n35) (sex f) (hobby h4) )
+(guest (name n35) (sex f) (hobby h5) )
+(guest (name n35) (sex f) (hobby h2) )
+(guest (name n36) (sex m) (hobby h1) )
+(guest (name n36) (sex m) (hobby h4) )
+(guest (name n36) (sex m) (hobby h2) )
+(guest (name n36) (sex m) (hobby h3) )
+(guest (name n37) (sex f) (hobby h4) )
+(guest (name n37) (sex f) (hobby h2) )
+(guest (name n37) (sex f) (hobby h1) )
+(guest (name n38) (sex f) (hobby h3) )
+(guest (name n38) (sex f) (hobby h1) )
+(guest (name n38) (sex f) (hobby h2) )
+(guest (name n38) (sex f) (hobby h4) )
+(guest (name n39) (sex m) (hobby h5) )
+(guest (name n39) (sex m) (hobby h2) )
+(guest (name n40) (sex m) (hobby h2) )
+(guest (name n40) (sex m) (hobby h3) )
+(guest (name n41) (sex f) (hobby h5) )
+(guest (name n41) (sex f) (hobby h3) )
+(guest (name n42) (sex m) (hobby h5) )
+(guest (name n42) (sex m) (hobby h4) )
+(guest (name n43) (sex m) (hobby h3) )
+(guest (name n43) (sex m) (hobby h4) )
+(guest (name n43) (sex m) (hobby h5) )
+(guest (name n44) (sex f) (hobby h2) )
+(guest (name n44) (sex f) (hobby h4) )
+(guest (name n44) (sex f) (hobby h3) )
+(guest (name n44) (sex f) (hobby h1) )
+(guest (name n45) (sex m) (hobby h2) )
+(guest (name n45) (sex m) (hobby h4) )
+(guest (name n46) (sex m) (hobby h4) )
+(guest (name n46) (sex m) (hobby h1) )
+(guest (name n46) (sex m) (hobby h5) )
+(guest (name n47) (sex m) (hobby h2) )
+(guest (name n47) (sex m) (hobby h5) )
+(guest (name n47) (sex m) (hobby h4) )
+(guest (name n48) (sex f) (hobby h3) )
+(guest (name n48) (sex f) (hobby h1) )
+(guest (name n49) (sex m) (hobby h1) )
+(guest (name n49) (sex m) (hobby h5) )
+(guest (name n49) (sex m) (hobby h4) )
+(guest (name n49) (sex m) (hobby h3) )
+(guest (name n49) (sex m) (hobby h2) )
+(guest (name n50) (sex m) (hobby h2) )
+(guest (name n50) (sex m) (hobby h4) )
+(guest (name n50) (sex m) (hobby h3) )
+(guest (name n51) (sex m) (hobby h1) )
+(guest (name n51) (sex m) (hobby h2) )
+(guest (name n51) (sex m) (hobby h5) )
+(guest (name n51) (sex m) (hobby h4) )
+(guest (name n52) (sex f) (hobby h5) )
+(guest (name n52) (sex f) (hobby h3) )
+(guest (name n52) (sex f) (hobby h1) )
+(guest (name n52) (sex f) (hobby h4) )
+(guest (name n53) (sex f) (hobby h5) )
+(guest (name n53) (sex f) (hobby h1) )
+(guest (name n53) (sex f) (hobby h4) )
+(guest (name n53) (sex f) (hobby h2) )
+(guest (name n53) (sex f) (hobby h3) )
+(guest (name n54) (sex f) (hobby h1) )
+(guest (name n54) (sex f) (hobby h3) )
+(guest (name n55) (sex m) (hobby h2) )
+(guest (name n55) (sex m) (hobby h4) )
+(guest (name n56) (sex m) (hobby h2) )
+(guest (name n56) (sex m) (hobby h3) )
+(guest (name n57) (sex f) (hobby h2) )
+(guest (name n57) (sex f) (hobby h1) )
+(guest (name n57) (sex f) (hobby h4) )
+(guest (name n58) (sex m) (hobby h5) )
+(guest (name n58) (sex m) (hobby h3) )
+(guest (name n58) (sex m) (hobby h2) )
+(guest (name n58) (sex m) (hobby h1) )
+(guest (name n58) (sex m) (hobby h4) )
+(guest (name n59) (sex f) (hobby h2) )
+(guest (name n59) (sex f) (hobby h3) )
+(guest (name n59) (sex f) (hobby h5) )
+(guest (name n60) (sex f) (hobby h4) )
+(guest (name n60) (sex f) (hobby h2) )
+(guest (name n60) (sex f) (hobby h3) )
+(guest (name n60) (sex f) (hobby h5) )
+(guest (name n61) (sex m) (hobby h1) )
+(guest (name n61) (sex m) (hobby h2) )
+(guest (name n61) (sex m) (hobby h4) )
+(guest (name n61) (sex m) (hobby h3) )
+(guest (name n62) (sex f) (hobby h3) )
+(guest (name n62) (sex f) (hobby h2) )
+(guest (name n62) (sex f) (hobby h5) )
+(guest (name n62) (sex f) (hobby h4) )
+(guest (name n62) (sex f) (hobby h1) )
+(guest (name n63) (sex f) (hobby h2) )
+(guest (name n63) (sex f) (hobby h3) )
+(guest (name n63) (sex f) (hobby h4) )
+(guest (name n63) (sex f) (hobby h1) )
+(guest (name n63) (sex f) (hobby h5) )
+(guest (name n64) (sex f) (hobby h2) )
+(guest (name n64) (sex f) (hobby h4) )
+(guest (name n64) (sex f) (hobby h1) )
+(guest (name n64) (sex f) (hobby h5) )
+(guest (name n64) (sex f) (hobby h3) )
+(guest (name n65) (sex m) (hobby h5) )
+(guest (name n65) (sex m) (hobby h3) )
+(guest (name n65) (sex m) (hobby h2) )
+(guest (name n65) (sex m) (hobby h1) )
+(guest (name n65) (sex m) (hobby h4) )
+(guest (name n66) (sex f) (hobby h5) )
+(guest (name n66) (sex f) (hobby h3) )
+(guest (name n66) (sex f) (hobby h4) )
+(guest (name n67) (sex f) (hobby h1) )
+(guest (name n67) (sex f) (hobby h4) )
+(guest (name n68) (sex m) (hobby h4) )
+(guest (name n68) (sex m) (hobby h2) )
+(guest (name n68) (sex m) (hobby h1) )
+(guest (name n68) (sex m) (hobby h5) )
+(guest (name n69) (sex m) (hobby h3) )
+(guest (name n69) (sex m) (hobby h4) )
+(guest (name n69) (sex m) (hobby h1) )
+(guest (name n70) (sex f) (hobby h3) )
+(guest (name n70) (sex f) (hobby h5) )
+(guest (name n70) (sex f) (hobby h1) )
+(guest (name n70) (sex f) (hobby h4) )
+(guest (name n70) (sex f) (hobby h2) )
+(guest (name n71) (sex m) (hobby h3) )
+(guest (name n71) (sex m) (hobby h1) )
+(guest (name n71) (sex m) (hobby h4) )
+(guest (name n72) (sex m) (hobby h4) )
+(guest (name n72) (sex m) (hobby h3) )
+(guest (name n72) (sex m) (hobby h1) )
+(guest (name n73) (sex f) (hobby h4) )
+(guest (name n73) (sex f) (hobby h1) )
+(guest (name n73) (sex f) (hobby h3) )
+(guest (name n74) (sex f) (hobby h1) )
+(guest (name n74) (sex f) (hobby h4) )
+(guest (name n74) (sex f) (hobby h2) )
+(guest (name n74) (sex f) (hobby h5) )
+(guest (name n74) (sex f) (hobby h3) )
+(guest (name n75) (sex f) (hobby h4) )
+(guest (name n75) (sex f) (hobby h2) )
+(guest (name n76) (sex f) (hobby h5) )
+(guest (name n76) (sex f) (hobby h4) )
+(guest (name n76) (sex f) (hobby h3) )
+(guest (name n76) (sex f) (hobby h2) )
+(guest (name n76) (sex f) (hobby h1) )
+(guest (name n77) (sex m) (hobby h1) )
+(guest (name n77) (sex m) (hobby h5) )
+(guest (name n78) (sex m) (hobby h5) )
+(guest (name n78) (sex m) (hobby h1) )
+(guest (name n79) (sex f) (hobby h1) )
+(guest (name n79) (sex f) (hobby h3) )
+(guest (name n79) (sex f) (hobby h4) )
+(guest (name n79) (sex f) (hobby h2) )
+(guest (name n79) (sex f) (hobby h5) )
+(guest (name n80) (sex m) (hobby h5) )
+(guest (name n80) (sex m) (hobby h1) )
+(guest (name n80) (sex m) (hobby h2) )
+(guest (name n80) (sex m) (hobby h4) )
+(guest (name n81) (sex m) (hobby h4) )
+(guest (name n81) (sex m) (hobby h1) )
+(guest (name n82) (sex m) (hobby h3) )
+(guest (name n82) (sex m) (hobby h4) )
+(guest (name n82) (sex m) (hobby h1) )
+(guest (name n82) (sex m) (hobby h2) )
+(guest (name n82) (sex m) (hobby h5) )
+(guest (name n83) (sex f) (hobby h1) )
+(guest (name n83) (sex f) (hobby h3) )
+(guest (name n83) (sex f) (hobby h4) )
+(guest (name n84) (sex m) (hobby h3) )
+(guest (name n84) (sex m) (hobby h4) )
+(guest (name n85) (sex f) (hobby h4) )
+(guest (name n85) (sex f) (hobby h1) )
+(guest (name n86) (sex m) (hobby h3) )
+(guest (name n86) (sex m) (hobby h4) )
+(guest (name n87) (sex m) (hobby h5) )
+(guest (name n87) (sex m) (hobby h4) )
+(guest (name n87) (sex m) (hobby h2) )
+(guest (name n87) (sex m) (hobby h3) )
+(guest (name n88) (sex m) (hobby h2) )
+(guest (name n88) (sex m) (hobby h5) )
+(guest (name n88) (sex m) (hobby h3) )
+(guest (name n88) (sex m) (hobby h1) )
+(guest (name n88) (sex m) (hobby h4) )
+(guest (name n89) (sex f) (hobby h5) )
+(guest (name n89) (sex f) (hobby h2) )
+(guest (name n89) (sex f) (hobby h4) )
+(guest (name n89) (sex f) (hobby h1) )
+(guest (name n90) (sex m) (hobby h2) )
+(guest (name n90) (sex m) (hobby h4) )
+(guest (name n90) (sex m) (hobby h5) )
+(guest (name n91) (sex f) (hobby h2) )
+(guest (name n91) (sex f) (hobby h3) )
+(guest (name n91) (sex f) (hobby h5) )
+(guest (name n91) (sex f) (hobby h1) )
+(guest (name n91) (sex f) (hobby h4) )
+(guest (name n92) (sex f) (hobby h3) )
+(guest (name n92) (sex f) (hobby h1) )
+(guest (name n92) (sex f) (hobby h2) )
+(guest (name n92) (sex f) (hobby h5) )
+(guest (name n93) (sex f) (hobby h3) )
+(guest (name n93) (sex f) (hobby h1) )
+(guest (name n93) (sex f) (hobby h2) )
+(guest (name n94) (sex f) (hobby h2) )
+(guest (name n94) (sex f) (hobby h5) )
+(guest (name n95) (sex f) (hobby h3) )
+(guest (name n95) (sex f) (hobby h4) )
+(guest (name n96) (sex m) (hobby h1) )
+(guest (name n96) (sex m) (hobby h4) )
+(guest (name n96) (sex m) (hobby h2) )
+(guest (name n96) (sex m) (hobby h5) )
+(guest (name n96) (sex m) (hobby h3) )
+(guest (name n97) (sex f) (hobby h4) )
+(guest (name n97) (sex f) (hobby h2) )
+(guest (name n97) (sex f) (hobby h5) )
+(guest (name n98) (sex m) (hobby h5) )
+(guest (name n98) (sex m) (hobby h4) )
+(guest (name n99) (sex f) (hobby h2) )
+(guest (name n99) (sex f) (hobby h5) )
+(guest (name n100) (sex m) (hobby h2) )
+(guest (name n100) (sex m) (hobby h3) )
+(guest (name n100) (sex m) (hobby h5) )
+(guest (name n100) (sex m) (hobby h4) )
+(guest (name n101) (sex f) (hobby h2) )
+(guest (name n101) (sex f) (hobby h1) )
+(guest (name n101) (sex f) (hobby h5) )
+(guest (name n101) (sex f) (hobby h3) )
+(guest (name n101) (sex f) (hobby h4) )
+(guest (name n102) (sex f) (hobby h2) )
+(guest (name n102) (sex f) (hobby h1) )
+(guest (name n102) (sex f) (hobby h5) )
+(guest (name n102) (sex f) (hobby h3) )
+(guest (name n102) (sex f) (hobby h4) )
+(guest (name n103) (sex m) (hobby h2) )
+(guest (name n103) (sex m) (hobby h1) )
+(guest (name n103) (sex m) (hobby h4) )
+(guest (name n103) (sex m) (hobby h3) )
+(guest (name n103) (sex m) (hobby h5) )
+(guest (name n104) (sex m) (hobby h5) )
+(guest (name n104) (sex m) (hobby h3) )
+(guest (name n104) (sex m) (hobby h4) )
+(guest (name n104) (sex m) (hobby h1) )
+(guest (name n104) (sex m) (hobby h2) )
+(guest (name n105) (sex f) (hobby h4) )
+(guest (name n105) (sex f) (hobby h2) )
+(guest (name n106) (sex f) (hobby h4) )
+(guest (name n106) (sex f) (hobby h5) )
+(guest (name n106) (sex f) (hobby h1) )
+(guest (name n107) (sex f) (hobby h3) )
+(guest (name n107) (sex f) (hobby h1) )
+(guest (name n107) (sex f) (hobby h2) )
+(guest (name n107) (sex f) (hobby h5) )
+(guest (name n107) (sex f) (hobby h4) )
+(guest (name n108) (sex f) (hobby h4) )
+(guest (name n108) (sex f) (hobby h5) )
+(guest (name n108) (sex f) (hobby h1) )
+(guest (name n108) (sex f) (hobby h2) )
+(guest (name n108) (sex f) (hobby h3) )
+(guest (name n109) (sex f) (hobby h1) )
+(guest (name n109) (sex f) (hobby h2) )
+(guest (name n110) (sex m) (hobby h5) )
+(guest (name n110) (sex m) (hobby h4) )
+(guest (name n110) (sex m) (hobby h1) )
+(guest (name n110) (sex m) (hobby h2) )
+(guest (name n111) (sex f) (hobby h3) )
+(guest (name n111) (sex f) (hobby h2) )
+(guest (name n112) (sex f) (hobby h4) )
+(guest (name n112) (sex f) (hobby h3) )
+(guest (name n112) (sex f) (hobby h5) )
+(guest (name n112) (sex f) (hobby h2) )
+(guest (name n112) (sex f) (hobby h1) )
+(guest (name n113) (sex f) (hobby h1) )
+(guest (name n113) (sex f) (hobby h3) )
+(guest (name n113) (sex f) (hobby h5) )
+(guest (name n113) (sex f) (hobby h2) )
+(guest (name n114) (sex m) (hobby h3) )
+(guest (name n114) (sex m) (hobby h2) )
+(guest (name n115) (sex m) (hobby h2) )
+(guest (name n115) (sex m) (hobby h1) )
+(guest (name n115) (sex m) (hobby h5) )
+(guest (name n115) (sex m) (hobby h4) )
+(guest (name n116) (sex m) (hobby h3) )
+(guest (name n116) (sex m) (hobby h4) )
+(guest (name n116) (sex m) (hobby h5) )
+(guest (name n116) (sex m) (hobby h1) )
+(guest (name n117) (sex f) (hobby h4) )
+(guest (name n117) (sex f) (hobby h5) )
+(guest (name n117) (sex f) (hobby h2) )
+(guest (name n118) (sex f) (hobby h2) )
+(guest (name n118) (sex f) (hobby h4) )
+(guest (name n118) (sex f) (hobby h3) )
+(guest (name n119) (sex m) (hobby h5) )
+(guest (name n119) (sex m) (hobby h3) )
+(guest (name n120) (sex m) (hobby h5) )
+(guest (name n120) (sex m) (hobby h1) )
+(guest (name n120) (sex m) (hobby h3) )
+(guest (name n120) (sex m) (hobby h2) )
+(guest (name n120) (sex m) (hobby h4) )
+(guest (name n121) (sex f) (hobby h4) )
+(guest (name n121) (sex f) (hobby h2) )
+(guest (name n121) (sex f) (hobby h3) )
+(guest (name n121) (sex f) (hobby h5) )
+(guest (name n122) (sex m) (hobby h1) )
+(guest (name n122) (sex m) (hobby h2) )
+(guest (name n122) (sex m) (hobby h5) )
+(guest (name n123) (sex m) (hobby h2) )
+(guest (name n123) (sex m) (hobby h3) )
+(guest (name n123) (sex m) (hobby h1) )
+(guest (name n123) (sex m) (hobby h5) )
+(guest (name n124) (sex f) (hobby h2) )
+(guest (name n124) (sex f) (hobby h3) )
+(guest (name n124) (sex f) (hobby h4) )
+(guest (name n125) (sex f) (hobby h3) )
+(guest (name n125) (sex f) (hobby h5) )
+(guest (name n125) (sex f) (hobby h2) )
+(guest (name n125) (sex f) (hobby h4) )
+(guest (name n126) (sex f) (hobby h2) )
+(guest (name n126) (sex f) (hobby h3) )
+(guest (name n126) (sex f) (hobby h1) )
+(guest (name n126) (sex f) (hobby h4) )
+(guest (name n127) (sex f) (hobby h5) )
+(guest (name n127) (sex f) (hobby h1) )
+(guest (name n128) (sex f) (hobby h2) )
+(guest (name n128) (sex f) (hobby h4) )
+(guest (name n128) (sex f) (hobby h1) )
+(guest (name n128) (sex f) (hobby h3) )
+(last_seat (seat 128) )
+(count (c 1) )
+(context (name "startup") )
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/resources/benchmarks/waltz/waltz50.dat
===================================================================
--- labs/jbossrules/benchmarks/src/resources/benchmarks/waltz/waltz50.dat	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/resources/benchmarks/waltz/waltz50.dat	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,3873 @@
+(line (p1 50003) (p2 60003))
+(line (p1 30005) (p2 30006))
+(line (p1 80005) (p2 80006))
+(line (p1 50008) (p2 60008))
+(line (p1 0) (p2 20000))
+(line (p1 20000) (p2 30000))
+(line (p1 30000) (p2 40000))
+(line (p1 0) (p2 2))
+(line (p1 2) (p2 3))
+(line (p1 3) (p2 4))
+(line (p1 4) (p2 40004))
+(line (p1 40004) (p2 40000))
+(line (p1 40000) (p2 50001))
+(line (p1 50001) (p2 50002))
+(line (p1 50002) (p2 50003))
+(line (p1 50003) (p2 50005))
+(line (p1 50005) (p2 40004))
+(line (p1 50005) (p2 30005))
+(line (p1 30005) (p2 20005))
+(line (p1 20005) (p2 10005))
+(line (p1 10005) (p2 4))
+(line (p1 60000) (p2 80000))
+(line (p1 80000) (p2 90000))
+(line (p1 90000) (p2 100000))
+(line (p1 60000) (p2 60002))
+(line (p1 60002) (p2 60003))
+(line (p1 60003) (p2 60004))
+(line (p1 60004) (p2 100004))
+(line (p1 100004) (p2 100000))
+(line (p1 100000) (p2 110001))
+(line (p1 110001) (p2 110002))
+(line (p1 110002) (p2 110003))
+(line (p1 110003) (p2 110005))
+(line (p1 110005) (p2 100004))
+(line (p1 110005) (p2 90005))
+(line (p1 90005) (p2 80005))
+(line (p1 80005) (p2 70005))
+(line (p1 70005) (p2 60004))
+(line (p1 6) (p2 20006))
+(line (p1 20006) (p2 30006))
+(line (p1 30006) (p2 40006))
+(line (p1 6) (p2 8))
+(line (p1 8) (p2 9))
+(line (p1 9) (p2 10))
+(line (p1 10) (p2 40010))
+(line (p1 40010) (p2 40006))
+(line (p1 40006) (p2 50007))
+(line (p1 50007) (p2 50008))
+(line (p1 50008) (p2 50009))
+(line (p1 50009) (p2 50011))
+(line (p1 50011) (p2 40010))
+(line (p1 50011) (p2 30011))
+(line (p1 30011) (p2 20011))
+(line (p1 20011) (p2 10011))
+(line (p1 10011) (p2 10))
+(line (p1 60006) (p2 80006))
+(line (p1 80006) (p2 90006))
+(line (p1 90006) (p2 100006))
+(line (p1 60006) (p2 60008))
+(line (p1 60008) (p2 60009))
+(line (p1 60009) (p2 60010))
+(line (p1 60010) (p2 100010))
+(line (p1 100010) (p2 100006))
+(line (p1 100006) (p2 110007))
+(line (p1 110007) (p2 110008))
+(line (p1 110008) (p2 110009))
+(line (p1 110009) (p2 110011))
+(line (p1 110011) (p2 100010))
+(line (p1 110011) (p2 90011))
+(line (p1 90011) (p2 80011))
+(line (p1 80011) (p2 70011))
+(line (p1 70011) (p2 60010))
+(line (p1 170003) (p2 180003))
+(line (p1 150005) (p2 150006))
+(line (p1 200005) (p2 200006))
+(line (p1 170008) (p2 180008))
+(line (p1 120000) (p2 140000))
+(line (p1 140000) (p2 150000))
+(line (p1 150000) (p2 160000))
+(line (p1 120000) (p2 120002))
+(line (p1 120002) (p2 120003))
+(line (p1 120003) (p2 120004))
+(line (p1 120004) (p2 160004))
+(line (p1 160004) (p2 160000))
+(line (p1 160000) (p2 170001))
+(line (p1 170001) (p2 170002))
+(line (p1 170002) (p2 170003))
+(line (p1 170003) (p2 170005))
+(line (p1 170005) (p2 160004))
+(line (p1 170005) (p2 150005))
+(line (p1 150005) (p2 140005))
+(line (p1 140005) (p2 130005))
+(line (p1 130005) (p2 120004))
+(line (p1 180000) (p2 200000))
+(line (p1 200000) (p2 210000))
+(line (p1 210000) (p2 220000))
+(line (p1 180000) (p2 180002))
+(line (p1 180002) (p2 180003))
+(line (p1 180003) (p2 180004))
+(line (p1 180004) (p2 220004))
+(line (p1 220004) (p2 220000))
+(line (p1 220000) (p2 230001))
+(line (p1 230001) (p2 230002))
+(line (p1 230002) (p2 230003))
+(line (p1 230003) (p2 230005))
+(line (p1 230005) (p2 220004))
+(line (p1 230005) (p2 210005))
+(line (p1 210005) (p2 200005))
+(line (p1 200005) (p2 190005))
+(line (p1 190005) (p2 180004))
+(line (p1 120006) (p2 140006))
+(line (p1 140006) (p2 150006))
+(line (p1 150006) (p2 160006))
+(line (p1 120006) (p2 120008))
+(line (p1 120008) (p2 120009))
+(line (p1 120009) (p2 120010))
+(line (p1 120010) (p2 160010))
+(line (p1 160010) (p2 160006))
+(line (p1 160006) (p2 170007))
+(line (p1 170007) (p2 170008))
+(line (p1 170008) (p2 170009))
+(line (p1 170009) (p2 170011))
+(line (p1 170011) (p2 160010))
+(line (p1 170011) (p2 150011))
+(line (p1 150011) (p2 140011))
+(line (p1 140011) (p2 130011))
+(line (p1 130011) (p2 120010))
+(line (p1 180006) (p2 200006))
+(line (p1 200006) (p2 210006))
+(line (p1 210006) (p2 220006))
+(line (p1 180006) (p2 180008))
+(line (p1 180008) (p2 180009))
+(line (p1 180009) (p2 180010))
+(line (p1 180010) (p2 220010))
+(line (p1 220010) (p2 220006))
+(line (p1 220006) (p2 230007))
+(line (p1 230007) (p2 230008))
+(line (p1 230008) (p2 230009))
+(line (p1 230009) (p2 230011))
+(line (p1 230011) (p2 220010))
+(line (p1 230011) (p2 210011))
+(line (p1 210011) (p2 200011))
+(line (p1 200011) (p2 190011))
+(line (p1 190011) (p2 180010))
+(line (p1 110003) (p2 120003))
+(line (p1 90005) (p2 90006))
+(line (p1 140005) (p2 140006))
+(line (p1 110008) (p2 120008))
+(line (p1 290003) (p2 300003))
+(line (p1 270005) (p2 270006))
+(line (p1 320005) (p2 320006))
+(line (p1 290008) (p2 300008))
+(line (p1 240000) (p2 260000))
+(line (p1 260000) (p2 270000))
+(line (p1 270000) (p2 280000))
+(line (p1 240000) (p2 240002))
+(line (p1 240002) (p2 240003))
+(line (p1 240003) (p2 240004))
+(line (p1 240004) (p2 280004))
+(line (p1 280004) (p2 280000))
+(line (p1 280000) (p2 290001))
+(line (p1 290001) (p2 290002))
+(line (p1 290002) (p2 290003))
+(line (p1 290003) (p2 290005))
+(line (p1 290005) (p2 280004))
+(line (p1 290005) (p2 270005))
+(line (p1 270005) (p2 260005))
+(line (p1 260005) (p2 250005))
+(line (p1 250005) (p2 240004))
+(line (p1 300000) (p2 320000))
+(line (p1 320000) (p2 330000))
+(line (p1 330000) (p2 340000))
+(line (p1 300000) (p2 300002))
+(line (p1 300002) (p2 300003))
+(line (p1 300003) (p2 300004))
+(line (p1 300004) (p2 340004))
+(line (p1 340004) (p2 340000))
+(line (p1 340000) (p2 350001))
+(line (p1 350001) (p2 350002))
+(line (p1 350002) (p2 350003))
+(line (p1 350003) (p2 350005))
+(line (p1 350005) (p2 340004))
+(line (p1 350005) (p2 330005))
+(line (p1 330005) (p2 320005))
+(line (p1 320005) (p2 310005))
+(line (p1 310005) (p2 300004))
+(line (p1 240006) (p2 260006))
+(line (p1 260006) (p2 270006))
+(line (p1 270006) (p2 280006))
+(line (p1 240006) (p2 240008))
+(line (p1 240008) (p2 240009))
+(line (p1 240009) (p2 240010))
+(line (p1 240010) (p2 280010))
+(line (p1 280010) (p2 280006))
+(line (p1 280006) (p2 290007))
+(line (p1 290007) (p2 290008))
+(line (p1 290008) (p2 290009))
+(line (p1 290009) (p2 290011))
+(line (p1 290011) (p2 280010))
+(line (p1 290011) (p2 270011))
+(line (p1 270011) (p2 260011))
+(line (p1 260011) (p2 250011))
+(line (p1 250011) (p2 240010))
+(line (p1 300006) (p2 320006))
+(line (p1 320006) (p2 330006))
+(line (p1 330006) (p2 340006))
+(line (p1 300006) (p2 300008))
+(line (p1 300008) (p2 300009))
+(line (p1 300009) (p2 300010))
+(line (p1 300010) (p2 340010))
+(line (p1 340010) (p2 340006))
+(line (p1 340006) (p2 350007))
+(line (p1 350007) (p2 350008))
+(line (p1 350008) (p2 350009))
+(line (p1 350009) (p2 350011))
+(line (p1 350011) (p2 340010))
+(line (p1 350011) (p2 330011))
+(line (p1 330011) (p2 320011))
+(line (p1 320011) (p2 310011))
+(line (p1 310011) (p2 300010))
+(line (p1 230003) (p2 240003))
+(line (p1 210005) (p2 210006))
+(line (p1 260005) (p2 260006))
+(line (p1 230008) (p2 240008))
+(line (p1 410003) (p2 420003))
+(line (p1 390005) (p2 390006))
+(line (p1 440005) (p2 440006))
+(line (p1 410008) (p2 420008))
+(line (p1 360000) (p2 380000))
+(line (p1 380000) (p2 390000))
+(line (p1 390000) (p2 400000))
+(line (p1 360000) (p2 360002))
+(line (p1 360002) (p2 360003))
+(line (p1 360003) (p2 360004))
+(line (p1 360004) (p2 400004))
+(line (p1 400004) (p2 400000))
+(line (p1 400000) (p2 410001))
+(line (p1 410001) (p2 410002))
+(line (p1 410002) (p2 410003))
+(line (p1 410003) (p2 410005))
+(line (p1 410005) (p2 400004))
+(line (p1 410005) (p2 390005))
+(line (p1 390005) (p2 380005))
+(line (p1 380005) (p2 370005))
+(line (p1 370005) (p2 360004))
+(line (p1 420000) (p2 440000))
+(line (p1 440000) (p2 450000))
+(line (p1 450000) (p2 460000))
+(line (p1 420000) (p2 420002))
+(line (p1 420002) (p2 420003))
+(line (p1 420003) (p2 420004))
+(line (p1 420004) (p2 460004))
+(line (p1 460004) (p2 460000))
+(line (p1 460000) (p2 470001))
+(line (p1 470001) (p2 470002))
+(line (p1 470002) (p2 470003))
+(line (p1 470003) (p2 470005))
+(line (p1 470005) (p2 460004))
+(line (p1 470005) (p2 450005))
+(line (p1 450005) (p2 440005))
+(line (p1 440005) (p2 430005))
+(line (p1 430005) (p2 420004))
+(line (p1 360006) (p2 380006))
+(line (p1 380006) (p2 390006))
+(line (p1 390006) (p2 400006))
+(line (p1 360006) (p2 360008))
+(line (p1 360008) (p2 360009))
+(line (p1 360009) (p2 360010))
+(line (p1 360010) (p2 400010))
+(line (p1 400010) (p2 400006))
+(line (p1 400006) (p2 410007))
+(line (p1 410007) (p2 410008))
+(line (p1 410008) (p2 410009))
+(line (p1 410009) (p2 410011))
+(line (p1 410011) (p2 400010))
+(line (p1 410011) (p2 390011))
+(line (p1 390011) (p2 380011))
+(line (p1 380011) (p2 370011))
+(line (p1 370011) (p2 360010))
+(line (p1 420006) (p2 440006))
+(line (p1 440006) (p2 450006))
+(line (p1 450006) (p2 460006))
+(line (p1 420006) (p2 420008))
+(line (p1 420008) (p2 420009))
+(line (p1 420009) (p2 420010))
+(line (p1 420010) (p2 460010))
+(line (p1 460010) (p2 460006))
+(line (p1 460006) (p2 470007))
+(line (p1 470007) (p2 470008))
+(line (p1 470008) (p2 470009))
+(line (p1 470009) (p2 470011))
+(line (p1 470011) (p2 460010))
+(line (p1 470011) (p2 450011))
+(line (p1 450011) (p2 440011))
+(line (p1 440011) (p2 430011))
+(line (p1 430011) (p2 420010))
+(line (p1 350003) (p2 360003))
+(line (p1 330005) (p2 330006))
+(line (p1 380005) (p2 380006))
+(line (p1 350008) (p2 360008))
+(line (p1 530003) (p2 540003))
+(line (p1 510005) (p2 510006))
+(line (p1 560005) (p2 560006))
+(line (p1 530008) (p2 540008))
+(line (p1 480000) (p2 500000))
+(line (p1 500000) (p2 510000))
+(line (p1 510000) (p2 520000))
+(line (p1 480000) (p2 480002))
+(line (p1 480002) (p2 480003))
+(line (p1 480003) (p2 480004))
+(line (p1 480004) (p2 520004))
+(line (p1 520004) (p2 520000))
+(line (p1 520000) (p2 530001))
+(line (p1 530001) (p2 530002))
+(line (p1 530002) (p2 530003))
+(line (p1 530003) (p2 530005))
+(line (p1 530005) (p2 520004))
+(line (p1 530005) (p2 510005))
+(line (p1 510005) (p2 500005))
+(line (p1 500005) (p2 490005))
+(line (p1 490005) (p2 480004))
+(line (p1 540000) (p2 560000))
+(line (p1 560000) (p2 570000))
+(line (p1 570000) (p2 580000))
+(line (p1 540000) (p2 540002))
+(line (p1 540002) (p2 540003))
+(line (p1 540003) (p2 540004))
+(line (p1 540004) (p2 580004))
+(line (p1 580004) (p2 580000))
+(line (p1 580000) (p2 590001))
+(line (p1 590001) (p2 590002))
+(line (p1 590002) (p2 590003))
+(line (p1 590003) (p2 590005))
+(line (p1 590005) (p2 580004))
+(line (p1 590005) (p2 570005))
+(line (p1 570005) (p2 560005))
+(line (p1 560005) (p2 550005))
+(line (p1 550005) (p2 540004))
+(line (p1 480006) (p2 500006))
+(line (p1 500006) (p2 510006))
+(line (p1 510006) (p2 520006))
+(line (p1 480006) (p2 480008))
+(line (p1 480008) (p2 480009))
+(line (p1 480009) (p2 480010))
+(line (p1 480010) (p2 520010))
+(line (p1 520010) (p2 520006))
+(line (p1 520006) (p2 530007))
+(line (p1 530007) (p2 530008))
+(line (p1 530008) (p2 530009))
+(line (p1 530009) (p2 530011))
+(line (p1 530011) (p2 520010))
+(line (p1 530011) (p2 510011))
+(line (p1 510011) (p2 500011))
+(line (p1 500011) (p2 490011))
+(line (p1 490011) (p2 480010))
+(line (p1 540006) (p2 560006))
+(line (p1 560006) (p2 570006))
+(line (p1 570006) (p2 580006))
+(line (p1 540006) (p2 540008))
+(line (p1 540008) (p2 540009))
+(line (p1 540009) (p2 540010))
+(line (p1 540010) (p2 580010))
+(line (p1 580010) (p2 580006))
+(line (p1 580006) (p2 590007))
+(line (p1 590007) (p2 590008))
+(line (p1 590008) (p2 590009))
+(line (p1 590009) (p2 590011))
+(line (p1 590011) (p2 580010))
+(line (p1 590011) (p2 570011))
+(line (p1 570011) (p2 560011))
+(line (p1 560011) (p2 550011))
+(line (p1 550011) (p2 540010))
+(line (p1 470003) (p2 480003))
+(line (p1 450005) (p2 450006))
+(line (p1 500005) (p2 500006))
+(line (p1 470008) (p2 480008))
+(line (p1 650003) (p2 660003))
+(line (p1 630005) (p2 630006))
+(line (p1 680005) (p2 680006))
+(line (p1 650008) (p2 660008))
+(line (p1 600000) (p2 620000))
+(line (p1 620000) (p2 630000))
+(line (p1 630000) (p2 640000))
+(line (p1 600000) (p2 600002))
+(line (p1 600002) (p2 600003))
+(line (p1 600003) (p2 600004))
+(line (p1 600004) (p2 640004))
+(line (p1 640004) (p2 640000))
+(line (p1 640000) (p2 650001))
+(line (p1 650001) (p2 650002))
+(line (p1 650002) (p2 650003))
+(line (p1 650003) (p2 650005))
+(line (p1 650005) (p2 640004))
+(line (p1 650005) (p2 630005))
+(line (p1 630005) (p2 620005))
+(line (p1 620005) (p2 610005))
+(line (p1 610005) (p2 600004))
+(line (p1 660000) (p2 680000))
+(line (p1 680000) (p2 690000))
+(line (p1 690000) (p2 700000))
+(line (p1 660000) (p2 660002))
+(line (p1 660002) (p2 660003))
+(line (p1 660003) (p2 660004))
+(line (p1 660004) (p2 700004))
+(line (p1 700004) (p2 700000))
+(line (p1 700000) (p2 710001))
+(line (p1 710001) (p2 710002))
+(line (p1 710002) (p2 710003))
+(line (p1 710003) (p2 710005))
+(line (p1 710005) (p2 700004))
+(line (p1 710005) (p2 690005))
+(line (p1 690005) (p2 680005))
+(line (p1 680005) (p2 670005))
+(line (p1 670005) (p2 660004))
+(line (p1 600006) (p2 620006))
+(line (p1 620006) (p2 630006))
+(line (p1 630006) (p2 640006))
+(line (p1 600006) (p2 600008))
+(line (p1 600008) (p2 600009))
+(line (p1 600009) (p2 600010))
+(line (p1 600010) (p2 640010))
+(line (p1 640010) (p2 640006))
+(line (p1 640006) (p2 650007))
+(line (p1 650007) (p2 650008))
+(line (p1 650008) (p2 650009))
+(line (p1 650009) (p2 650011))
+(line (p1 650011) (p2 640010))
+(line (p1 650011) (p2 630011))
+(line (p1 630011) (p2 620011))
+(line (p1 620011) (p2 610011))
+(line (p1 610011) (p2 600010))
+(line (p1 660006) (p2 680006))
+(line (p1 680006) (p2 690006))
+(line (p1 690006) (p2 700006))
+(line (p1 660006) (p2 660008))
+(line (p1 660008) (p2 660009))
+(line (p1 660009) (p2 660010))
+(line (p1 660010) (p2 700010))
+(line (p1 700010) (p2 700006))
+(line (p1 700006) (p2 710007))
+(line (p1 710007) (p2 710008))
+(line (p1 710008) (p2 710009))
+(line (p1 710009) (p2 710011))
+(line (p1 710011) (p2 700010))
+(line (p1 710011) (p2 690011))
+(line (p1 690011) (p2 680011))
+(line (p1 680011) (p2 670011))
+(line (p1 670011) (p2 660010))
+(line (p1 590003) (p2 600003))
+(line (p1 570005) (p2 570006))
+(line (p1 620005) (p2 620006))
+(line (p1 590008) (p2 600008))
+(line (p1 770003) (p2 780003))
+(line (p1 750005) (p2 750006))
+(line (p1 800005) (p2 800006))
+(line (p1 770008) (p2 780008))
+(line (p1 720000) (p2 740000))
+(line (p1 740000) (p2 750000))
+(line (p1 750000) (p2 760000))
+(line (p1 720000) (p2 720002))
+(line (p1 720002) (p2 720003))
+(line (p1 720003) (p2 720004))
+(line (p1 720004) (p2 760004))
+(line (p1 760004) (p2 760000))
+(line (p1 760000) (p2 770001))
+(line (p1 770001) (p2 770002))
+(line (p1 770002) (p2 770003))
+(line (p1 770003) (p2 770005))
+(line (p1 770005) (p2 760004))
+(line (p1 770005) (p2 750005))
+(line (p1 750005) (p2 740005))
+(line (p1 740005) (p2 730005))
+(line (p1 730005) (p2 720004))
+(line (p1 780000) (p2 800000))
+(line (p1 800000) (p2 810000))
+(line (p1 810000) (p2 820000))
+(line (p1 780000) (p2 780002))
+(line (p1 780002) (p2 780003))
+(line (p1 780003) (p2 780004))
+(line (p1 780004) (p2 820004))
+(line (p1 820004) (p2 820000))
+(line (p1 820000) (p2 830001))
+(line (p1 830001) (p2 830002))
+(line (p1 830002) (p2 830003))
+(line (p1 830003) (p2 830005))
+(line (p1 830005) (p2 820004))
+(line (p1 830005) (p2 810005))
+(line (p1 810005) (p2 800005))
+(line (p1 800005) (p2 790005))
+(line (p1 790005) (p2 780004))
+(line (p1 720006) (p2 740006))
+(line (p1 740006) (p2 750006))
+(line (p1 750006) (p2 760006))
+(line (p1 720006) (p2 720008))
+(line (p1 720008) (p2 720009))
+(line (p1 720009) (p2 720010))
+(line (p1 720010) (p2 760010))
+(line (p1 760010) (p2 760006))
+(line (p1 760006) (p2 770007))
+(line (p1 770007) (p2 770008))
+(line (p1 770008) (p2 770009))
+(line (p1 770009) (p2 770011))
+(line (p1 770011) (p2 760010))
+(line (p1 770011) (p2 750011))
+(line (p1 750011) (p2 740011))
+(line (p1 740011) (p2 730011))
+(line (p1 730011) (p2 720010))
+(line (p1 780006) (p2 800006))
+(line (p1 800006) (p2 810006))
+(line (p1 810006) (p2 820006))
+(line (p1 780006) (p2 780008))
+(line (p1 780008) (p2 780009))
+(line (p1 780009) (p2 780010))
+(line (p1 780010) (p2 820010))
+(line (p1 820010) (p2 820006))
+(line (p1 820006) (p2 830007))
+(line (p1 830007) (p2 830008))
+(line (p1 830008) (p2 830009))
+(line (p1 830009) (p2 830011))
+(line (p1 830011) (p2 820010))
+(line (p1 830011) (p2 810011))
+(line (p1 810011) (p2 800011))
+(line (p1 800011) (p2 790011))
+(line (p1 790011) (p2 780010))
+(line (p1 710003) (p2 720003))
+(line (p1 690005) (p2 690006))
+(line (p1 740005) (p2 740006))
+(line (p1 710008) (p2 720008))
+(line (p1 890003) (p2 900003))
+(line (p1 870005) (p2 870006))
+(line (p1 920005) (p2 920006))
+(line (p1 890008) (p2 900008))
+(line (p1 840000) (p2 860000))
+(line (p1 860000) (p2 870000))
+(line (p1 870000) (p2 880000))
+(line (p1 840000) (p2 840002))
+(line (p1 840002) (p2 840003))
+(line (p1 840003) (p2 840004))
+(line (p1 840004) (p2 880004))
+(line (p1 880004) (p2 880000))
+(line (p1 880000) (p2 890001))
+(line (p1 890001) (p2 890002))
+(line (p1 890002) (p2 890003))
+(line (p1 890003) (p2 890005))
+(line (p1 890005) (p2 880004))
+(line (p1 890005) (p2 870005))
+(line (p1 870005) (p2 860005))
+(line (p1 860005) (p2 850005))
+(line (p1 850005) (p2 840004))
+(line (p1 900000) (p2 920000))
+(line (p1 920000) (p2 930000))
+(line (p1 930000) (p2 940000))
+(line (p1 900000) (p2 900002))
+(line (p1 900002) (p2 900003))
+(line (p1 900003) (p2 900004))
+(line (p1 900004) (p2 940004))
+(line (p1 940004) (p2 940000))
+(line (p1 940000) (p2 950001))
+(line (p1 950001) (p2 950002))
+(line (p1 950002) (p2 950003))
+(line (p1 950003) (p2 950005))
+(line (p1 950005) (p2 940004))
+(line (p1 950005) (p2 930005))
+(line (p1 930005) (p2 920005))
+(line (p1 920005) (p2 910005))
+(line (p1 910005) (p2 900004))
+(line (p1 840006) (p2 860006))
+(line (p1 860006) (p2 870006))
+(line (p1 870006) (p2 880006))
+(line (p1 840006) (p2 840008))
+(line (p1 840008) (p2 840009))
+(line (p1 840009) (p2 840010))
+(line (p1 840010) (p2 880010))
+(line (p1 880010) (p2 880006))
+(line (p1 880006) (p2 890007))
+(line (p1 890007) (p2 890008))
+(line (p1 890008) (p2 890009))
+(line (p1 890009) (p2 890011))
+(line (p1 890011) (p2 880010))
+(line (p1 890011) (p2 870011))
+(line (p1 870011) (p2 860011))
+(line (p1 860011) (p2 850011))
+(line (p1 850011) (p2 840010))
+(line (p1 900006) (p2 920006))
+(line (p1 920006) (p2 930006))
+(line (p1 930006) (p2 940006))
+(line (p1 900006) (p2 900008))
+(line (p1 900008) (p2 900009))
+(line (p1 900009) (p2 900010))
+(line (p1 900010) (p2 940010))
+(line (p1 940010) (p2 940006))
+(line (p1 940006) (p2 950007))
+(line (p1 950007) (p2 950008))
+(line (p1 950008) (p2 950009))
+(line (p1 950009) (p2 950011))
+(line (p1 950011) (p2 940010))
+(line (p1 950011) (p2 930011))
+(line (p1 930011) (p2 920011))
+(line (p1 920011) (p2 910011))
+(line (p1 910011) (p2 900010))
+(line (p1 830003) (p2 840003))
+(line (p1 810005) (p2 810006))
+(line (p1 860005) (p2 860006))
+(line (p1 830008) (p2 840008))
+(line (p1 1010003) (p2 1020003))
+(line (p1 990005) (p2 990006))
+(line (p1 1040005) (p2 1040006))
+(line (p1 1010008) (p2 1020008))
+(line (p1 960000) (p2 980000))
+(line (p1 980000) (p2 990000))
+(line (p1 990000) (p2 1000000))
+(line (p1 960000) (p2 960002))
+(line (p1 960002) (p2 960003))
+(line (p1 960003) (p2 960004))
+(line (p1 960004) (p2 1000004))
+(line (p1 1000004) (p2 1000000))
+(line (p1 1000000) (p2 1010001))
+(line (p1 1010001) (p2 1010002))
+(line (p1 1010002) (p2 1010003))
+(line (p1 1010003) (p2 1010005))
+(line (p1 1010005) (p2 1000004))
+(line (p1 1010005) (p2 990005))
+(line (p1 990005) (p2 980005))
+(line (p1 980005) (p2 970005))
+(line (p1 970005) (p2 960004))
+(line (p1 1020000) (p2 1040000))
+(line (p1 1040000) (p2 1050000))
+(line (p1 1050000) (p2 1060000))
+(line (p1 1020000) (p2 1020002))
+(line (p1 1020002) (p2 1020003))
+(line (p1 1020003) (p2 1020004))
+(line (p1 1020004) (p2 1060004))
+(line (p1 1060004) (p2 1060000))
+(line (p1 1060000) (p2 1070001))
+(line (p1 1070001) (p2 1070002))
+(line (p1 1070002) (p2 1070003))
+(line (p1 1070003) (p2 1070005))
+(line (p1 1070005) (p2 1060004))
+(line (p1 1070005) (p2 1050005))
+(line (p1 1050005) (p2 1040005))
+(line (p1 1040005) (p2 1030005))
+(line (p1 1030005) (p2 1020004))
+(line (p1 960006) (p2 980006))
+(line (p1 980006) (p2 990006))
+(line (p1 990006) (p2 1000006))
+(line (p1 960006) (p2 960008))
+(line (p1 960008) (p2 960009))
+(line (p1 960009) (p2 960010))
+(line (p1 960010) (p2 1000010))
+(line (p1 1000010) (p2 1000006))
+(line (p1 1000006) (p2 1010007))
+(line (p1 1010007) (p2 1010008))
+(line (p1 1010008) (p2 1010009))
+(line (p1 1010009) (p2 1010011))
+(line (p1 1010011) (p2 1000010))
+(line (p1 1010011) (p2 990011))
+(line (p1 990011) (p2 980011))
+(line (p1 980011) (p2 970011))
+(line (p1 970011) (p2 960010))
+(line (p1 1020006) (p2 1040006))
+(line (p1 1040006) (p2 1050006))
+(line (p1 1050006) (p2 1060006))
+(line (p1 1020006) (p2 1020008))
+(line (p1 1020008) (p2 1020009))
+(line (p1 1020009) (p2 1020010))
+(line (p1 1020010) (p2 1060010))
+(line (p1 1060010) (p2 1060006))
+(line (p1 1060006) (p2 1070007))
+(line (p1 1070007) (p2 1070008))
+(line (p1 1070008) (p2 1070009))
+(line (p1 1070009) (p2 1070011))
+(line (p1 1070011) (p2 1060010))
+(line (p1 1070011) (p2 1050011))
+(line (p1 1050011) (p2 1040011))
+(line (p1 1040011) (p2 1030011))
+(line (p1 1030011) (p2 1020010))
+(line (p1 950003) (p2 960003))
+(line (p1 930005) (p2 930006))
+(line (p1 980005) (p2 980006))
+(line (p1 950008) (p2 960008))
+(line (p1 1130003) (p2 1140003))
+(line (p1 1110005) (p2 1110006))
+(line (p1 1160005) (p2 1160006))
+(line (p1 1130008) (p2 1140008))
+(line (p1 1080000) (p2 1100000))
+(line (p1 1100000) (p2 1110000))
+(line (p1 1110000) (p2 1120000))
+(line (p1 1080000) (p2 1080002))
+(line (p1 1080002) (p2 1080003))
+(line (p1 1080003) (p2 1080004))
+(line (p1 1080004) (p2 1120004))
+(line (p1 1120004) (p2 1120000))
+(line (p1 1120000) (p2 1130001))
+(line (p1 1130001) (p2 1130002))
+(line (p1 1130002) (p2 1130003))
+(line (p1 1130003) (p2 1130005))
+(line (p1 1130005) (p2 1120004))
+(line (p1 1130005) (p2 1110005))
+(line (p1 1110005) (p2 1100005))
+(line (p1 1100005) (p2 1090005))
+(line (p1 1090005) (p2 1080004))
+(line (p1 1140000) (p2 1160000))
+(line (p1 1160000) (p2 1170000))
+(line (p1 1170000) (p2 1180000))
+(line (p1 1140000) (p2 1140002))
+(line (p1 1140002) (p2 1140003))
+(line (p1 1140003) (p2 1140004))
+(line (p1 1140004) (p2 1180004))
+(line (p1 1180004) (p2 1180000))
+(line (p1 1180000) (p2 1190001))
+(line (p1 1190001) (p2 1190002))
+(line (p1 1190002) (p2 1190003))
+(line (p1 1190003) (p2 1190005))
+(line (p1 1190005) (p2 1180004))
+(line (p1 1190005) (p2 1170005))
+(line (p1 1170005) (p2 1160005))
+(line (p1 1160005) (p2 1150005))
+(line (p1 1150005) (p2 1140004))
+(line (p1 1080006) (p2 1100006))
+(line (p1 1100006) (p2 1110006))
+(line (p1 1110006) (p2 1120006))
+(line (p1 1080006) (p2 1080008))
+(line (p1 1080008) (p2 1080009))
+(line (p1 1080009) (p2 1080010))
+(line (p1 1080010) (p2 1120010))
+(line (p1 1120010) (p2 1120006))
+(line (p1 1120006) (p2 1130007))
+(line (p1 1130007) (p2 1130008))
+(line (p1 1130008) (p2 1130009))
+(line (p1 1130009) (p2 1130011))
+(line (p1 1130011) (p2 1120010))
+(line (p1 1130011) (p2 1110011))
+(line (p1 1110011) (p2 1100011))
+(line (p1 1100011) (p2 1090011))
+(line (p1 1090011) (p2 1080010))
+(line (p1 1140006) (p2 1160006))
+(line (p1 1160006) (p2 1170006))
+(line (p1 1170006) (p2 1180006))
+(line (p1 1140006) (p2 1140008))
+(line (p1 1140008) (p2 1140009))
+(line (p1 1140009) (p2 1140010))
+(line (p1 1140010) (p2 1180010))
+(line (p1 1180010) (p2 1180006))
+(line (p1 1180006) (p2 1190007))
+(line (p1 1190007) (p2 1190008))
+(line (p1 1190008) (p2 1190009))
+(line (p1 1190009) (p2 1190011))
+(line (p1 1190011) (p2 1180010))
+(line (p1 1190011) (p2 1170011))
+(line (p1 1170011) (p2 1160011))
+(line (p1 1160011) (p2 1150011))
+(line (p1 1150011) (p2 1140010))
+(line (p1 1070003) (p2 1080003))
+(line (p1 1050005) (p2 1050006))
+(line (p1 1100005) (p2 1100006))
+(line (p1 1070008) (p2 1080008))
+(line (p1 1250003) (p2 1260003))
+(line (p1 1230005) (p2 1230006))
+(line (p1 1280005) (p2 1280006))
+(line (p1 1250008) (p2 1260008))
+(line (p1 1200000) (p2 1220000))
+(line (p1 1220000) (p2 1230000))
+(line (p1 1230000) (p2 1240000))
+(line (p1 1200000) (p2 1200002))
+(line (p1 1200002) (p2 1200003))
+(line (p1 1200003) (p2 1200004))
+(line (p1 1200004) (p2 1240004))
+(line (p1 1240004) (p2 1240000))
+(line (p1 1240000) (p2 1250001))
+(line (p1 1250001) (p2 1250002))
+(line (p1 1250002) (p2 1250003))
+(line (p1 1250003) (p2 1250005))
+(line (p1 1250005) (p2 1240004))
+(line (p1 1250005) (p2 1230005))
+(line (p1 1230005) (p2 1220005))
+(line (p1 1220005) (p2 1210005))
+(line (p1 1210005) (p2 1200004))
+(line (p1 1260000) (p2 1280000))
+(line (p1 1280000) (p2 1290000))
+(line (p1 1290000) (p2 1300000))
+(line (p1 1260000) (p2 1260002))
+(line (p1 1260002) (p2 1260003))
+(line (p1 1260003) (p2 1260004))
+(line (p1 1260004) (p2 1300004))
+(line (p1 1300004) (p2 1300000))
+(line (p1 1300000) (p2 1310001))
+(line (p1 1310001) (p2 1310002))
+(line (p1 1310002) (p2 1310003))
+(line (p1 1310003) (p2 1310005))
+(line (p1 1310005) (p2 1300004))
+(line (p1 1310005) (p2 1290005))
+(line (p1 1290005) (p2 1280005))
+(line (p1 1280005) (p2 1270005))
+(line (p1 1270005) (p2 1260004))
+(line (p1 1200006) (p2 1220006))
+(line (p1 1220006) (p2 1230006))
+(line (p1 1230006) (p2 1240006))
+(line (p1 1200006) (p2 1200008))
+(line (p1 1200008) (p2 1200009))
+(line (p1 1200009) (p2 1200010))
+(line (p1 1200010) (p2 1240010))
+(line (p1 1240010) (p2 1240006))
+(line (p1 1240006) (p2 1250007))
+(line (p1 1250007) (p2 1250008))
+(line (p1 1250008) (p2 1250009))
+(line (p1 1250009) (p2 1250011))
+(line (p1 1250011) (p2 1240010))
+(line (p1 1250011) (p2 1230011))
+(line (p1 1230011) (p2 1220011))
+(line (p1 1220011) (p2 1210011))
+(line (p1 1210011) (p2 1200010))
+(line (p1 1260006) (p2 1280006))
+(line (p1 1280006) (p2 1290006))
+(line (p1 1290006) (p2 1300006))
+(line (p1 1260006) (p2 1260008))
+(line (p1 1260008) (p2 1260009))
+(line (p1 1260009) (p2 1260010))
+(line (p1 1260010) (p2 1300010))
+(line (p1 1300010) (p2 1300006))
+(line (p1 1300006) (p2 1310007))
+(line (p1 1310007) (p2 1310008))
+(line (p1 1310008) (p2 1310009))
+(line (p1 1310009) (p2 1310011))
+(line (p1 1310011) (p2 1300010))
+(line (p1 1310011) (p2 1290011))
+(line (p1 1290011) (p2 1280011))
+(line (p1 1280011) (p2 1270011))
+(line (p1 1270011) (p2 1260010))
+(line (p1 1190003) (p2 1200003))
+(line (p1 1170005) (p2 1170006))
+(line (p1 1220005) (p2 1220006))
+(line (p1 1190008) (p2 1200008))
+(line (p1 1370003) (p2 1380003))
+(line (p1 1350005) (p2 1350006))
+(line (p1 1400005) (p2 1400006))
+(line (p1 1370008) (p2 1380008))
+(line (p1 1320000) (p2 1340000))
+(line (p1 1340000) (p2 1350000))
+(line (p1 1350000) (p2 1360000))
+(line (p1 1320000) (p2 1320002))
+(line (p1 1320002) (p2 1320003))
+(line (p1 1320003) (p2 1320004))
+(line (p1 1320004) (p2 1360004))
+(line (p1 1360004) (p2 1360000))
+(line (p1 1360000) (p2 1370001))
+(line (p1 1370001) (p2 1370002))
+(line (p1 1370002) (p2 1370003))
+(line (p1 1370003) (p2 1370005))
+(line (p1 1370005) (p2 1360004))
+(line (p1 1370005) (p2 1350005))
+(line (p1 1350005) (p2 1340005))
+(line (p1 1340005) (p2 1330005))
+(line (p1 1330005) (p2 1320004))
+(line (p1 1380000) (p2 1400000))
+(line (p1 1400000) (p2 1410000))
+(line (p1 1410000) (p2 1420000))
+(line (p1 1380000) (p2 1380002))
+(line (p1 1380002) (p2 1380003))
+(line (p1 1380003) (p2 1380004))
+(line (p1 1380004) (p2 1420004))
+(line (p1 1420004) (p2 1420000))
+(line (p1 1420000) (p2 1430001))
+(line (p1 1430001) (p2 1430002))
+(line (p1 1430002) (p2 1430003))
+(line (p1 1430003) (p2 1430005))
+(line (p1 1430005) (p2 1420004))
+(line (p1 1430005) (p2 1410005))
+(line (p1 1410005) (p2 1400005))
+(line (p1 1400005) (p2 1390005))
+(line (p1 1390005) (p2 1380004))
+(line (p1 1320006) (p2 1340006))
+(line (p1 1340006) (p2 1350006))
+(line (p1 1350006) (p2 1360006))
+(line (p1 1320006) (p2 1320008))
+(line (p1 1320008) (p2 1320009))
+(line (p1 1320009) (p2 1320010))
+(line (p1 1320010) (p2 1360010))
+(line (p1 1360010) (p2 1360006))
+(line (p1 1360006) (p2 1370007))
+(line (p1 1370007) (p2 1370008))
+(line (p1 1370008) (p2 1370009))
+(line (p1 1370009) (p2 1370011))
+(line (p1 1370011) (p2 1360010))
+(line (p1 1370011) (p2 1350011))
+(line (p1 1350011) (p2 1340011))
+(line (p1 1340011) (p2 1330011))
+(line (p1 1330011) (p2 1320010))
+(line (p1 1380006) (p2 1400006))
+(line (p1 1400006) (p2 1410006))
+(line (p1 1410006) (p2 1420006))
+(line (p1 1380006) (p2 1380008))
+(line (p1 1380008) (p2 1380009))
+(line (p1 1380009) (p2 1380010))
+(line (p1 1380010) (p2 1420010))
+(line (p1 1420010) (p2 1420006))
+(line (p1 1420006) (p2 1430007))
+(line (p1 1430007) (p2 1430008))
+(line (p1 1430008) (p2 1430009))
+(line (p1 1430009) (p2 1430011))
+(line (p1 1430011) (p2 1420010))
+(line (p1 1430011) (p2 1410011))
+(line (p1 1410011) (p2 1400011))
+(line (p1 1400011) (p2 1390011))
+(line (p1 1390011) (p2 1380010))
+(line (p1 1310003) (p2 1320003))
+(line (p1 1290005) (p2 1290006))
+(line (p1 1340005) (p2 1340006))
+(line (p1 1310008) (p2 1320008))
+(line (p1 1490003) (p2 1500003))
+(line (p1 1470005) (p2 1470006))
+(line (p1 1520005) (p2 1520006))
+(line (p1 1490008) (p2 1500008))
+(line (p1 1440000) (p2 1460000))
+(line (p1 1460000) (p2 1470000))
+(line (p1 1470000) (p2 1480000))
+(line (p1 1440000) (p2 1440002))
+(line (p1 1440002) (p2 1440003))
+(line (p1 1440003) (p2 1440004))
+(line (p1 1440004) (p2 1480004))
+(line (p1 1480004) (p2 1480000))
+(line (p1 1480000) (p2 1490001))
+(line (p1 1490001) (p2 1490002))
+(line (p1 1490002) (p2 1490003))
+(line (p1 1490003) (p2 1490005))
+(line (p1 1490005) (p2 1480004))
+(line (p1 1490005) (p2 1470005))
+(line (p1 1470005) (p2 1460005))
+(line (p1 1460005) (p2 1450005))
+(line (p1 1450005) (p2 1440004))
+(line (p1 1500000) (p2 1520000))
+(line (p1 1520000) (p2 1530000))
+(line (p1 1530000) (p2 1540000))
+(line (p1 1500000) (p2 1500002))
+(line (p1 1500002) (p2 1500003))
+(line (p1 1500003) (p2 1500004))
+(line (p1 1500004) (p2 1540004))
+(line (p1 1540004) (p2 1540000))
+(line (p1 1540000) (p2 1550001))
+(line (p1 1550001) (p2 1550002))
+(line (p1 1550002) (p2 1550003))
+(line (p1 1550003) (p2 1550005))
+(line (p1 1550005) (p2 1540004))
+(line (p1 1550005) (p2 1530005))
+(line (p1 1530005) (p2 1520005))
+(line (p1 1520005) (p2 1510005))
+(line (p1 1510005) (p2 1500004))
+(line (p1 1440006) (p2 1460006))
+(line (p1 1460006) (p2 1470006))
+(line (p1 1470006) (p2 1480006))
+(line (p1 1440006) (p2 1440008))
+(line (p1 1440008) (p2 1440009))
+(line (p1 1440009) (p2 1440010))
+(line (p1 1440010) (p2 1480010))
+(line (p1 1480010) (p2 1480006))
+(line (p1 1480006) (p2 1490007))
+(line (p1 1490007) (p2 1490008))
+(line (p1 1490008) (p2 1490009))
+(line (p1 1490009) (p2 1490011))
+(line (p1 1490011) (p2 1480010))
+(line (p1 1490011) (p2 1470011))
+(line (p1 1470011) (p2 1460011))
+(line (p1 1460011) (p2 1450011))
+(line (p1 1450011) (p2 1440010))
+(line (p1 1500006) (p2 1520006))
+(line (p1 1520006) (p2 1530006))
+(line (p1 1530006) (p2 1540006))
+(line (p1 1500006) (p2 1500008))
+(line (p1 1500008) (p2 1500009))
+(line (p1 1500009) (p2 1500010))
+(line (p1 1500010) (p2 1540010))
+(line (p1 1540010) (p2 1540006))
+(line (p1 1540006) (p2 1550007))
+(line (p1 1550007) (p2 1550008))
+(line (p1 1550008) (p2 1550009))
+(line (p1 1550009) (p2 1550011))
+(line (p1 1550011) (p2 1540010))
+(line (p1 1550011) (p2 1530011))
+(line (p1 1530011) (p2 1520011))
+(line (p1 1520011) (p2 1510011))
+(line (p1 1510011) (p2 1500010))
+(line (p1 1430003) (p2 1440003))
+(line (p1 1410005) (p2 1410006))
+(line (p1 1460005) (p2 1460006))
+(line (p1 1430008) (p2 1440008))
+(line (p1 1610003) (p2 1620003))
+(line (p1 1590005) (p2 1590006))
+(line (p1 1640005) (p2 1640006))
+(line (p1 1610008) (p2 1620008))
+(line (p1 1560000) (p2 1580000))
+(line (p1 1580000) (p2 1590000))
+(line (p1 1590000) (p2 1600000))
+(line (p1 1560000) (p2 1560002))
+(line (p1 1560002) (p2 1560003))
+(line (p1 1560003) (p2 1560004))
+(line (p1 1560004) (p2 1600004))
+(line (p1 1600004) (p2 1600000))
+(line (p1 1600000) (p2 1610001))
+(line (p1 1610001) (p2 1610002))
+(line (p1 1610002) (p2 1610003))
+(line (p1 1610003) (p2 1610005))
+(line (p1 1610005) (p2 1600004))
+(line (p1 1610005) (p2 1590005))
+(line (p1 1590005) (p2 1580005))
+(line (p1 1580005) (p2 1570005))
+(line (p1 1570005) (p2 1560004))
+(line (p1 1620000) (p2 1640000))
+(line (p1 1640000) (p2 1650000))
+(line (p1 1650000) (p2 1660000))
+(line (p1 1620000) (p2 1620002))
+(line (p1 1620002) (p2 1620003))
+(line (p1 1620003) (p2 1620004))
+(line (p1 1620004) (p2 1660004))
+(line (p1 1660004) (p2 1660000))
+(line (p1 1660000) (p2 1670001))
+(line (p1 1670001) (p2 1670002))
+(line (p1 1670002) (p2 1670003))
+(line (p1 1670003) (p2 1670005))
+(line (p1 1670005) (p2 1660004))
+(line (p1 1670005) (p2 1650005))
+(line (p1 1650005) (p2 1640005))
+(line (p1 1640005) (p2 1630005))
+(line (p1 1630005) (p2 1620004))
+(line (p1 1560006) (p2 1580006))
+(line (p1 1580006) (p2 1590006))
+(line (p1 1590006) (p2 1600006))
+(line (p1 1560006) (p2 1560008))
+(line (p1 1560008) (p2 1560009))
+(line (p1 1560009) (p2 1560010))
+(line (p1 1560010) (p2 1600010))
+(line (p1 1600010) (p2 1600006))
+(line (p1 1600006) (p2 1610007))
+(line (p1 1610007) (p2 1610008))
+(line (p1 1610008) (p2 1610009))
+(line (p1 1610009) (p2 1610011))
+(line (p1 1610011) (p2 1600010))
+(line (p1 1610011) (p2 1590011))
+(line (p1 1590011) (p2 1580011))
+(line (p1 1580011) (p2 1570011))
+(line (p1 1570011) (p2 1560010))
+(line (p1 1620006) (p2 1640006))
+(line (p1 1640006) (p2 1650006))
+(line (p1 1650006) (p2 1660006))
+(line (p1 1620006) (p2 1620008))
+(line (p1 1620008) (p2 1620009))
+(line (p1 1620009) (p2 1620010))
+(line (p1 1620010) (p2 1660010))
+(line (p1 1660010) (p2 1660006))
+(line (p1 1660006) (p2 1670007))
+(line (p1 1670007) (p2 1670008))
+(line (p1 1670008) (p2 1670009))
+(line (p1 1670009) (p2 1670011))
+(line (p1 1670011) (p2 1660010))
+(line (p1 1670011) (p2 1650011))
+(line (p1 1650011) (p2 1640011))
+(line (p1 1640011) (p2 1630011))
+(line (p1 1630011) (p2 1620010))
+(line (p1 1550003) (p2 1560003))
+(line (p1 1530005) (p2 1530006))
+(line (p1 1580005) (p2 1580006))
+(line (p1 1550008) (p2 1560008))
+(line (p1 1730003) (p2 1740003))
+(line (p1 1710005) (p2 1710006))
+(line (p1 1760005) (p2 1760006))
+(line (p1 1730008) (p2 1740008))
+(line (p1 1680000) (p2 1700000))
+(line (p1 1700000) (p2 1710000))
+(line (p1 1710000) (p2 1720000))
+(line (p1 1680000) (p2 1680002))
+(line (p1 1680002) (p2 1680003))
+(line (p1 1680003) (p2 1680004))
+(line (p1 1680004) (p2 1720004))
+(line (p1 1720004) (p2 1720000))
+(line (p1 1720000) (p2 1730001))
+(line (p1 1730001) (p2 1730002))
+(line (p1 1730002) (p2 1730003))
+(line (p1 1730003) (p2 1730005))
+(line (p1 1730005) (p2 1720004))
+(line (p1 1730005) (p2 1710005))
+(line (p1 1710005) (p2 1700005))
+(line (p1 1700005) (p2 1690005))
+(line (p1 1690005) (p2 1680004))
+(line (p1 1740000) (p2 1760000))
+(line (p1 1760000) (p2 1770000))
+(line (p1 1770000) (p2 1780000))
+(line (p1 1740000) (p2 1740002))
+(line (p1 1740002) (p2 1740003))
+(line (p1 1740003) (p2 1740004))
+(line (p1 1740004) (p2 1780004))
+(line (p1 1780004) (p2 1780000))
+(line (p1 1780000) (p2 1790001))
+(line (p1 1790001) (p2 1790002))
+(line (p1 1790002) (p2 1790003))
+(line (p1 1790003) (p2 1790005))
+(line (p1 1790005) (p2 1780004))
+(line (p1 1790005) (p2 1770005))
+(line (p1 1770005) (p2 1760005))
+(line (p1 1760005) (p2 1750005))
+(line (p1 1750005) (p2 1740004))
+(line (p1 1680006) (p2 1700006))
+(line (p1 1700006) (p2 1710006))
+(line (p1 1710006) (p2 1720006))
+(line (p1 1680006) (p2 1680008))
+(line (p1 1680008) (p2 1680009))
+(line (p1 1680009) (p2 1680010))
+(line (p1 1680010) (p2 1720010))
+(line (p1 1720010) (p2 1720006))
+(line (p1 1720006) (p2 1730007))
+(line (p1 1730007) (p2 1730008))
+(line (p1 1730008) (p2 1730009))
+(line (p1 1730009) (p2 1730011))
+(line (p1 1730011) (p2 1720010))
+(line (p1 1730011) (p2 1710011))
+(line (p1 1710011) (p2 1700011))
+(line (p1 1700011) (p2 1690011))
+(line (p1 1690011) (p2 1680010))
+(line (p1 1740006) (p2 1760006))
+(line (p1 1760006) (p2 1770006))
+(line (p1 1770006) (p2 1780006))
+(line (p1 1740006) (p2 1740008))
+(line (p1 1740008) (p2 1740009))
+(line (p1 1740009) (p2 1740010))
+(line (p1 1740010) (p2 1780010))
+(line (p1 1780010) (p2 1780006))
+(line (p1 1780006) (p2 1790007))
+(line (p1 1790007) (p2 1790008))
+(line (p1 1790008) (p2 1790009))
+(line (p1 1790009) (p2 1790011))
+(line (p1 1790011) (p2 1780010))
+(line (p1 1790011) (p2 1770011))
+(line (p1 1770011) (p2 1760011))
+(line (p1 1760011) (p2 1750011))
+(line (p1 1750011) (p2 1740010))
+(line (p1 1670003) (p2 1680003))
+(line (p1 1650005) (p2 1650006))
+(line (p1 1700005) (p2 1700006))
+(line (p1 1670008) (p2 1680008))
+(line (p1 1850003) (p2 1860003))
+(line (p1 1830005) (p2 1830006))
+(line (p1 1880005) (p2 1880006))
+(line (p1 1850008) (p2 1860008))
+(line (p1 1800000) (p2 1820000))
+(line (p1 1820000) (p2 1830000))
+(line (p1 1830000) (p2 1840000))
+(line (p1 1800000) (p2 1800002))
+(line (p1 1800002) (p2 1800003))
+(line (p1 1800003) (p2 1800004))
+(line (p1 1800004) (p2 1840004))
+(line (p1 1840004) (p2 1840000))
+(line (p1 1840000) (p2 1850001))
+(line (p1 1850001) (p2 1850002))
+(line (p1 1850002) (p2 1850003))
+(line (p1 1850003) (p2 1850005))
+(line (p1 1850005) (p2 1840004))
+(line (p1 1850005) (p2 1830005))
+(line (p1 1830005) (p2 1820005))
+(line (p1 1820005) (p2 1810005))
+(line (p1 1810005) (p2 1800004))
+(line (p1 1860000) (p2 1880000))
+(line (p1 1880000) (p2 1890000))
+(line (p1 1890000) (p2 1900000))
+(line (p1 1860000) (p2 1860002))
+(line (p1 1860002) (p2 1860003))
+(line (p1 1860003) (p2 1860004))
+(line (p1 1860004) (p2 1900004))
+(line (p1 1900004) (p2 1900000))
+(line (p1 1900000) (p2 1910001))
+(line (p1 1910001) (p2 1910002))
+(line (p1 1910002) (p2 1910003))
+(line (p1 1910003) (p2 1910005))
+(line (p1 1910005) (p2 1900004))
+(line (p1 1910005) (p2 1890005))
+(line (p1 1890005) (p2 1880005))
+(line (p1 1880005) (p2 1870005))
+(line (p1 1870005) (p2 1860004))
+(line (p1 1800006) (p2 1820006))
+(line (p1 1820006) (p2 1830006))
+(line (p1 1830006) (p2 1840006))
+(line (p1 1800006) (p2 1800008))
+(line (p1 1800008) (p2 1800009))
+(line (p1 1800009) (p2 1800010))
+(line (p1 1800010) (p2 1840010))
+(line (p1 1840010) (p2 1840006))
+(line (p1 1840006) (p2 1850007))
+(line (p1 1850007) (p2 1850008))
+(line (p1 1850008) (p2 1850009))
+(line (p1 1850009) (p2 1850011))
+(line (p1 1850011) (p2 1840010))
+(line (p1 1850011) (p2 1830011))
+(line (p1 1830011) (p2 1820011))
+(line (p1 1820011) (p2 1810011))
+(line (p1 1810011) (p2 1800010))
+(line (p1 1860006) (p2 1880006))
+(line (p1 1880006) (p2 1890006))
+(line (p1 1890006) (p2 1900006))
+(line (p1 1860006) (p2 1860008))
+(line (p1 1860008) (p2 1860009))
+(line (p1 1860009) (p2 1860010))
+(line (p1 1860010) (p2 1900010))
+(line (p1 1900010) (p2 1900006))
+(line (p1 1900006) (p2 1910007))
+(line (p1 1910007) (p2 1910008))
+(line (p1 1910008) (p2 1910009))
+(line (p1 1910009) (p2 1910011))
+(line (p1 1910011) (p2 1900010))
+(line (p1 1910011) (p2 1890011))
+(line (p1 1890011) (p2 1880011))
+(line (p1 1880011) (p2 1870011))
+(line (p1 1870011) (p2 1860010))
+(line (p1 1790003) (p2 1800003))
+(line (p1 1770005) (p2 1770006))
+(line (p1 1820005) (p2 1820006))
+(line (p1 1790008) (p2 1800008))
+(line (p1 1970003) (p2 1980003))
+(line (p1 1950005) (p2 1950006))
+(line (p1 2000005) (p2 2000006))
+(line (p1 1970008) (p2 1980008))
+(line (p1 1920000) (p2 1940000))
+(line (p1 1940000) (p2 1950000))
+(line (p1 1950000) (p2 1960000))
+(line (p1 1920000) (p2 1920002))
+(line (p1 1920002) (p2 1920003))
+(line (p1 1920003) (p2 1920004))
+(line (p1 1920004) (p2 1960004))
+(line (p1 1960004) (p2 1960000))
+(line (p1 1960000) (p2 1970001))
+(line (p1 1970001) (p2 1970002))
+(line (p1 1970002) (p2 1970003))
+(line (p1 1970003) (p2 1970005))
+(line (p1 1970005) (p2 1960004))
+(line (p1 1970005) (p2 1950005))
+(line (p1 1950005) (p2 1940005))
+(line (p1 1940005) (p2 1930005))
+(line (p1 1930005) (p2 1920004))
+(line (p1 1980000) (p2 2000000))
+(line (p1 2000000) (p2 2010000))
+(line (p1 2010000) (p2 2020000))
+(line (p1 1980000) (p2 1980002))
+(line (p1 1980002) (p2 1980003))
+(line (p1 1980003) (p2 1980004))
+(line (p1 1980004) (p2 2020004))
+(line (p1 2020004) (p2 2020000))
+(line (p1 2020000) (p2 2030001))
+(line (p1 2030001) (p2 2030002))
+(line (p1 2030002) (p2 2030003))
+(line (p1 2030003) (p2 2030005))
+(line (p1 2030005) (p2 2020004))
+(line (p1 2030005) (p2 2010005))
+(line (p1 2010005) (p2 2000005))
+(line (p1 2000005) (p2 1990005))
+(line (p1 1990005) (p2 1980004))
+(line (p1 1920006) (p2 1940006))
+(line (p1 1940006) (p2 1950006))
+(line (p1 1950006) (p2 1960006))
+(line (p1 1920006) (p2 1920008))
+(line (p1 1920008) (p2 1920009))
+(line (p1 1920009) (p2 1920010))
+(line (p1 1920010) (p2 1960010))
+(line (p1 1960010) (p2 1960006))
+(line (p1 1960006) (p2 1970007))
+(line (p1 1970007) (p2 1970008))
+(line (p1 1970008) (p2 1970009))
+(line (p1 1970009) (p2 1970011))
+(line (p1 1970011) (p2 1960010))
+(line (p1 1970011) (p2 1950011))
+(line (p1 1950011) (p2 1940011))
+(line (p1 1940011) (p2 1930011))
+(line (p1 1930011) (p2 1920010))
+(line (p1 1980006) (p2 2000006))
+(line (p1 2000006) (p2 2010006))
+(line (p1 2010006) (p2 2020006))
+(line (p1 1980006) (p2 1980008))
+(line (p1 1980008) (p2 1980009))
+(line (p1 1980009) (p2 1980010))
+(line (p1 1980010) (p2 2020010))
+(line (p1 2020010) (p2 2020006))
+(line (p1 2020006) (p2 2030007))
+(line (p1 2030007) (p2 2030008))
+(line (p1 2030008) (p2 2030009))
+(line (p1 2030009) (p2 2030011))
+(line (p1 2030011) (p2 2020010))
+(line (p1 2030011) (p2 2010011))
+(line (p1 2010011) (p2 2000011))
+(line (p1 2000011) (p2 1990011))
+(line (p1 1990011) (p2 1980010))
+(line (p1 1910003) (p2 1920003))
+(line (p1 1890005) (p2 1890006))
+(line (p1 1940005) (p2 1940006))
+(line (p1 1910008) (p2 1920008))
+(line (p1 2090003) (p2 2100003))
+(line (p1 2070005) (p2 2070006))
+(line (p1 2120005) (p2 2120006))
+(line (p1 2090008) (p2 2100008))
+(line (p1 2040000) (p2 2060000))
+(line (p1 2060000) (p2 2070000))
+(line (p1 2070000) (p2 2080000))
+(line (p1 2040000) (p2 2040002))
+(line (p1 2040002) (p2 2040003))
+(line (p1 2040003) (p2 2040004))
+(line (p1 2040004) (p2 2080004))
+(line (p1 2080004) (p2 2080000))
+(line (p1 2080000) (p2 2090001))
+(line (p1 2090001) (p2 2090002))
+(line (p1 2090002) (p2 2090003))
+(line (p1 2090003) (p2 2090005))
+(line (p1 2090005) (p2 2080004))
+(line (p1 2090005) (p2 2070005))
+(line (p1 2070005) (p2 2060005))
+(line (p1 2060005) (p2 2050005))
+(line (p1 2050005) (p2 2040004))
+(line (p1 2100000) (p2 2120000))
+(line (p1 2120000) (p2 2130000))
+(line (p1 2130000) (p2 2140000))
+(line (p1 2100000) (p2 2100002))
+(line (p1 2100002) (p2 2100003))
+(line (p1 2100003) (p2 2100004))
+(line (p1 2100004) (p2 2140004))
+(line (p1 2140004) (p2 2140000))
+(line (p1 2140000) (p2 2150001))
+(line (p1 2150001) (p2 2150002))
+(line (p1 2150002) (p2 2150003))
+(line (p1 2150003) (p2 2150005))
+(line (p1 2150005) (p2 2140004))
+(line (p1 2150005) (p2 2130005))
+(line (p1 2130005) (p2 2120005))
+(line (p1 2120005) (p2 2110005))
+(line (p1 2110005) (p2 2100004))
+(line (p1 2040006) (p2 2060006))
+(line (p1 2060006) (p2 2070006))
+(line (p1 2070006) (p2 2080006))
+(line (p1 2040006) (p2 2040008))
+(line (p1 2040008) (p2 2040009))
+(line (p1 2040009) (p2 2040010))
+(line (p1 2040010) (p2 2080010))
+(line (p1 2080010) (p2 2080006))
+(line (p1 2080006) (p2 2090007))
+(line (p1 2090007) (p2 2090008))
+(line (p1 2090008) (p2 2090009))
+(line (p1 2090009) (p2 2090011))
+(line (p1 2090011) (p2 2080010))
+(line (p1 2090011) (p2 2070011))
+(line (p1 2070011) (p2 2060011))
+(line (p1 2060011) (p2 2050011))
+(line (p1 2050011) (p2 2040010))
+(line (p1 2100006) (p2 2120006))
+(line (p1 2120006) (p2 2130006))
+(line (p1 2130006) (p2 2140006))
+(line (p1 2100006) (p2 2100008))
+(line (p1 2100008) (p2 2100009))
+(line (p1 2100009) (p2 2100010))
+(line (p1 2100010) (p2 2140010))
+(line (p1 2140010) (p2 2140006))
+(line (p1 2140006) (p2 2150007))
+(line (p1 2150007) (p2 2150008))
+(line (p1 2150008) (p2 2150009))
+(line (p1 2150009) (p2 2150011))
+(line (p1 2150011) (p2 2140010))
+(line (p1 2150011) (p2 2130011))
+(line (p1 2130011) (p2 2120011))
+(line (p1 2120011) (p2 2110011))
+(line (p1 2110011) (p2 2100010))
+(line (p1 2030003) (p2 2040003))
+(line (p1 2010005) (p2 2010006))
+(line (p1 2060005) (p2 2060006))
+(line (p1 2030008) (p2 2040008))
+(line (p1 2210003) (p2 2220003))
+(line (p1 2190005) (p2 2190006))
+(line (p1 2240005) (p2 2240006))
+(line (p1 2210008) (p2 2220008))
+(line (p1 2160000) (p2 2180000))
+(line (p1 2180000) (p2 2190000))
+(line (p1 2190000) (p2 2200000))
+(line (p1 2160000) (p2 2160002))
+(line (p1 2160002) (p2 2160003))
+(line (p1 2160003) (p2 2160004))
+(line (p1 2160004) (p2 2200004))
+(line (p1 2200004) (p2 2200000))
+(line (p1 2200000) (p2 2210001))
+(line (p1 2210001) (p2 2210002))
+(line (p1 2210002) (p2 2210003))
+(line (p1 2210003) (p2 2210005))
+(line (p1 2210005) (p2 2200004))
+(line (p1 2210005) (p2 2190005))
+(line (p1 2190005) (p2 2180005))
+(line (p1 2180005) (p2 2170005))
+(line (p1 2170005) (p2 2160004))
+(line (p1 2220000) (p2 2240000))
+(line (p1 2240000) (p2 2250000))
+(line (p1 2250000) (p2 2260000))
+(line (p1 2220000) (p2 2220002))
+(line (p1 2220002) (p2 2220003))
+(line (p1 2220003) (p2 2220004))
+(line (p1 2220004) (p2 2260004))
+(line (p1 2260004) (p2 2260000))
+(line (p1 2260000) (p2 2270001))
+(line (p1 2270001) (p2 2270002))
+(line (p1 2270002) (p2 2270003))
+(line (p1 2270003) (p2 2270005))
+(line (p1 2270005) (p2 2260004))
+(line (p1 2270005) (p2 2250005))
+(line (p1 2250005) (p2 2240005))
+(line (p1 2240005) (p2 2230005))
+(line (p1 2230005) (p2 2220004))
+(line (p1 2160006) (p2 2180006))
+(line (p1 2180006) (p2 2190006))
+(line (p1 2190006) (p2 2200006))
+(line (p1 2160006) (p2 2160008))
+(line (p1 2160008) (p2 2160009))
+(line (p1 2160009) (p2 2160010))
+(line (p1 2160010) (p2 2200010))
+(line (p1 2200010) (p2 2200006))
+(line (p1 2200006) (p2 2210007))
+(line (p1 2210007) (p2 2210008))
+(line (p1 2210008) (p2 2210009))
+(line (p1 2210009) (p2 2210011))
+(line (p1 2210011) (p2 2200010))
+(line (p1 2210011) (p2 2190011))
+(line (p1 2190011) (p2 2180011))
+(line (p1 2180011) (p2 2170011))
+(line (p1 2170011) (p2 2160010))
+(line (p1 2220006) (p2 2240006))
+(line (p1 2240006) (p2 2250006))
+(line (p1 2250006) (p2 2260006))
+(line (p1 2220006) (p2 2220008))
+(line (p1 2220008) (p2 2220009))
+(line (p1 2220009) (p2 2220010))
+(line (p1 2220010) (p2 2260010))
+(line (p1 2260010) (p2 2260006))
+(line (p1 2260006) (p2 2270007))
+(line (p1 2270007) (p2 2270008))
+(line (p1 2270008) (p2 2270009))
+(line (p1 2270009) (p2 2270011))
+(line (p1 2270011) (p2 2260010))
+(line (p1 2270011) (p2 2250011))
+(line (p1 2250011) (p2 2240011))
+(line (p1 2240011) (p2 2230011))
+(line (p1 2230011) (p2 2220010))
+(line (p1 2150003) (p2 2160003))
+(line (p1 2130005) (p2 2130006))
+(line (p1 2180005) (p2 2180006))
+(line (p1 2150008) (p2 2160008))
+(line (p1 2330003) (p2 2340003))
+(line (p1 2310005) (p2 2310006))
+(line (p1 2360005) (p2 2360006))
+(line (p1 2330008) (p2 2340008))
+(line (p1 2280000) (p2 2300000))
+(line (p1 2300000) (p2 2310000))
+(line (p1 2310000) (p2 2320000))
+(line (p1 2280000) (p2 2280002))
+(line (p1 2280002) (p2 2280003))
+(line (p1 2280003) (p2 2280004))
+(line (p1 2280004) (p2 2320004))
+(line (p1 2320004) (p2 2320000))
+(line (p1 2320000) (p2 2330001))
+(line (p1 2330001) (p2 2330002))
+(line (p1 2330002) (p2 2330003))
+(line (p1 2330003) (p2 2330005))
+(line (p1 2330005) (p2 2320004))
+(line (p1 2330005) (p2 2310005))
+(line (p1 2310005) (p2 2300005))
+(line (p1 2300005) (p2 2290005))
+(line (p1 2290005) (p2 2280004))
+(line (p1 2340000) (p2 2360000))
+(line (p1 2360000) (p2 2370000))
+(line (p1 2370000) (p2 2380000))
+(line (p1 2340000) (p2 2340002))
+(line (p1 2340002) (p2 2340003))
+(line (p1 2340003) (p2 2340004))
+(line (p1 2340004) (p2 2380004))
+(line (p1 2380004) (p2 2380000))
+(line (p1 2380000) (p2 2390001))
+(line (p1 2390001) (p2 2390002))
+(line (p1 2390002) (p2 2390003))
+(line (p1 2390003) (p2 2390005))
+(line (p1 2390005) (p2 2380004))
+(line (p1 2390005) (p2 2370005))
+(line (p1 2370005) (p2 2360005))
+(line (p1 2360005) (p2 2350005))
+(line (p1 2350005) (p2 2340004))
+(line (p1 2280006) (p2 2300006))
+(line (p1 2300006) (p2 2310006))
+(line (p1 2310006) (p2 2320006))
+(line (p1 2280006) (p2 2280008))
+(line (p1 2280008) (p2 2280009))
+(line (p1 2280009) (p2 2280010))
+(line (p1 2280010) (p2 2320010))
+(line (p1 2320010) (p2 2320006))
+(line (p1 2320006) (p2 2330007))
+(line (p1 2330007) (p2 2330008))
+(line (p1 2330008) (p2 2330009))
+(line (p1 2330009) (p2 2330011))
+(line (p1 2330011) (p2 2320010))
+(line (p1 2330011) (p2 2310011))
+(line (p1 2310011) (p2 2300011))
+(line (p1 2300011) (p2 2290011))
+(line (p1 2290011) (p2 2280010))
+(line (p1 2340006) (p2 2360006))
+(line (p1 2360006) (p2 2370006))
+(line (p1 2370006) (p2 2380006))
+(line (p1 2340006) (p2 2340008))
+(line (p1 2340008) (p2 2340009))
+(line (p1 2340009) (p2 2340010))
+(line (p1 2340010) (p2 2380010))
+(line (p1 2380010) (p2 2380006))
+(line (p1 2380006) (p2 2390007))
+(line (p1 2390007) (p2 2390008))
+(line (p1 2390008) (p2 2390009))
+(line (p1 2390009) (p2 2390011))
+(line (p1 2390011) (p2 2380010))
+(line (p1 2390011) (p2 2370011))
+(line (p1 2370011) (p2 2360011))
+(line (p1 2360011) (p2 2350011))
+(line (p1 2350011) (p2 2340010))
+(line (p1 2270003) (p2 2280003))
+(line (p1 2250005) (p2 2250006))
+(line (p1 2300005) (p2 2300006))
+(line (p1 2270008) (p2 2280008))
+(line (p1 2450003) (p2 2460003))
+(line (p1 2430005) (p2 2430006))
+(line (p1 2480005) (p2 2480006))
+(line (p1 2450008) (p2 2460008))
+(line (p1 2400000) (p2 2420000))
+(line (p1 2420000) (p2 2430000))
+(line (p1 2430000) (p2 2440000))
+(line (p1 2400000) (p2 2400002))
+(line (p1 2400002) (p2 2400003))
+(line (p1 2400003) (p2 2400004))
+(line (p1 2400004) (p2 2440004))
+(line (p1 2440004) (p2 2440000))
+(line (p1 2440000) (p2 2450001))
+(line (p1 2450001) (p2 2450002))
+(line (p1 2450002) (p2 2450003))
+(line (p1 2450003) (p2 2450005))
+(line (p1 2450005) (p2 2440004))
+(line (p1 2450005) (p2 2430005))
+(line (p1 2430005) (p2 2420005))
+(line (p1 2420005) (p2 2410005))
+(line (p1 2410005) (p2 2400004))
+(line (p1 2460000) (p2 2480000))
+(line (p1 2480000) (p2 2490000))
+(line (p1 2490000) (p2 2500000))
+(line (p1 2460000) (p2 2460002))
+(line (p1 2460002) (p2 2460003))
+(line (p1 2460003) (p2 2460004))
+(line (p1 2460004) (p2 2500004))
+(line (p1 2500004) (p2 2500000))
+(line (p1 2500000) (p2 2510001))
+(line (p1 2510001) (p2 2510002))
+(line (p1 2510002) (p2 2510003))
+(line (p1 2510003) (p2 2510005))
+(line (p1 2510005) (p2 2500004))
+(line (p1 2510005) (p2 2490005))
+(line (p1 2490005) (p2 2480005))
+(line (p1 2480005) (p2 2470005))
+(line (p1 2470005) (p2 2460004))
+(line (p1 2400006) (p2 2420006))
+(line (p1 2420006) (p2 2430006))
+(line (p1 2430006) (p2 2440006))
+(line (p1 2400006) (p2 2400008))
+(line (p1 2400008) (p2 2400009))
+(line (p1 2400009) (p2 2400010))
+(line (p1 2400010) (p2 2440010))
+(line (p1 2440010) (p2 2440006))
+(line (p1 2440006) (p2 2450007))
+(line (p1 2450007) (p2 2450008))
+(line (p1 2450008) (p2 2450009))
+(line (p1 2450009) (p2 2450011))
+(line (p1 2450011) (p2 2440010))
+(line (p1 2450011) (p2 2430011))
+(line (p1 2430011) (p2 2420011))
+(line (p1 2420011) (p2 2410011))
+(line (p1 2410011) (p2 2400010))
+(line (p1 2460006) (p2 2480006))
+(line (p1 2480006) (p2 2490006))
+(line (p1 2490006) (p2 2500006))
+(line (p1 2460006) (p2 2460008))
+(line (p1 2460008) (p2 2460009))
+(line (p1 2460009) (p2 2460010))
+(line (p1 2460010) (p2 2500010))
+(line (p1 2500010) (p2 2500006))
+(line (p1 2500006) (p2 2510007))
+(line (p1 2510007) (p2 2510008))
+(line (p1 2510008) (p2 2510009))
+(line (p1 2510009) (p2 2510011))
+(line (p1 2510011) (p2 2500010))
+(line (p1 2510011) (p2 2490011))
+(line (p1 2490011) (p2 2480011))
+(line (p1 2480011) (p2 2470011))
+(line (p1 2470011) (p2 2460010))
+(line (p1 2390003) (p2 2400003))
+(line (p1 2370005) (p2 2370006))
+(line (p1 2420005) (p2 2420006))
+(line (p1 2390008) (p2 2400008))
+(line (p1 2570003) (p2 2580003))
+(line (p1 2550005) (p2 2550006))
+(line (p1 2600005) (p2 2600006))
+(line (p1 2570008) (p2 2580008))
+(line (p1 2520000) (p2 2540000))
+(line (p1 2540000) (p2 2550000))
+(line (p1 2550000) (p2 2560000))
+(line (p1 2520000) (p2 2520002))
+(line (p1 2520002) (p2 2520003))
+(line (p1 2520003) (p2 2520004))
+(line (p1 2520004) (p2 2560004))
+(line (p1 2560004) (p2 2560000))
+(line (p1 2560000) (p2 2570001))
+(line (p1 2570001) (p2 2570002))
+(line (p1 2570002) (p2 2570003))
+(line (p1 2570003) (p2 2570005))
+(line (p1 2570005) (p2 2560004))
+(line (p1 2570005) (p2 2550005))
+(line (p1 2550005) (p2 2540005))
+(line (p1 2540005) (p2 2530005))
+(line (p1 2530005) (p2 2520004))
+(line (p1 2580000) (p2 2600000))
+(line (p1 2600000) (p2 2610000))
+(line (p1 2610000) (p2 2620000))
+(line (p1 2580000) (p2 2580002))
+(line (p1 2580002) (p2 2580003))
+(line (p1 2580003) (p2 2580004))
+(line (p1 2580004) (p2 2620004))
+(line (p1 2620004) (p2 2620000))
+(line (p1 2620000) (p2 2630001))
+(line (p1 2630001) (p2 2630002))
+(line (p1 2630002) (p2 2630003))
+(line (p1 2630003) (p2 2630005))
+(line (p1 2630005) (p2 2620004))
+(line (p1 2630005) (p2 2610005))
+(line (p1 2610005) (p2 2600005))
+(line (p1 2600005) (p2 2590005))
+(line (p1 2590005) (p2 2580004))
+(line (p1 2520006) (p2 2540006))
+(line (p1 2540006) (p2 2550006))
+(line (p1 2550006) (p2 2560006))
+(line (p1 2520006) (p2 2520008))
+(line (p1 2520008) (p2 2520009))
+(line (p1 2520009) (p2 2520010))
+(line (p1 2520010) (p2 2560010))
+(line (p1 2560010) (p2 2560006))
+(line (p1 2560006) (p2 2570007))
+(line (p1 2570007) (p2 2570008))
+(line (p1 2570008) (p2 2570009))
+(line (p1 2570009) (p2 2570011))
+(line (p1 2570011) (p2 2560010))
+(line (p1 2570011) (p2 2550011))
+(line (p1 2550011) (p2 2540011))
+(line (p1 2540011) (p2 2530011))
+(line (p1 2530011) (p2 2520010))
+(line (p1 2580006) (p2 2600006))
+(line (p1 2600006) (p2 2610006))
+(line (p1 2610006) (p2 2620006))
+(line (p1 2580006) (p2 2580008))
+(line (p1 2580008) (p2 2580009))
+(line (p1 2580009) (p2 2580010))
+(line (p1 2580010) (p2 2620010))
+(line (p1 2620010) (p2 2620006))
+(line (p1 2620006) (p2 2630007))
+(line (p1 2630007) (p2 2630008))
+(line (p1 2630008) (p2 2630009))
+(line (p1 2630009) (p2 2630011))
+(line (p1 2630011) (p2 2620010))
+(line (p1 2630011) (p2 2610011))
+(line (p1 2610011) (p2 2600011))
+(line (p1 2600011) (p2 2590011))
+(line (p1 2590011) (p2 2580010))
+(line (p1 2510003) (p2 2520003))
+(line (p1 2490005) (p2 2490006))
+(line (p1 2540005) (p2 2540006))
+(line (p1 2510008) (p2 2520008))
+(line (p1 2690003) (p2 2700003))
+(line (p1 2670005) (p2 2670006))
+(line (p1 2720005) (p2 2720006))
+(line (p1 2690008) (p2 2700008))
+(line (p1 2640000) (p2 2660000))
+(line (p1 2660000) (p2 2670000))
+(line (p1 2670000) (p2 2680000))
+(line (p1 2640000) (p2 2640002))
+(line (p1 2640002) (p2 2640003))
+(line (p1 2640003) (p2 2640004))
+(line (p1 2640004) (p2 2680004))
+(line (p1 2680004) (p2 2680000))
+(line (p1 2680000) (p2 2690001))
+(line (p1 2690001) (p2 2690002))
+(line (p1 2690002) (p2 2690003))
+(line (p1 2690003) (p2 2690005))
+(line (p1 2690005) (p2 2680004))
+(line (p1 2690005) (p2 2670005))
+(line (p1 2670005) (p2 2660005))
+(line (p1 2660005) (p2 2650005))
+(line (p1 2650005) (p2 2640004))
+(line (p1 2700000) (p2 2720000))
+(line (p1 2720000) (p2 2730000))
+(line (p1 2730000) (p2 2740000))
+(line (p1 2700000) (p2 2700002))
+(line (p1 2700002) (p2 2700003))
+(line (p1 2700003) (p2 2700004))
+(line (p1 2700004) (p2 2740004))
+(line (p1 2740004) (p2 2740000))
+(line (p1 2740000) (p2 2750001))
+(line (p1 2750001) (p2 2750002))
+(line (p1 2750002) (p2 2750003))
+(line (p1 2750003) (p2 2750005))
+(line (p1 2750005) (p2 2740004))
+(line (p1 2750005) (p2 2730005))
+(line (p1 2730005) (p2 2720005))
+(line (p1 2720005) (p2 2710005))
+(line (p1 2710005) (p2 2700004))
+(line (p1 2640006) (p2 2660006))
+(line (p1 2660006) (p2 2670006))
+(line (p1 2670006) (p2 2680006))
+(line (p1 2640006) (p2 2640008))
+(line (p1 2640008) (p2 2640009))
+(line (p1 2640009) (p2 2640010))
+(line (p1 2640010) (p2 2680010))
+(line (p1 2680010) (p2 2680006))
+(line (p1 2680006) (p2 2690007))
+(line (p1 2690007) (p2 2690008))
+(line (p1 2690008) (p2 2690009))
+(line (p1 2690009) (p2 2690011))
+(line (p1 2690011) (p2 2680010))
+(line (p1 2690011) (p2 2670011))
+(line (p1 2670011) (p2 2660011))
+(line (p1 2660011) (p2 2650011))
+(line (p1 2650011) (p2 2640010))
+(line (p1 2700006) (p2 2720006))
+(line (p1 2720006) (p2 2730006))
+(line (p1 2730006) (p2 2740006))
+(line (p1 2700006) (p2 2700008))
+(line (p1 2700008) (p2 2700009))
+(line (p1 2700009) (p2 2700010))
+(line (p1 2700010) (p2 2740010))
+(line (p1 2740010) (p2 2740006))
+(line (p1 2740006) (p2 2750007))
+(line (p1 2750007) (p2 2750008))
+(line (p1 2750008) (p2 2750009))
+(line (p1 2750009) (p2 2750011))
+(line (p1 2750011) (p2 2740010))
+(line (p1 2750011) (p2 2730011))
+(line (p1 2730011) (p2 2720011))
+(line (p1 2720011) (p2 2710011))
+(line (p1 2710011) (p2 2700010))
+(line (p1 2630003) (p2 2640003))
+(line (p1 2610005) (p2 2610006))
+(line (p1 2660005) (p2 2660006))
+(line (p1 2630008) (p2 2640008))
+(line (p1 2810003) (p2 2820003))
+(line (p1 2790005) (p2 2790006))
+(line (p1 2840005) (p2 2840006))
+(line (p1 2810008) (p2 2820008))
+(line (p1 2760000) (p2 2780000))
+(line (p1 2780000) (p2 2790000))
+(line (p1 2790000) (p2 2800000))
+(line (p1 2760000) (p2 2760002))
+(line (p1 2760002) (p2 2760003))
+(line (p1 2760003) (p2 2760004))
+(line (p1 2760004) (p2 2800004))
+(line (p1 2800004) (p2 2800000))
+(line (p1 2800000) (p2 2810001))
+(line (p1 2810001) (p2 2810002))
+(line (p1 2810002) (p2 2810003))
+(line (p1 2810003) (p2 2810005))
+(line (p1 2810005) (p2 2800004))
+(line (p1 2810005) (p2 2790005))
+(line (p1 2790005) (p2 2780005))
+(line (p1 2780005) (p2 2770005))
+(line (p1 2770005) (p2 2760004))
+(line (p1 2820000) (p2 2840000))
+(line (p1 2840000) (p2 2850000))
+(line (p1 2850000) (p2 2860000))
+(line (p1 2820000) (p2 2820002))
+(line (p1 2820002) (p2 2820003))
+(line (p1 2820003) (p2 2820004))
+(line (p1 2820004) (p2 2860004))
+(line (p1 2860004) (p2 2860000))
+(line (p1 2860000) (p2 2870001))
+(line (p1 2870001) (p2 2870002))
+(line (p1 2870002) (p2 2870003))
+(line (p1 2870003) (p2 2870005))
+(line (p1 2870005) (p2 2860004))
+(line (p1 2870005) (p2 2850005))
+(line (p1 2850005) (p2 2840005))
+(line (p1 2840005) (p2 2830005))
+(line (p1 2830005) (p2 2820004))
+(line (p1 2760006) (p2 2780006))
+(line (p1 2780006) (p2 2790006))
+(line (p1 2790006) (p2 2800006))
+(line (p1 2760006) (p2 2760008))
+(line (p1 2760008) (p2 2760009))
+(line (p1 2760009) (p2 2760010))
+(line (p1 2760010) (p2 2800010))
+(line (p1 2800010) (p2 2800006))
+(line (p1 2800006) (p2 2810007))
+(line (p1 2810007) (p2 2810008))
+(line (p1 2810008) (p2 2810009))
+(line (p1 2810009) (p2 2810011))
+(line (p1 2810011) (p2 2800010))
+(line (p1 2810011) (p2 2790011))
+(line (p1 2790011) (p2 2780011))
+(line (p1 2780011) (p2 2770011))
+(line (p1 2770011) (p2 2760010))
+(line (p1 2820006) (p2 2840006))
+(line (p1 2840006) (p2 2850006))
+(line (p1 2850006) (p2 2860006))
+(line (p1 2820006) (p2 2820008))
+(line (p1 2820008) (p2 2820009))
+(line (p1 2820009) (p2 2820010))
+(line (p1 2820010) (p2 2860010))
+(line (p1 2860010) (p2 2860006))
+(line (p1 2860006) (p2 2870007))
+(line (p1 2870007) (p2 2870008))
+(line (p1 2870008) (p2 2870009))
+(line (p1 2870009) (p2 2870011))
+(line (p1 2870011) (p2 2860010))
+(line (p1 2870011) (p2 2850011))
+(line (p1 2850011) (p2 2840011))
+(line (p1 2840011) (p2 2830011))
+(line (p1 2830011) (p2 2820010))
+(line (p1 2750003) (p2 2760003))
+(line (p1 2730005) (p2 2730006))
+(line (p1 2780005) (p2 2780006))
+(line (p1 2750008) (p2 2760008))
+(line (p1 2930003) (p2 2940003))
+(line (p1 2910005) (p2 2910006))
+(line (p1 2960005) (p2 2960006))
+(line (p1 2930008) (p2 2940008))
+(line (p1 2880000) (p2 2900000))
+(line (p1 2900000) (p2 2910000))
+(line (p1 2910000) (p2 2920000))
+(line (p1 2880000) (p2 2880002))
+(line (p1 2880002) (p2 2880003))
+(line (p1 2880003) (p2 2880004))
+(line (p1 2880004) (p2 2920004))
+(line (p1 2920004) (p2 2920000))
+(line (p1 2920000) (p2 2930001))
+(line (p1 2930001) (p2 2930002))
+(line (p1 2930002) (p2 2930003))
+(line (p1 2930003) (p2 2930005))
+(line (p1 2930005) (p2 2920004))
+(line (p1 2930005) (p2 2910005))
+(line (p1 2910005) (p2 2900005))
+(line (p1 2900005) (p2 2890005))
+(line (p1 2890005) (p2 2880004))
+(line (p1 2940000) (p2 2960000))
+(line (p1 2960000) (p2 2970000))
+(line (p1 2970000) (p2 2980000))
+(line (p1 2940000) (p2 2940002))
+(line (p1 2940002) (p2 2940003))
+(line (p1 2940003) (p2 2940004))
+(line (p1 2940004) (p2 2980004))
+(line (p1 2980004) (p2 2980000))
+(line (p1 2980000) (p2 2990001))
+(line (p1 2990001) (p2 2990002))
+(line (p1 2990002) (p2 2990003))
+(line (p1 2990003) (p2 2990005))
+(line (p1 2990005) (p2 2980004))
+(line (p1 2990005) (p2 2970005))
+(line (p1 2970005) (p2 2960005))
+(line (p1 2960005) (p2 2950005))
+(line (p1 2950005) (p2 2940004))
+(line (p1 2880006) (p2 2900006))
+(line (p1 2900006) (p2 2910006))
+(line (p1 2910006) (p2 2920006))
+(line (p1 2880006) (p2 2880008))
+(line (p1 2880008) (p2 2880009))
+(line (p1 2880009) (p2 2880010))
+(line (p1 2880010) (p2 2920010))
+(line (p1 2920010) (p2 2920006))
+(line (p1 2920006) (p2 2930007))
+(line (p1 2930007) (p2 2930008))
+(line (p1 2930008) (p2 2930009))
+(line (p1 2930009) (p2 2930011))
+(line (p1 2930011) (p2 2920010))
+(line (p1 2930011) (p2 2910011))
+(line (p1 2910011) (p2 2900011))
+(line (p1 2900011) (p2 2890011))
+(line (p1 2890011) (p2 2880010))
+(line (p1 2940006) (p2 2960006))
+(line (p1 2960006) (p2 2970006))
+(line (p1 2970006) (p2 2980006))
+(line (p1 2940006) (p2 2940008))
+(line (p1 2940008) (p2 2940009))
+(line (p1 2940009) (p2 2940010))
+(line (p1 2940010) (p2 2980010))
+(line (p1 2980010) (p2 2980006))
+(line (p1 2980006) (p2 2990007))
+(line (p1 2990007) (p2 2990008))
+(line (p1 2990008) (p2 2990009))
+(line (p1 2990009) (p2 2990011))
+(line (p1 2990011) (p2 2980010))
+(line (p1 2990011) (p2 2970011))
+(line (p1 2970011) (p2 2960011))
+(line (p1 2960011) (p2 2950011))
+(line (p1 2950011) (p2 2940010))
+(line (p1 2870003) (p2 2880003))
+(line (p1 2850005) (p2 2850006))
+(line (p1 2900005) (p2 2900006))
+(line (p1 2870008) (p2 2880008))
+(line (p1 3050003) (p2 3060003))
+(line (p1 3030005) (p2 3030006))
+(line (p1 3080005) (p2 3080006))
+(line (p1 3050008) (p2 3060008))
+(line (p1 3000000) (p2 3020000))
+(line (p1 3020000) (p2 3030000))
+(line (p1 3030000) (p2 3040000))
+(line (p1 3000000) (p2 3000002))
+(line (p1 3000002) (p2 3000003))
+(line (p1 3000003) (p2 3000004))
+(line (p1 3000004) (p2 3040004))
+(line (p1 3040004) (p2 3040000))
+(line (p1 3040000) (p2 3050001))
+(line (p1 3050001) (p2 3050002))
+(line (p1 3050002) (p2 3050003))
+(line (p1 3050003) (p2 3050005))
+(line (p1 3050005) (p2 3040004))
+(line (p1 3050005) (p2 3030005))
+(line (p1 3030005) (p2 3020005))
+(line (p1 3020005) (p2 3010005))
+(line (p1 3010005) (p2 3000004))
+(line (p1 3060000) (p2 3080000))
+(line (p1 3080000) (p2 3090000))
+(line (p1 3090000) (p2 3100000))
+(line (p1 3060000) (p2 3060002))
+(line (p1 3060002) (p2 3060003))
+(line (p1 3060003) (p2 3060004))
+(line (p1 3060004) (p2 3100004))
+(line (p1 3100004) (p2 3100000))
+(line (p1 3100000) (p2 3110001))
+(line (p1 3110001) (p2 3110002))
+(line (p1 3110002) (p2 3110003))
+(line (p1 3110003) (p2 3110005))
+(line (p1 3110005) (p2 3100004))
+(line (p1 3110005) (p2 3090005))
+(line (p1 3090005) (p2 3080005))
+(line (p1 3080005) (p2 3070005))
+(line (p1 3070005) (p2 3060004))
+(line (p1 3000006) (p2 3020006))
+(line (p1 3020006) (p2 3030006))
+(line (p1 3030006) (p2 3040006))
+(line (p1 3000006) (p2 3000008))
+(line (p1 3000008) (p2 3000009))
+(line (p1 3000009) (p2 3000010))
+(line (p1 3000010) (p2 3040010))
+(line (p1 3040010) (p2 3040006))
+(line (p1 3040006) (p2 3050007))
+(line (p1 3050007) (p2 3050008))
+(line (p1 3050008) (p2 3050009))
+(line (p1 3050009) (p2 3050011))
+(line (p1 3050011) (p2 3040010))
+(line (p1 3050011) (p2 3030011))
+(line (p1 3030011) (p2 3020011))
+(line (p1 3020011) (p2 3010011))
+(line (p1 3010011) (p2 3000010))
+(line (p1 3060006) (p2 3080006))
+(line (p1 3080006) (p2 3090006))
+(line (p1 3090006) (p2 3100006))
+(line (p1 3060006) (p2 3060008))
+(line (p1 3060008) (p2 3060009))
+(line (p1 3060009) (p2 3060010))
+(line (p1 3060010) (p2 3100010))
+(line (p1 3100010) (p2 3100006))
+(line (p1 3100006) (p2 3110007))
+(line (p1 3110007) (p2 3110008))
+(line (p1 3110008) (p2 3110009))
+(line (p1 3110009) (p2 3110011))
+(line (p1 3110011) (p2 3100010))
+(line (p1 3110011) (p2 3090011))
+(line (p1 3090011) (p2 3080011))
+(line (p1 3080011) (p2 3070011))
+(line (p1 3070011) (p2 3060010))
+(line (p1 2990003) (p2 3000003))
+(line (p1 2970005) (p2 2970006))
+(line (p1 3020005) (p2 3020006))
+(line (p1 2990008) (p2 3000008))
+(line (p1 3170003) (p2 3180003))
+(line (p1 3150005) (p2 3150006))
+(line (p1 3200005) (p2 3200006))
+(line (p1 3170008) (p2 3180008))
+(line (p1 3120000) (p2 3140000))
+(line (p1 3140000) (p2 3150000))
+(line (p1 3150000) (p2 3160000))
+(line (p1 3120000) (p2 3120002))
+(line (p1 3120002) (p2 3120003))
+(line (p1 3120003) (p2 3120004))
+(line (p1 3120004) (p2 3160004))
+(line (p1 3160004) (p2 3160000))
+(line (p1 3160000) (p2 3170001))
+(line (p1 3170001) (p2 3170002))
+(line (p1 3170002) (p2 3170003))
+(line (p1 3170003) (p2 3170005))
+(line (p1 3170005) (p2 3160004))
+(line (p1 3170005) (p2 3150005))
+(line (p1 3150005) (p2 3140005))
+(line (p1 3140005) (p2 3130005))
+(line (p1 3130005) (p2 3120004))
+(line (p1 3180000) (p2 3200000))
+(line (p1 3200000) (p2 3210000))
+(line (p1 3210000) (p2 3220000))
+(line (p1 3180000) (p2 3180002))
+(line (p1 3180002) (p2 3180003))
+(line (p1 3180003) (p2 3180004))
+(line (p1 3180004) (p2 3220004))
+(line (p1 3220004) (p2 3220000))
+(line (p1 3220000) (p2 3230001))
+(line (p1 3230001) (p2 3230002))
+(line (p1 3230002) (p2 3230003))
+(line (p1 3230003) (p2 3230005))
+(line (p1 3230005) (p2 3220004))
+(line (p1 3230005) (p2 3210005))
+(line (p1 3210005) (p2 3200005))
+(line (p1 3200005) (p2 3190005))
+(line (p1 3190005) (p2 3180004))
+(line (p1 3120006) (p2 3140006))
+(line (p1 3140006) (p2 3150006))
+(line (p1 3150006) (p2 3160006))
+(line (p1 3120006) (p2 3120008))
+(line (p1 3120008) (p2 3120009))
+(line (p1 3120009) (p2 3120010))
+(line (p1 3120010) (p2 3160010))
+(line (p1 3160010) (p2 3160006))
+(line (p1 3160006) (p2 3170007))
+(line (p1 3170007) (p2 3170008))
+(line (p1 3170008) (p2 3170009))
+(line (p1 3170009) (p2 3170011))
+(line (p1 3170011) (p2 3160010))
+(line (p1 3170011) (p2 3150011))
+(line (p1 3150011) (p2 3140011))
+(line (p1 3140011) (p2 3130011))
+(line (p1 3130011) (p2 3120010))
+(line (p1 3180006) (p2 3200006))
+(line (p1 3200006) (p2 3210006))
+(line (p1 3210006) (p2 3220006))
+(line (p1 3180006) (p2 3180008))
+(line (p1 3180008) (p2 3180009))
+(line (p1 3180009) (p2 3180010))
+(line (p1 3180010) (p2 3220010))
+(line (p1 3220010) (p2 3220006))
+(line (p1 3220006) (p2 3230007))
+(line (p1 3230007) (p2 3230008))
+(line (p1 3230008) (p2 3230009))
+(line (p1 3230009) (p2 3230011))
+(line (p1 3230011) (p2 3220010))
+(line (p1 3230011) (p2 3210011))
+(line (p1 3210011) (p2 3200011))
+(line (p1 3200011) (p2 3190011))
+(line (p1 3190011) (p2 3180010))
+(line (p1 3110003) (p2 3120003))
+(line (p1 3090005) (p2 3090006))
+(line (p1 3140005) (p2 3140006))
+(line (p1 3110008) (p2 3120008))
+(line (p1 3290003) (p2 3300003))
+(line (p1 3270005) (p2 3270006))
+(line (p1 3320005) (p2 3320006))
+(line (p1 3290008) (p2 3300008))
+(line (p1 3240000) (p2 3260000))
+(line (p1 3260000) (p2 3270000))
+(line (p1 3270000) (p2 3280000))
+(line (p1 3240000) (p2 3240002))
+(line (p1 3240002) (p2 3240003))
+(line (p1 3240003) (p2 3240004))
+(line (p1 3240004) (p2 3280004))
+(line (p1 3280004) (p2 3280000))
+(line (p1 3280000) (p2 3290001))
+(line (p1 3290001) (p2 3290002))
+(line (p1 3290002) (p2 3290003))
+(line (p1 3290003) (p2 3290005))
+(line (p1 3290005) (p2 3280004))
+(line (p1 3290005) (p2 3270005))
+(line (p1 3270005) (p2 3260005))
+(line (p1 3260005) (p2 3250005))
+(line (p1 3250005) (p2 3240004))
+(line (p1 3300000) (p2 3320000))
+(line (p1 3320000) (p2 3330000))
+(line (p1 3330000) (p2 3340000))
+(line (p1 3300000) (p2 3300002))
+(line (p1 3300002) (p2 3300003))
+(line (p1 3300003) (p2 3300004))
+(line (p1 3300004) (p2 3340004))
+(line (p1 3340004) (p2 3340000))
+(line (p1 3340000) (p2 3350001))
+(line (p1 3350001) (p2 3350002))
+(line (p1 3350002) (p2 3350003))
+(line (p1 3350003) (p2 3350005))
+(line (p1 3350005) (p2 3340004))
+(line (p1 3350005) (p2 3330005))
+(line (p1 3330005) (p2 3320005))
+(line (p1 3320005) (p2 3310005))
+(line (p1 3310005) (p2 3300004))
+(line (p1 3240006) (p2 3260006))
+(line (p1 3260006) (p2 3270006))
+(line (p1 3270006) (p2 3280006))
+(line (p1 3240006) (p2 3240008))
+(line (p1 3240008) (p2 3240009))
+(line (p1 3240009) (p2 3240010))
+(line (p1 3240010) (p2 3280010))
+(line (p1 3280010) (p2 3280006))
+(line (p1 3280006) (p2 3290007))
+(line (p1 3290007) (p2 3290008))
+(line (p1 3290008) (p2 3290009))
+(line (p1 3290009) (p2 3290011))
+(line (p1 3290011) (p2 3280010))
+(line (p1 3290011) (p2 3270011))
+(line (p1 3270011) (p2 3260011))
+(line (p1 3260011) (p2 3250011))
+(line (p1 3250011) (p2 3240010))
+(line (p1 3300006) (p2 3320006))
+(line (p1 3320006) (p2 3330006))
+(line (p1 3330006) (p2 3340006))
+(line (p1 3300006) (p2 3300008))
+(line (p1 3300008) (p2 3300009))
+(line (p1 3300009) (p2 3300010))
+(line (p1 3300010) (p2 3340010))
+(line (p1 3340010) (p2 3340006))
+(line (p1 3340006) (p2 3350007))
+(line (p1 3350007) (p2 3350008))
+(line (p1 3350008) (p2 3350009))
+(line (p1 3350009) (p2 3350011))
+(line (p1 3350011) (p2 3340010))
+(line (p1 3350011) (p2 3330011))
+(line (p1 3330011) (p2 3320011))
+(line (p1 3320011) (p2 3310011))
+(line (p1 3310011) (p2 3300010))
+(line (p1 3230003) (p2 3240003))
+(line (p1 3210005) (p2 3210006))
+(line (p1 3260005) (p2 3260006))
+(line (p1 3230008) (p2 3240008))
+(line (p1 3410003) (p2 3420003))
+(line (p1 3390005) (p2 3390006))
+(line (p1 3440005) (p2 3440006))
+(line (p1 3410008) (p2 3420008))
+(line (p1 3360000) (p2 3380000))
+(line (p1 3380000) (p2 3390000))
+(line (p1 3390000) (p2 3400000))
+(line (p1 3360000) (p2 3360002))
+(line (p1 3360002) (p2 3360003))
+(line (p1 3360003) (p2 3360004))
+(line (p1 3360004) (p2 3400004))
+(line (p1 3400004) (p2 3400000))
+(line (p1 3400000) (p2 3410001))
+(line (p1 3410001) (p2 3410002))
+(line (p1 3410002) (p2 3410003))
+(line (p1 3410003) (p2 3410005))
+(line (p1 3410005) (p2 3400004))
+(line (p1 3410005) (p2 3390005))
+(line (p1 3390005) (p2 3380005))
+(line (p1 3380005) (p2 3370005))
+(line (p1 3370005) (p2 3360004))
+(line (p1 3420000) (p2 3440000))
+(line (p1 3440000) (p2 3450000))
+(line (p1 3450000) (p2 3460000))
+(line (p1 3420000) (p2 3420002))
+(line (p1 3420002) (p2 3420003))
+(line (p1 3420003) (p2 3420004))
+(line (p1 3420004) (p2 3460004))
+(line (p1 3460004) (p2 3460000))
+(line (p1 3460000) (p2 3470001))
+(line (p1 3470001) (p2 3470002))
+(line (p1 3470002) (p2 3470003))
+(line (p1 3470003) (p2 3470005))
+(line (p1 3470005) (p2 3460004))
+(line (p1 3470005) (p2 3450005))
+(line (p1 3450005) (p2 3440005))
+(line (p1 3440005) (p2 3430005))
+(line (p1 3430005) (p2 3420004))
+(line (p1 3360006) (p2 3380006))
+(line (p1 3380006) (p2 3390006))
+(line (p1 3390006) (p2 3400006))
+(line (p1 3360006) (p2 3360008))
+(line (p1 3360008) (p2 3360009))
+(line (p1 3360009) (p2 3360010))
+(line (p1 3360010) (p2 3400010))
+(line (p1 3400010) (p2 3400006))
+(line (p1 3400006) (p2 3410007))
+(line (p1 3410007) (p2 3410008))
+(line (p1 3410008) (p2 3410009))
+(line (p1 3410009) (p2 3410011))
+(line (p1 3410011) (p2 3400010))
+(line (p1 3410011) (p2 3390011))
+(line (p1 3390011) (p2 3380011))
+(line (p1 3380011) (p2 3370011))
+(line (p1 3370011) (p2 3360010))
+(line (p1 3420006) (p2 3440006))
+(line (p1 3440006) (p2 3450006))
+(line (p1 3450006) (p2 3460006))
+(line (p1 3420006) (p2 3420008))
+(line (p1 3420008) (p2 3420009))
+(line (p1 3420009) (p2 3420010))
+(line (p1 3420010) (p2 3460010))
+(line (p1 3460010) (p2 3460006))
+(line (p1 3460006) (p2 3470007))
+(line (p1 3470007) (p2 3470008))
+(line (p1 3470008) (p2 3470009))
+(line (p1 3470009) (p2 3470011))
+(line (p1 3470011) (p2 3460010))
+(line (p1 3470011) (p2 3450011))
+(line (p1 3450011) (p2 3440011))
+(line (p1 3440011) (p2 3430011))
+(line (p1 3430011) (p2 3420010))
+(line (p1 3350003) (p2 3360003))
+(line (p1 3330005) (p2 3330006))
+(line (p1 3380005) (p2 3380006))
+(line (p1 3350008) (p2 3360008))
+(line (p1 3530003) (p2 3540003))
+(line (p1 3510005) (p2 3510006))
+(line (p1 3560005) (p2 3560006))
+(line (p1 3530008) (p2 3540008))
+(line (p1 3480000) (p2 3500000))
+(line (p1 3500000) (p2 3510000))
+(line (p1 3510000) (p2 3520000))
+(line (p1 3480000) (p2 3480002))
+(line (p1 3480002) (p2 3480003))
+(line (p1 3480003) (p2 3480004))
+(line (p1 3480004) (p2 3520004))
+(line (p1 3520004) (p2 3520000))
+(line (p1 3520000) (p2 3530001))
+(line (p1 3530001) (p2 3530002))
+(line (p1 3530002) (p2 3530003))
+(line (p1 3530003) (p2 3530005))
+(line (p1 3530005) (p2 3520004))
+(line (p1 3530005) (p2 3510005))
+(line (p1 3510005) (p2 3500005))
+(line (p1 3500005) (p2 3490005))
+(line (p1 3490005) (p2 3480004))
+(line (p1 3540000) (p2 3560000))
+(line (p1 3560000) (p2 3570000))
+(line (p1 3570000) (p2 3580000))
+(line (p1 3540000) (p2 3540002))
+(line (p1 3540002) (p2 3540003))
+(line (p1 3540003) (p2 3540004))
+(line (p1 3540004) (p2 3580004))
+(line (p1 3580004) (p2 3580000))
+(line (p1 3580000) (p2 3590001))
+(line (p1 3590001) (p2 3590002))
+(line (p1 3590002) (p2 3590003))
+(line (p1 3590003) (p2 3590005))
+(line (p1 3590005) (p2 3580004))
+(line (p1 3590005) (p2 3570005))
+(line (p1 3570005) (p2 3560005))
+(line (p1 3560005) (p2 3550005))
+(line (p1 3550005) (p2 3540004))
+(line (p1 3480006) (p2 3500006))
+(line (p1 3500006) (p2 3510006))
+(line (p1 3510006) (p2 3520006))
+(line (p1 3480006) (p2 3480008))
+(line (p1 3480008) (p2 3480009))
+(line (p1 3480009) (p2 3480010))
+(line (p1 3480010) (p2 3520010))
+(line (p1 3520010) (p2 3520006))
+(line (p1 3520006) (p2 3530007))
+(line (p1 3530007) (p2 3530008))
+(line (p1 3530008) (p2 3530009))
+(line (p1 3530009) (p2 3530011))
+(line (p1 3530011) (p2 3520010))
+(line (p1 3530011) (p2 3510011))
+(line (p1 3510011) (p2 3500011))
+(line (p1 3500011) (p2 3490011))
+(line (p1 3490011) (p2 3480010))
+(line (p1 3540006) (p2 3560006))
+(line (p1 3560006) (p2 3570006))
+(line (p1 3570006) (p2 3580006))
+(line (p1 3540006) (p2 3540008))
+(line (p1 3540008) (p2 3540009))
+(line (p1 3540009) (p2 3540010))
+(line (p1 3540010) (p2 3580010))
+(line (p1 3580010) (p2 3580006))
+(line (p1 3580006) (p2 3590007))
+(line (p1 3590007) (p2 3590008))
+(line (p1 3590008) (p2 3590009))
+(line (p1 3590009) (p2 3590011))
+(line (p1 3590011) (p2 3580010))
+(line (p1 3590011) (p2 3570011))
+(line (p1 3570011) (p2 3560011))
+(line (p1 3560011) (p2 3550011))
+(line (p1 3550011) (p2 3540010))
+(line (p1 3470003) (p2 3480003))
+(line (p1 3450005) (p2 3450006))
+(line (p1 3500005) (p2 3500006))
+(line (p1 3470008) (p2 3480008))
+(line (p1 3650003) (p2 3660003))
+(line (p1 3630005) (p2 3630006))
+(line (p1 3680005) (p2 3680006))
+(line (p1 3650008) (p2 3660008))
+(line (p1 3600000) (p2 3620000))
+(line (p1 3620000) (p2 3630000))
+(line (p1 3630000) (p2 3640000))
+(line (p1 3600000) (p2 3600002))
+(line (p1 3600002) (p2 3600003))
+(line (p1 3600003) (p2 3600004))
+(line (p1 3600004) (p2 3640004))
+(line (p1 3640004) (p2 3640000))
+(line (p1 3640000) (p2 3650001))
+(line (p1 3650001) (p2 3650002))
+(line (p1 3650002) (p2 3650003))
+(line (p1 3650003) (p2 3650005))
+(line (p1 3650005) (p2 3640004))
+(line (p1 3650005) (p2 3630005))
+(line (p1 3630005) (p2 3620005))
+(line (p1 3620005) (p2 3610005))
+(line (p1 3610005) (p2 3600004))
+(line (p1 3660000) (p2 3680000))
+(line (p1 3680000) (p2 3690000))
+(line (p1 3690000) (p2 3700000))
+(line (p1 3660000) (p2 3660002))
+(line (p1 3660002) (p2 3660003))
+(line (p1 3660003) (p2 3660004))
+(line (p1 3660004) (p2 3700004))
+(line (p1 3700004) (p2 3700000))
+(line (p1 3700000) (p2 3710001))
+(line (p1 3710001) (p2 3710002))
+(line (p1 3710002) (p2 3710003))
+(line (p1 3710003) (p2 3710005))
+(line (p1 3710005) (p2 3700004))
+(line (p1 3710005) (p2 3690005))
+(line (p1 3690005) (p2 3680005))
+(line (p1 3680005) (p2 3670005))
+(line (p1 3670005) (p2 3660004))
+(line (p1 3600006) (p2 3620006))
+(line (p1 3620006) (p2 3630006))
+(line (p1 3630006) (p2 3640006))
+(line (p1 3600006) (p2 3600008))
+(line (p1 3600008) (p2 3600009))
+(line (p1 3600009) (p2 3600010))
+(line (p1 3600010) (p2 3640010))
+(line (p1 3640010) (p2 3640006))
+(line (p1 3640006) (p2 3650007))
+(line (p1 3650007) (p2 3650008))
+(line (p1 3650008) (p2 3650009))
+(line (p1 3650009) (p2 3650011))
+(line (p1 3650011) (p2 3640010))
+(line (p1 3650011) (p2 3630011))
+(line (p1 3630011) (p2 3620011))
+(line (p1 3620011) (p2 3610011))
+(line (p1 3610011) (p2 3600010))
+(line (p1 3660006) (p2 3680006))
+(line (p1 3680006) (p2 3690006))
+(line (p1 3690006) (p2 3700006))
+(line (p1 3660006) (p2 3660008))
+(line (p1 3660008) (p2 3660009))
+(line (p1 3660009) (p2 3660010))
+(line (p1 3660010) (p2 3700010))
+(line (p1 3700010) (p2 3700006))
+(line (p1 3700006) (p2 3710007))
+(line (p1 3710007) (p2 3710008))
+(line (p1 3710008) (p2 3710009))
+(line (p1 3710009) (p2 3710011))
+(line (p1 3710011) (p2 3700010))
+(line (p1 3710011) (p2 3690011))
+(line (p1 3690011) (p2 3680011))
+(line (p1 3680011) (p2 3670011))
+(line (p1 3670011) (p2 3660010))
+(line (p1 3590003) (p2 3600003))
+(line (p1 3570005) (p2 3570006))
+(line (p1 3620005) (p2 3620006))
+(line (p1 3590008) (p2 3600008))
+(line (p1 3770003) (p2 3780003))
+(line (p1 3750005) (p2 3750006))
+(line (p1 3800005) (p2 3800006))
+(line (p1 3770008) (p2 3780008))
+(line (p1 3720000) (p2 3740000))
+(line (p1 3740000) (p2 3750000))
+(line (p1 3750000) (p2 3760000))
+(line (p1 3720000) (p2 3720002))
+(line (p1 3720002) (p2 3720003))
+(line (p1 3720003) (p2 3720004))
+(line (p1 3720004) (p2 3760004))
+(line (p1 3760004) (p2 3760000))
+(line (p1 3760000) (p2 3770001))
+(line (p1 3770001) (p2 3770002))
+(line (p1 3770002) (p2 3770003))
+(line (p1 3770003) (p2 3770005))
+(line (p1 3770005) (p2 3760004))
+(line (p1 3770005) (p2 3750005))
+(line (p1 3750005) (p2 3740005))
+(line (p1 3740005) (p2 3730005))
+(line (p1 3730005) (p2 3720004))
+(line (p1 3780000) (p2 3800000))
+(line (p1 3800000) (p2 3810000))
+(line (p1 3810000) (p2 3820000))
+(line (p1 3780000) (p2 3780002))
+(line (p1 3780002) (p2 3780003))
+(line (p1 3780003) (p2 3780004))
+(line (p1 3780004) (p2 3820004))
+(line (p1 3820004) (p2 3820000))
+(line (p1 3820000) (p2 3830001))
+(line (p1 3830001) (p2 3830002))
+(line (p1 3830002) (p2 3830003))
+(line (p1 3830003) (p2 3830005))
+(line (p1 3830005) (p2 3820004))
+(line (p1 3830005) (p2 3810005))
+(line (p1 3810005) (p2 3800005))
+(line (p1 3800005) (p2 3790005))
+(line (p1 3790005) (p2 3780004))
+(line (p1 3720006) (p2 3740006))
+(line (p1 3740006) (p2 3750006))
+(line (p1 3750006) (p2 3760006))
+(line (p1 3720006) (p2 3720008))
+(line (p1 3720008) (p2 3720009))
+(line (p1 3720009) (p2 3720010))
+(line (p1 3720010) (p2 3760010))
+(line (p1 3760010) (p2 3760006))
+(line (p1 3760006) (p2 3770007))
+(line (p1 3770007) (p2 3770008))
+(line (p1 3770008) (p2 3770009))
+(line (p1 3770009) (p2 3770011))
+(line (p1 3770011) (p2 3760010))
+(line (p1 3770011) (p2 3750011))
+(line (p1 3750011) (p2 3740011))
+(line (p1 3740011) (p2 3730011))
+(line (p1 3730011) (p2 3720010))
+(line (p1 3780006) (p2 3800006))
+(line (p1 3800006) (p2 3810006))
+(line (p1 3810006) (p2 3820006))
+(line (p1 3780006) (p2 3780008))
+(line (p1 3780008) (p2 3780009))
+(line (p1 3780009) (p2 3780010))
+(line (p1 3780010) (p2 3820010))
+(line (p1 3820010) (p2 3820006))
+(line (p1 3820006) (p2 3830007))
+(line (p1 3830007) (p2 3830008))
+(line (p1 3830008) (p2 3830009))
+(line (p1 3830009) (p2 3830011))
+(line (p1 3830011) (p2 3820010))
+(line (p1 3830011) (p2 3810011))
+(line (p1 3810011) (p2 3800011))
+(line (p1 3800011) (p2 3790011))
+(line (p1 3790011) (p2 3780010))
+(line (p1 3710003) (p2 3720003))
+(line (p1 3690005) (p2 3690006))
+(line (p1 3740005) (p2 3740006))
+(line (p1 3710008) (p2 3720008))
+(line (p1 3890003) (p2 3900003))
+(line (p1 3870005) (p2 3870006))
+(line (p1 3920005) (p2 3920006))
+(line (p1 3890008) (p2 3900008))
+(line (p1 3840000) (p2 3860000))
+(line (p1 3860000) (p2 3870000))
+(line (p1 3870000) (p2 3880000))
+(line (p1 3840000) (p2 3840002))
+(line (p1 3840002) (p2 3840003))
+(line (p1 3840003) (p2 3840004))
+(line (p1 3840004) (p2 3880004))
+(line (p1 3880004) (p2 3880000))
+(line (p1 3880000) (p2 3890001))
+(line (p1 3890001) (p2 3890002))
+(line (p1 3890002) (p2 3890003))
+(line (p1 3890003) (p2 3890005))
+(line (p1 3890005) (p2 3880004))
+(line (p1 3890005) (p2 3870005))
+(line (p1 3870005) (p2 3860005))
+(line (p1 3860005) (p2 3850005))
+(line (p1 3850005) (p2 3840004))
+(line (p1 3900000) (p2 3920000))
+(line (p1 3920000) (p2 3930000))
+(line (p1 3930000) (p2 3940000))
+(line (p1 3900000) (p2 3900002))
+(line (p1 3900002) (p2 3900003))
+(line (p1 3900003) (p2 3900004))
+(line (p1 3900004) (p2 3940004))
+(line (p1 3940004) (p2 3940000))
+(line (p1 3940000) (p2 3950001))
+(line (p1 3950001) (p2 3950002))
+(line (p1 3950002) (p2 3950003))
+(line (p1 3950003) (p2 3950005))
+(line (p1 3950005) (p2 3940004))
+(line (p1 3950005) (p2 3930005))
+(line (p1 3930005) (p2 3920005))
+(line (p1 3920005) (p2 3910005))
+(line (p1 3910005) (p2 3900004))
+(line (p1 3840006) (p2 3860006))
+(line (p1 3860006) (p2 3870006))
+(line (p1 3870006) (p2 3880006))
+(line (p1 3840006) (p2 3840008))
+(line (p1 3840008) (p2 3840009))
+(line (p1 3840009) (p2 3840010))
+(line (p1 3840010) (p2 3880010))
+(line (p1 3880010) (p2 3880006))
+(line (p1 3880006) (p2 3890007))
+(line (p1 3890007) (p2 3890008))
+(line (p1 3890008) (p2 3890009))
+(line (p1 3890009) (p2 3890011))
+(line (p1 3890011) (p2 3880010))
+(line (p1 3890011) (p2 3870011))
+(line (p1 3870011) (p2 3860011))
+(line (p1 3860011) (p2 3850011))
+(line (p1 3850011) (p2 3840010))
+(line (p1 3900006) (p2 3920006))
+(line (p1 3920006) (p2 3930006))
+(line (p1 3930006) (p2 3940006))
+(line (p1 3900006) (p2 3900008))
+(line (p1 3900008) (p2 3900009))
+(line (p1 3900009) (p2 3900010))
+(line (p1 3900010) (p2 3940010))
+(line (p1 3940010) (p2 3940006))
+(line (p1 3940006) (p2 3950007))
+(line (p1 3950007) (p2 3950008))
+(line (p1 3950008) (p2 3950009))
+(line (p1 3950009) (p2 3950011))
+(line (p1 3950011) (p2 3940010))
+(line (p1 3950011) (p2 3930011))
+(line (p1 3930011) (p2 3920011))
+(line (p1 3920011) (p2 3910011))
+(line (p1 3910011) (p2 3900010))
+(line (p1 3830003) (p2 3840003))
+(line (p1 3810005) (p2 3810006))
+(line (p1 3860005) (p2 3860006))
+(line (p1 3830008) (p2 3840008))
+(line (p1 4010003) (p2 4020003))
+(line (p1 3990005) (p2 3990006))
+(line (p1 4040005) (p2 4040006))
+(line (p1 4010008) (p2 4020008))
+(line (p1 3960000) (p2 3980000))
+(line (p1 3980000) (p2 3990000))
+(line (p1 3990000) (p2 4000000))
+(line (p1 3960000) (p2 3960002))
+(line (p1 3960002) (p2 3960003))
+(line (p1 3960003) (p2 3960004))
+(line (p1 3960004) (p2 4000004))
+(line (p1 4000004) (p2 4000000))
+(line (p1 4000000) (p2 4010001))
+(line (p1 4010001) (p2 4010002))
+(line (p1 4010002) (p2 4010003))
+(line (p1 4010003) (p2 4010005))
+(line (p1 4010005) (p2 4000004))
+(line (p1 4010005) (p2 3990005))
+(line (p1 3990005) (p2 3980005))
+(line (p1 3980005) (p2 3970005))
+(line (p1 3970005) (p2 3960004))
+(line (p1 4020000) (p2 4040000))
+(line (p1 4040000) (p2 4050000))
+(line (p1 4050000) (p2 4060000))
+(line (p1 4020000) (p2 4020002))
+(line (p1 4020002) (p2 4020003))
+(line (p1 4020003) (p2 4020004))
+(line (p1 4020004) (p2 4060004))
+(line (p1 4060004) (p2 4060000))
+(line (p1 4060000) (p2 4070001))
+(line (p1 4070001) (p2 4070002))
+(line (p1 4070002) (p2 4070003))
+(line (p1 4070003) (p2 4070005))
+(line (p1 4070005) (p2 4060004))
+(line (p1 4070005) (p2 4050005))
+(line (p1 4050005) (p2 4040005))
+(line (p1 4040005) (p2 4030005))
+(line (p1 4030005) (p2 4020004))
+(line (p1 3960006) (p2 3980006))
+(line (p1 3980006) (p2 3990006))
+(line (p1 3990006) (p2 4000006))
+(line (p1 3960006) (p2 3960008))
+(line (p1 3960008) (p2 3960009))
+(line (p1 3960009) (p2 3960010))
+(line (p1 3960010) (p2 4000010))
+(line (p1 4000010) (p2 4000006))
+(line (p1 4000006) (p2 4010007))
+(line (p1 4010007) (p2 4010008))
+(line (p1 4010008) (p2 4010009))
+(line (p1 4010009) (p2 4010011))
+(line (p1 4010011) (p2 4000010))
+(line (p1 4010011) (p2 3990011))
+(line (p1 3990011) (p2 3980011))
+(line (p1 3980011) (p2 3970011))
+(line (p1 3970011) (p2 3960010))
+(line (p1 4020006) (p2 4040006))
+(line (p1 4040006) (p2 4050006))
+(line (p1 4050006) (p2 4060006))
+(line (p1 4020006) (p2 4020008))
+(line (p1 4020008) (p2 4020009))
+(line (p1 4020009) (p2 4020010))
+(line (p1 4020010) (p2 4060010))
+(line (p1 4060010) (p2 4060006))
+(line (p1 4060006) (p2 4070007))
+(line (p1 4070007) (p2 4070008))
+(line (p1 4070008) (p2 4070009))
+(line (p1 4070009) (p2 4070011))
+(line (p1 4070011) (p2 4060010))
+(line (p1 4070011) (p2 4050011))
+(line (p1 4050011) (p2 4040011))
+(line (p1 4040011) (p2 4030011))
+(line (p1 4030011) (p2 4020010))
+(line (p1 3950003) (p2 3960003))
+(line (p1 3930005) (p2 3930006))
+(line (p1 3980005) (p2 3980006))
+(line (p1 3950008) (p2 3960008))
+(line (p1 4130003) (p2 4140003))
+(line (p1 4110005) (p2 4110006))
+(line (p1 4160005) (p2 4160006))
+(line (p1 4130008) (p2 4140008))
+(line (p1 4080000) (p2 4100000))
+(line (p1 4100000) (p2 4110000))
+(line (p1 4110000) (p2 4120000))
+(line (p1 4080000) (p2 4080002))
+(line (p1 4080002) (p2 4080003))
+(line (p1 4080003) (p2 4080004))
+(line (p1 4080004) (p2 4120004))
+(line (p1 4120004) (p2 4120000))
+(line (p1 4120000) (p2 4130001))
+(line (p1 4130001) (p2 4130002))
+(line (p1 4130002) (p2 4130003))
+(line (p1 4130003) (p2 4130005))
+(line (p1 4130005) (p2 4120004))
+(line (p1 4130005) (p2 4110005))
+(line (p1 4110005) (p2 4100005))
+(line (p1 4100005) (p2 4090005))
+(line (p1 4090005) (p2 4080004))
+(line (p1 4140000) (p2 4160000))
+(line (p1 4160000) (p2 4170000))
+(line (p1 4170000) (p2 4180000))
+(line (p1 4140000) (p2 4140002))
+(line (p1 4140002) (p2 4140003))
+(line (p1 4140003) (p2 4140004))
+(line (p1 4140004) (p2 4180004))
+(line (p1 4180004) (p2 4180000))
+(line (p1 4180000) (p2 4190001))
+(line (p1 4190001) (p2 4190002))
+(line (p1 4190002) (p2 4190003))
+(line (p1 4190003) (p2 4190005))
+(line (p1 4190005) (p2 4180004))
+(line (p1 4190005) (p2 4170005))
+(line (p1 4170005) (p2 4160005))
+(line (p1 4160005) (p2 4150005))
+(line (p1 4150005) (p2 4140004))
+(line (p1 4080006) (p2 4100006))
+(line (p1 4100006) (p2 4110006))
+(line (p1 4110006) (p2 4120006))
+(line (p1 4080006) (p2 4080008))
+(line (p1 4080008) (p2 4080009))
+(line (p1 4080009) (p2 4080010))
+(line (p1 4080010) (p2 4120010))
+(line (p1 4120010) (p2 4120006))
+(line (p1 4120006) (p2 4130007))
+(line (p1 4130007) (p2 4130008))
+(line (p1 4130008) (p2 4130009))
+(line (p1 4130009) (p2 4130011))
+(line (p1 4130011) (p2 4120010))
+(line (p1 4130011) (p2 4110011))
+(line (p1 4110011) (p2 4100011))
+(line (p1 4100011) (p2 4090011))
+(line (p1 4090011) (p2 4080010))
+(line (p1 4140006) (p2 4160006))
+(line (p1 4160006) (p2 4170006))
+(line (p1 4170006) (p2 4180006))
+(line (p1 4140006) (p2 4140008))
+(line (p1 4140008) (p2 4140009))
+(line (p1 4140009) (p2 4140010))
+(line (p1 4140010) (p2 4180010))
+(line (p1 4180010) (p2 4180006))
+(line (p1 4180006) (p2 4190007))
+(line (p1 4190007) (p2 4190008))
+(line (p1 4190008) (p2 4190009))
+(line (p1 4190009) (p2 4190011))
+(line (p1 4190011) (p2 4180010))
+(line (p1 4190011) (p2 4170011))
+(line (p1 4170011) (p2 4160011))
+(line (p1 4160011) (p2 4150011))
+(line (p1 4150011) (p2 4140010))
+(line (p1 4070003) (p2 4080003))
+(line (p1 4050005) (p2 4050006))
+(line (p1 4100005) (p2 4100006))
+(line (p1 4070008) (p2 4080008))
+(line (p1 4250003) (p2 4260003))
+(line (p1 4230005) (p2 4230006))
+(line (p1 4280005) (p2 4280006))
+(line (p1 4250008) (p2 4260008))
+(line (p1 4200000) (p2 4220000))
+(line (p1 4220000) (p2 4230000))
+(line (p1 4230000) (p2 4240000))
+(line (p1 4200000) (p2 4200002))
+(line (p1 4200002) (p2 4200003))
+(line (p1 4200003) (p2 4200004))
+(line (p1 4200004) (p2 4240004))
+(line (p1 4240004) (p2 4240000))
+(line (p1 4240000) (p2 4250001))
+(line (p1 4250001) (p2 4250002))
+(line (p1 4250002) (p2 4250003))
+(line (p1 4250003) (p2 4250005))
+(line (p1 4250005) (p2 4240004))
+(line (p1 4250005) (p2 4230005))
+(line (p1 4230005) (p2 4220005))
+(line (p1 4220005) (p2 4210005))
+(line (p1 4210005) (p2 4200004))
+(line (p1 4260000) (p2 4280000))
+(line (p1 4280000) (p2 4290000))
+(line (p1 4290000) (p2 4300000))
+(line (p1 4260000) (p2 4260002))
+(line (p1 4260002) (p2 4260003))
+(line (p1 4260003) (p2 4260004))
+(line (p1 4260004) (p2 4300004))
+(line (p1 4300004) (p2 4300000))
+(line (p1 4300000) (p2 4310001))
+(line (p1 4310001) (p2 4310002))
+(line (p1 4310002) (p2 4310003))
+(line (p1 4310003) (p2 4310005))
+(line (p1 4310005) (p2 4300004))
+(line (p1 4310005) (p2 4290005))
+(line (p1 4290005) (p2 4280005))
+(line (p1 4280005) (p2 4270005))
+(line (p1 4270005) (p2 4260004))
+(line (p1 4200006) (p2 4220006))
+(line (p1 4220006) (p2 4230006))
+(line (p1 4230006) (p2 4240006))
+(line (p1 4200006) (p2 4200008))
+(line (p1 4200008) (p2 4200009))
+(line (p1 4200009) (p2 4200010))
+(line (p1 4200010) (p2 4240010))
+(line (p1 4240010) (p2 4240006))
+(line (p1 4240006) (p2 4250007))
+(line (p1 4250007) (p2 4250008))
+(line (p1 4250008) (p2 4250009))
+(line (p1 4250009) (p2 4250011))
+(line (p1 4250011) (p2 4240010))
+(line (p1 4250011) (p2 4230011))
+(line (p1 4230011) (p2 4220011))
+(line (p1 4220011) (p2 4210011))
+(line (p1 4210011) (p2 4200010))
+(line (p1 4260006) (p2 4280006))
+(line (p1 4280006) (p2 4290006))
+(line (p1 4290006) (p2 4300006))
+(line (p1 4260006) (p2 4260008))
+(line (p1 4260008) (p2 4260009))
+(line (p1 4260009) (p2 4260010))
+(line (p1 4260010) (p2 4300010))
+(line (p1 4300010) (p2 4300006))
+(line (p1 4300006) (p2 4310007))
+(line (p1 4310007) (p2 4310008))
+(line (p1 4310008) (p2 4310009))
+(line (p1 4310009) (p2 4310011))
+(line (p1 4310011) (p2 4300010))
+(line (p1 4310011) (p2 4290011))
+(line (p1 4290011) (p2 4280011))
+(line (p1 4280011) (p2 4270011))
+(line (p1 4270011) (p2 4260010))
+(line (p1 4190003) (p2 4200003))
+(line (p1 4170005) (p2 4170006))
+(line (p1 4220005) (p2 4220006))
+(line (p1 4190008) (p2 4200008))
+(line (p1 4370003) (p2 4380003))
+(line (p1 4350005) (p2 4350006))
+(line (p1 4400005) (p2 4400006))
+(line (p1 4370008) (p2 4380008))
+(line (p1 4320000) (p2 4340000))
+(line (p1 4340000) (p2 4350000))
+(line (p1 4350000) (p2 4360000))
+(line (p1 4320000) (p2 4320002))
+(line (p1 4320002) (p2 4320003))
+(line (p1 4320003) (p2 4320004))
+(line (p1 4320004) (p2 4360004))
+(line (p1 4360004) (p2 4360000))
+(line (p1 4360000) (p2 4370001))
+(line (p1 4370001) (p2 4370002))
+(line (p1 4370002) (p2 4370003))
+(line (p1 4370003) (p2 4370005))
+(line (p1 4370005) (p2 4360004))
+(line (p1 4370005) (p2 4350005))
+(line (p1 4350005) (p2 4340005))
+(line (p1 4340005) (p2 4330005))
+(line (p1 4330005) (p2 4320004))
+(line (p1 4380000) (p2 4400000))
+(line (p1 4400000) (p2 4410000))
+(line (p1 4410000) (p2 4420000))
+(line (p1 4380000) (p2 4380002))
+(line (p1 4380002) (p2 4380003))
+(line (p1 4380003) (p2 4380004))
+(line (p1 4380004) (p2 4420004))
+(line (p1 4420004) (p2 4420000))
+(line (p1 4420000) (p2 4430001))
+(line (p1 4430001) (p2 4430002))
+(line (p1 4430002) (p2 4430003))
+(line (p1 4430003) (p2 4430005))
+(line (p1 4430005) (p2 4420004))
+(line (p1 4430005) (p2 4410005))
+(line (p1 4410005) (p2 4400005))
+(line (p1 4400005) (p2 4390005))
+(line (p1 4390005) (p2 4380004))
+(line (p1 4320006) (p2 4340006))
+(line (p1 4340006) (p2 4350006))
+(line (p1 4350006) (p2 4360006))
+(line (p1 4320006) (p2 4320008))
+(line (p1 4320008) (p2 4320009))
+(line (p1 4320009) (p2 4320010))
+(line (p1 4320010) (p2 4360010))
+(line (p1 4360010) (p2 4360006))
+(line (p1 4360006) (p2 4370007))
+(line (p1 4370007) (p2 4370008))
+(line (p1 4370008) (p2 4370009))
+(line (p1 4370009) (p2 4370011))
+(line (p1 4370011) (p2 4360010))
+(line (p1 4370011) (p2 4350011))
+(line (p1 4350011) (p2 4340011))
+(line (p1 4340011) (p2 4330011))
+(line (p1 4330011) (p2 4320010))
+(line (p1 4380006) (p2 4400006))
+(line (p1 4400006) (p2 4410006))
+(line (p1 4410006) (p2 4420006))
+(line (p1 4380006) (p2 4380008))
+(line (p1 4380008) (p2 4380009))
+(line (p1 4380009) (p2 4380010))
+(line (p1 4380010) (p2 4420010))
+(line (p1 4420010) (p2 4420006))
+(line (p1 4420006) (p2 4430007))
+(line (p1 4430007) (p2 4430008))
+(line (p1 4430008) (p2 4430009))
+(line (p1 4430009) (p2 4430011))
+(line (p1 4430011) (p2 4420010))
+(line (p1 4430011) (p2 4410011))
+(line (p1 4410011) (p2 4400011))
+(line (p1 4400011) (p2 4390011))
+(line (p1 4390011) (p2 4380010))
+(line (p1 4310003) (p2 4320003))
+(line (p1 4290005) (p2 4290006))
+(line (p1 4340005) (p2 4340006))
+(line (p1 4310008) (p2 4320008))
+(line (p1 4490003) (p2 4500003))
+(line (p1 4470005) (p2 4470006))
+(line (p1 4520005) (p2 4520006))
+(line (p1 4490008) (p2 4500008))
+(line (p1 4440000) (p2 4460000))
+(line (p1 4460000) (p2 4470000))
+(line (p1 4470000) (p2 4480000))
+(line (p1 4440000) (p2 4440002))
+(line (p1 4440002) (p2 4440003))
+(line (p1 4440003) (p2 4440004))
+(line (p1 4440004) (p2 4480004))
+(line (p1 4480004) (p2 4480000))
+(line (p1 4480000) (p2 4490001))
+(line (p1 4490001) (p2 4490002))
+(line (p1 4490002) (p2 4490003))
+(line (p1 4490003) (p2 4490005))
+(line (p1 4490005) (p2 4480004))
+(line (p1 4490005) (p2 4470005))
+(line (p1 4470005) (p2 4460005))
+(line (p1 4460005) (p2 4450005))
+(line (p1 4450005) (p2 4440004))
+(line (p1 4500000) (p2 4520000))
+(line (p1 4520000) (p2 4530000))
+(line (p1 4530000) (p2 4540000))
+(line (p1 4500000) (p2 4500002))
+(line (p1 4500002) (p2 4500003))
+(line (p1 4500003) (p2 4500004))
+(line (p1 4500004) (p2 4540004))
+(line (p1 4540004) (p2 4540000))
+(line (p1 4540000) (p2 4550001))
+(line (p1 4550001) (p2 4550002))
+(line (p1 4550002) (p2 4550003))
+(line (p1 4550003) (p2 4550005))
+(line (p1 4550005) (p2 4540004))
+(line (p1 4550005) (p2 4530005))
+(line (p1 4530005) (p2 4520005))
+(line (p1 4520005) (p2 4510005))
+(line (p1 4510005) (p2 4500004))
+(line (p1 4440006) (p2 4460006))
+(line (p1 4460006) (p2 4470006))
+(line (p1 4470006) (p2 4480006))
+(line (p1 4440006) (p2 4440008))
+(line (p1 4440008) (p2 4440009))
+(line (p1 4440009) (p2 4440010))
+(line (p1 4440010) (p2 4480010))
+(line (p1 4480010) (p2 4480006))
+(line (p1 4480006) (p2 4490007))
+(line (p1 4490007) (p2 4490008))
+(line (p1 4490008) (p2 4490009))
+(line (p1 4490009) (p2 4490011))
+(line (p1 4490011) (p2 4480010))
+(line (p1 4490011) (p2 4470011))
+(line (p1 4470011) (p2 4460011))
+(line (p1 4460011) (p2 4450011))
+(line (p1 4450011) (p2 4440010))
+(line (p1 4500006) (p2 4520006))
+(line (p1 4520006) (p2 4530006))
+(line (p1 4530006) (p2 4540006))
+(line (p1 4500006) (p2 4500008))
+(line (p1 4500008) (p2 4500009))
+(line (p1 4500009) (p2 4500010))
+(line (p1 4500010) (p2 4540010))
+(line (p1 4540010) (p2 4540006))
+(line (p1 4540006) (p2 4550007))
+(line (p1 4550007) (p2 4550008))
+(line (p1 4550008) (p2 4550009))
+(line (p1 4550009) (p2 4550011))
+(line (p1 4550011) (p2 4540010))
+(line (p1 4550011) (p2 4530011))
+(line (p1 4530011) (p2 4520011))
+(line (p1 4520011) (p2 4510011))
+(line (p1 4510011) (p2 4500010))
+(line (p1 4430003) (p2 4440003))
+(line (p1 4410005) (p2 4410006))
+(line (p1 4460005) (p2 4460006))
+(line (p1 4430008) (p2 4440008))
+(line (p1 4610003) (p2 4620003))
+(line (p1 4590005) (p2 4590006))
+(line (p1 4640005) (p2 4640006))
+(line (p1 4610008) (p2 4620008))
+(line (p1 4560000) (p2 4580000))
+(line (p1 4580000) (p2 4590000))
+(line (p1 4590000) (p2 4600000))
+(line (p1 4560000) (p2 4560002))
+(line (p1 4560002) (p2 4560003))
+(line (p1 4560003) (p2 4560004))
+(line (p1 4560004) (p2 4600004))
+(line (p1 4600004) (p2 4600000))
+(line (p1 4600000) (p2 4610001))
+(line (p1 4610001) (p2 4610002))
+(line (p1 4610002) (p2 4610003))
+(line (p1 4610003) (p2 4610005))
+(line (p1 4610005) (p2 4600004))
+(line (p1 4610005) (p2 4590005))
+(line (p1 4590005) (p2 4580005))
+(line (p1 4580005) (p2 4570005))
+(line (p1 4570005) (p2 4560004))
+(line (p1 4620000) (p2 4640000))
+(line (p1 4640000) (p2 4650000))
+(line (p1 4650000) (p2 4660000))
+(line (p1 4620000) (p2 4620002))
+(line (p1 4620002) (p2 4620003))
+(line (p1 4620003) (p2 4620004))
+(line (p1 4620004) (p2 4660004))
+(line (p1 4660004) (p2 4660000))
+(line (p1 4660000) (p2 4670001))
+(line (p1 4670001) (p2 4670002))
+(line (p1 4670002) (p2 4670003))
+(line (p1 4670003) (p2 4670005))
+(line (p1 4670005) (p2 4660004))
+(line (p1 4670005) (p2 4650005))
+(line (p1 4650005) (p2 4640005))
+(line (p1 4640005) (p2 4630005))
+(line (p1 4630005) (p2 4620004))
+(line (p1 4560006) (p2 4580006))
+(line (p1 4580006) (p2 4590006))
+(line (p1 4590006) (p2 4600006))
+(line (p1 4560006) (p2 4560008))
+(line (p1 4560008) (p2 4560009))
+(line (p1 4560009) (p2 4560010))
+(line (p1 4560010) (p2 4600010))
+(line (p1 4600010) (p2 4600006))
+(line (p1 4600006) (p2 4610007))
+(line (p1 4610007) (p2 4610008))
+(line (p1 4610008) (p2 4610009))
+(line (p1 4610009) (p2 4610011))
+(line (p1 4610011) (p2 4600010))
+(line (p1 4610011) (p2 4590011))
+(line (p1 4590011) (p2 4580011))
+(line (p1 4580011) (p2 4570011))
+(line (p1 4570011) (p2 4560010))
+(line (p1 4620006) (p2 4640006))
+(line (p1 4640006) (p2 4650006))
+(line (p1 4650006) (p2 4660006))
+(line (p1 4620006) (p2 4620008))
+(line (p1 4620008) (p2 4620009))
+(line (p1 4620009) (p2 4620010))
+(line (p1 4620010) (p2 4660010))
+(line (p1 4660010) (p2 4660006))
+(line (p1 4660006) (p2 4670007))
+(line (p1 4670007) (p2 4670008))
+(line (p1 4670008) (p2 4670009))
+(line (p1 4670009) (p2 4670011))
+(line (p1 4670011) (p2 4660010))
+(line (p1 4670011) (p2 4650011))
+(line (p1 4650011) (p2 4640011))
+(line (p1 4640011) (p2 4630011))
+(line (p1 4630011) (p2 4620010))
+(line (p1 4550003) (p2 4560003))
+(line (p1 4530005) (p2 4530006))
+(line (p1 4580005) (p2 4580006))
+(line (p1 4550008) (p2 4560008))
+(line (p1 4730003) (p2 4740003))
+(line (p1 4710005) (p2 4710006))
+(line (p1 4760005) (p2 4760006))
+(line (p1 4730008) (p2 4740008))
+(line (p1 4680000) (p2 4700000))
+(line (p1 4700000) (p2 4710000))
+(line (p1 4710000) (p2 4720000))
+(line (p1 4680000) (p2 4680002))
+(line (p1 4680002) (p2 4680003))
+(line (p1 4680003) (p2 4680004))
+(line (p1 4680004) (p2 4720004))
+(line (p1 4720004) (p2 4720000))
+(line (p1 4720000) (p2 4730001))
+(line (p1 4730001) (p2 4730002))
+(line (p1 4730002) (p2 4730003))
+(line (p1 4730003) (p2 4730005))
+(line (p1 4730005) (p2 4720004))
+(line (p1 4730005) (p2 4710005))
+(line (p1 4710005) (p2 4700005))
+(line (p1 4700005) (p2 4690005))
+(line (p1 4690005) (p2 4680004))
+(line (p1 4740000) (p2 4760000))
+(line (p1 4760000) (p2 4770000))
+(line (p1 4770000) (p2 4780000))
+(line (p1 4740000) (p2 4740002))
+(line (p1 4740002) (p2 4740003))
+(line (p1 4740003) (p2 4740004))
+(line (p1 4740004) (p2 4780004))
+(line (p1 4780004) (p2 4780000))
+(line (p1 4780000) (p2 4790001))
+(line (p1 4790001) (p2 4790002))
+(line (p1 4790002) (p2 4790003))
+(line (p1 4790003) (p2 4790005))
+(line (p1 4790005) (p2 4780004))
+(line (p1 4790005) (p2 4770005))
+(line (p1 4770005) (p2 4760005))
+(line (p1 4760005) (p2 4750005))
+(line (p1 4750005) (p2 4740004))
+(line (p1 4680006) (p2 4700006))
+(line (p1 4700006) (p2 4710006))
+(line (p1 4710006) (p2 4720006))
+(line (p1 4680006) (p2 4680008))
+(line (p1 4680008) (p2 4680009))
+(line (p1 4680009) (p2 4680010))
+(line (p1 4680010) (p2 4720010))
+(line (p1 4720010) (p2 4720006))
+(line (p1 4720006) (p2 4730007))
+(line (p1 4730007) (p2 4730008))
+(line (p1 4730008) (p2 4730009))
+(line (p1 4730009) (p2 4730011))
+(line (p1 4730011) (p2 4720010))
+(line (p1 4730011) (p2 4710011))
+(line (p1 4710011) (p2 4700011))
+(line (p1 4700011) (p2 4690011))
+(line (p1 4690011) (p2 4680010))
+(line (p1 4740006) (p2 4760006))
+(line (p1 4760006) (p2 4770006))
+(line (p1 4770006) (p2 4780006))
+(line (p1 4740006) (p2 4740008))
+(line (p1 4740008) (p2 4740009))
+(line (p1 4740009) (p2 4740010))
+(line (p1 4740010) (p2 4780010))
+(line (p1 4780010) (p2 4780006))
+(line (p1 4780006) (p2 4790007))
+(line (p1 4790007) (p2 4790008))
+(line (p1 4790008) (p2 4790009))
+(line (p1 4790009) (p2 4790011))
+(line (p1 4790011) (p2 4780010))
+(line (p1 4790011) (p2 4770011))
+(line (p1 4770011) (p2 4760011))
+(line (p1 4760011) (p2 4750011))
+(line (p1 4750011) (p2 4740010))
+(line (p1 4670003) (p2 4680003))
+(line (p1 4650005) (p2 4650006))
+(line (p1 4700005) (p2 4700006))
+(line (p1 4670008) (p2 4680008))
+(line (p1 4850003) (p2 4860003))
+(line (p1 4830005) (p2 4830006))
+(line (p1 4880005) (p2 4880006))
+(line (p1 4850008) (p2 4860008))
+(line (p1 4800000) (p2 4820000))
+(line (p1 4820000) (p2 4830000))
+(line (p1 4830000) (p2 4840000))
+(line (p1 4800000) (p2 4800002))
+(line (p1 4800002) (p2 4800003))
+(line (p1 4800003) (p2 4800004))
+(line (p1 4800004) (p2 4840004))
+(line (p1 4840004) (p2 4840000))
+(line (p1 4840000) (p2 4850001))
+(line (p1 4850001) (p2 4850002))
+(line (p1 4850002) (p2 4850003))
+(line (p1 4850003) (p2 4850005))
+(line (p1 4850005) (p2 4840004))
+(line (p1 4850005) (p2 4830005))
+(line (p1 4830005) (p2 4820005))
+(line (p1 4820005) (p2 4810005))
+(line (p1 4810005) (p2 4800004))
+(line (p1 4860000) (p2 4880000))
+(line (p1 4880000) (p2 4890000))
+(line (p1 4890000) (p2 4900000))
+(line (p1 4860000) (p2 4860002))
+(line (p1 4860002) (p2 4860003))
+(line (p1 4860003) (p2 4860004))
+(line (p1 4860004) (p2 4900004))
+(line (p1 4900004) (p2 4900000))
+(line (p1 4900000) (p2 4910001))
+(line (p1 4910001) (p2 4910002))
+(line (p1 4910002) (p2 4910003))
+(line (p1 4910003) (p2 4910005))
+(line (p1 4910005) (p2 4900004))
+(line (p1 4910005) (p2 4890005))
+(line (p1 4890005) (p2 4880005))
+(line (p1 4880005) (p2 4870005))
+(line (p1 4870005) (p2 4860004))
+(line (p1 4800006) (p2 4820006))
+(line (p1 4820006) (p2 4830006))
+(line (p1 4830006) (p2 4840006))
+(line (p1 4800006) (p2 4800008))
+(line (p1 4800008) (p2 4800009))
+(line (p1 4800009) (p2 4800010))
+(line (p1 4800010) (p2 4840010))
+(line (p1 4840010) (p2 4840006))
+(line (p1 4840006) (p2 4850007))
+(line (p1 4850007) (p2 4850008))
+(line (p1 4850008) (p2 4850009))
+(line (p1 4850009) (p2 4850011))
+(line (p1 4850011) (p2 4840010))
+(line (p1 4850011) (p2 4830011))
+(line (p1 4830011) (p2 4820011))
+(line (p1 4820011) (p2 4810011))
+(line (p1 4810011) (p2 4800010))
+(line (p1 4860006) (p2 4880006))
+(line (p1 4880006) (p2 4890006))
+(line (p1 4890006) (p2 4900006))
+(line (p1 4860006) (p2 4860008))
+(line (p1 4860008) (p2 4860009))
+(line (p1 4860009) (p2 4860010))
+(line (p1 4860010) (p2 4900010))
+(line (p1 4900010) (p2 4900006))
+(line (p1 4900006) (p2 4910007))
+(line (p1 4910007) (p2 4910008))
+(line (p1 4910008) (p2 4910009))
+(line (p1 4910009) (p2 4910011))
+(line (p1 4910011) (p2 4900010))
+(line (p1 4910011) (p2 4890011))
+(line (p1 4890011) (p2 4880011))
+(line (p1 4880011) (p2 4870011))
+(line (p1 4870011) (p2 4860010))
+(line (p1 4790003) (p2 4800003))
+(line (p1 4770005) (p2 4770006))
+(line (p1 4820005) (p2 4820006))
+(line (p1 4790008) (p2 4800008))
+(line (p1 4970003) (p2 4980003))
+(line (p1 4950005) (p2 4950006))
+(line (p1 5000005) (p2 5000006))
+(line (p1 4970008) (p2 4980008))
+(line (p1 4920000) (p2 4940000))
+(line (p1 4940000) (p2 4950000))
+(line (p1 4950000) (p2 4960000))
+(line (p1 4920000) (p2 4920002))
+(line (p1 4920002) (p2 4920003))
+(line (p1 4920003) (p2 4920004))
+(line (p1 4920004) (p2 4960004))
+(line (p1 4960004) (p2 4960000))
+(line (p1 4960000) (p2 4970001))
+(line (p1 4970001) (p2 4970002))
+(line (p1 4970002) (p2 4970003))
+(line (p1 4970003) (p2 4970005))
+(line (p1 4970005) (p2 4960004))
+(line (p1 4970005) (p2 4950005))
+(line (p1 4950005) (p2 4940005))
+(line (p1 4940005) (p2 4930005))
+(line (p1 4930005) (p2 4920004))
+(line (p1 4980000) (p2 5000000))
+(line (p1 5000000) (p2 5010000))
+(line (p1 5010000) (p2 5020000))
+(line (p1 4980000) (p2 4980002))
+(line (p1 4980002) (p2 4980003))
+(line (p1 4980003) (p2 4980004))
+(line (p1 4980004) (p2 5020004))
+(line (p1 5020004) (p2 5020000))
+(line (p1 5020000) (p2 5030001))
+(line (p1 5030001) (p2 5030002))
+(line (p1 5030002) (p2 5030003))
+(line (p1 5030003) (p2 5030005))
+(line (p1 5030005) (p2 5020004))
+(line (p1 5030005) (p2 5010005))
+(line (p1 5010005) (p2 5000005))
+(line (p1 5000005) (p2 4990005))
+(line (p1 4990005) (p2 4980004))
+(line (p1 4920006) (p2 4940006))
+(line (p1 4940006) (p2 4950006))
+(line (p1 4950006) (p2 4960006))
+(line (p1 4920006) (p2 4920008))
+(line (p1 4920008) (p2 4920009))
+(line (p1 4920009) (p2 4920010))
+(line (p1 4920010) (p2 4960010))
+(line (p1 4960010) (p2 4960006))
+(line (p1 4960006) (p2 4970007))
+(line (p1 4970007) (p2 4970008))
+(line (p1 4970008) (p2 4970009))
+(line (p1 4970009) (p2 4970011))
+(line (p1 4970011) (p2 4960010))
+(line (p1 4970011) (p2 4950011))
+(line (p1 4950011) (p2 4940011))
+(line (p1 4940011) (p2 4930011))
+(line (p1 4930011) (p2 4920010))
+(line (p1 4980006) (p2 5000006))
+(line (p1 5000006) (p2 5010006))
+(line (p1 5010006) (p2 5020006))
+(line (p1 4980006) (p2 4980008))
+(line (p1 4980008) (p2 4980009))
+(line (p1 4980009) (p2 4980010))
+(line (p1 4980010) (p2 5020010))
+(line (p1 5020010) (p2 5020006))
+(line (p1 5020006) (p2 5030007))
+(line (p1 5030007) (p2 5030008))
+(line (p1 5030008) (p2 5030009))
+(line (p1 5030009) (p2 5030011))
+(line (p1 5030011) (p2 5020010))
+(line (p1 5030011) (p2 5010011))
+(line (p1 5010011) (p2 5000011))
+(line (p1 5000011) (p2 4990011))
+(line (p1 4990011) (p2 4980010))
+(line (p1 4910003) (p2 4920003))
+(line (p1 4890005) (p2 4890006))
+(line (p1 4940005) (p2 4940006))
+(line (p1 4910008) (p2 4920008))
+(line (p1 5090003) (p2 5100003))
+(line (p1 5070005) (p2 5070006))
+(line (p1 5120005) (p2 5120006))
+(line (p1 5090008) (p2 5100008))
+(line (p1 5040000) (p2 5060000))
+(line (p1 5060000) (p2 5070000))
+(line (p1 5070000) (p2 5080000))
+(line (p1 5040000) (p2 5040002))
+(line (p1 5040002) (p2 5040003))
+(line (p1 5040003) (p2 5040004))
+(line (p1 5040004) (p2 5080004))
+(line (p1 5080004) (p2 5080000))
+(line (p1 5080000) (p2 5090001))
+(line (p1 5090001) (p2 5090002))
+(line (p1 5090002) (p2 5090003))
+(line (p1 5090003) (p2 5090005))
+(line (p1 5090005) (p2 5080004))
+(line (p1 5090005) (p2 5070005))
+(line (p1 5070005) (p2 5060005))
+(line (p1 5060005) (p2 5050005))
+(line (p1 5050005) (p2 5040004))
+(line (p1 5100000) (p2 5120000))
+(line (p1 5120000) (p2 5130000))
+(line (p1 5130000) (p2 5140000))
+(line (p1 5100000) (p2 5100002))
+(line (p1 5100002) (p2 5100003))
+(line (p1 5100003) (p2 5100004))
+(line (p1 5100004) (p2 5140004))
+(line (p1 5140004) (p2 5140000))
+(line (p1 5140000) (p2 5150001))
+(line (p1 5150001) (p2 5150002))
+(line (p1 5150002) (p2 5150003))
+(line (p1 5150003) (p2 5150005))
+(line (p1 5150005) (p2 5140004))
+(line (p1 5150005) (p2 5130005))
+(line (p1 5130005) (p2 5120005))
+(line (p1 5120005) (p2 5110005))
+(line (p1 5110005) (p2 5100004))
+(line (p1 5040006) (p2 5060006))
+(line (p1 5060006) (p2 5070006))
+(line (p1 5070006) (p2 5080006))
+(line (p1 5040006) (p2 5040008))
+(line (p1 5040008) (p2 5040009))
+(line (p1 5040009) (p2 5040010))
+(line (p1 5040010) (p2 5080010))
+(line (p1 5080010) (p2 5080006))
+(line (p1 5080006) (p2 5090007))
+(line (p1 5090007) (p2 5090008))
+(line (p1 5090008) (p2 5090009))
+(line (p1 5090009) (p2 5090011))
+(line (p1 5090011) (p2 5080010))
+(line (p1 5090011) (p2 5070011))
+(line (p1 5070011) (p2 5060011))
+(line (p1 5060011) (p2 5050011))
+(line (p1 5050011) (p2 5040010))
+(line (p1 5100006) (p2 5120006))
+(line (p1 5120006) (p2 5130006))
+(line (p1 5130006) (p2 5140006))
+(line (p1 5100006) (p2 5100008))
+(line (p1 5100008) (p2 5100009))
+(line (p1 5100009) (p2 5100010))
+(line (p1 5100010) (p2 5140010))
+(line (p1 5140010) (p2 5140006))
+(line (p1 5140006) (p2 5150007))
+(line (p1 5150007) (p2 5150008))
+(line (p1 5150008) (p2 5150009))
+(line (p1 5150009) (p2 5150011))
+(line (p1 5150011) (p2 5140010))
+(line (p1 5150011) (p2 5130011))
+(line (p1 5130011) (p2 5120011))
+(line (p1 5120011) (p2 5110011))
+(line (p1 5110011) (p2 5100010))
+(line (p1 5030003) (p2 5040003))
+(line (p1 5010005) (p2 5010006))
+(line (p1 5060005) (p2 5060006))
+(line (p1 5030008) (p2 5040008))
+(line (p1 5210003) (p2 5220003))
+(line (p1 5190005) (p2 5190006))
+(line (p1 5240005) (p2 5240006))
+(line (p1 5210008) (p2 5220008))
+(line (p1 5160000) (p2 5180000))
+(line (p1 5180000) (p2 5190000))
+(line (p1 5190000) (p2 5200000))
+(line (p1 5160000) (p2 5160002))
+(line (p1 5160002) (p2 5160003))
+(line (p1 5160003) (p2 5160004))
+(line (p1 5160004) (p2 5200004))
+(line (p1 5200004) (p2 5200000))
+(line (p1 5200000) (p2 5210001))
+(line (p1 5210001) (p2 5210002))
+(line (p1 5210002) (p2 5210003))
+(line (p1 5210003) (p2 5210005))
+(line (p1 5210005) (p2 5200004))
+(line (p1 5210005) (p2 5190005))
+(line (p1 5190005) (p2 5180005))
+(line (p1 5180005) (p2 5170005))
+(line (p1 5170005) (p2 5160004))
+(line (p1 5220000) (p2 5240000))
+(line (p1 5240000) (p2 5250000))
+(line (p1 5250000) (p2 5260000))
+(line (p1 5220000) (p2 5220002))
+(line (p1 5220002) (p2 5220003))
+(line (p1 5220003) (p2 5220004))
+(line (p1 5220004) (p2 5260004))
+(line (p1 5260004) (p2 5260000))
+(line (p1 5260000) (p2 5270001))
+(line (p1 5270001) (p2 5270002))
+(line (p1 5270002) (p2 5270003))
+(line (p1 5270003) (p2 5270005))
+(line (p1 5270005) (p2 5260004))
+(line (p1 5270005) (p2 5250005))
+(line (p1 5250005) (p2 5240005))
+(line (p1 5240005) (p2 5230005))
+(line (p1 5230005) (p2 5220004))
+(line (p1 5160006) (p2 5180006))
+(line (p1 5180006) (p2 5190006))
+(line (p1 5190006) (p2 5200006))
+(line (p1 5160006) (p2 5160008))
+(line (p1 5160008) (p2 5160009))
+(line (p1 5160009) (p2 5160010))
+(line (p1 5160010) (p2 5200010))
+(line (p1 5200010) (p2 5200006))
+(line (p1 5200006) (p2 5210007))
+(line (p1 5210007) (p2 5210008))
+(line (p1 5210008) (p2 5210009))
+(line (p1 5210009) (p2 5210011))
+(line (p1 5210011) (p2 5200010))
+(line (p1 5210011) (p2 5190011))
+(line (p1 5190011) (p2 5180011))
+(line (p1 5180011) (p2 5170011))
+(line (p1 5170011) (p2 5160010))
+(line (p1 5220006) (p2 5240006))
+(line (p1 5240006) (p2 5250006))
+(line (p1 5250006) (p2 5260006))
+(line (p1 5220006) (p2 5220008))
+(line (p1 5220008) (p2 5220009))
+(line (p1 5220009) (p2 5220010))
+(line (p1 5220010) (p2 5260010))
+(line (p1 5260010) (p2 5260006))
+(line (p1 5260006) (p2 5270007))
+(line (p1 5270007) (p2 5270008))
+(line (p1 5270008) (p2 5270009))
+(line (p1 5270009) (p2 5270011))
+(line (p1 5270011) (p2 5260010))
+(line (p1 5270011) (p2 5250011))
+(line (p1 5250011) (p2 5240011))
+(line (p1 5240011) (p2 5230011))
+(line (p1 5230011) (p2 5220010))
+(line (p1 5150003) (p2 5160003))
+(line (p1 5130005) (p2 5130006))
+(line (p1 5180005) (p2 5180006))
+(line (p1 5150008) (p2 5160008))
+(line (p1 5330003) (p2 5340003))
+(line (p1 5310005) (p2 5310006))
+(line (p1 5360005) (p2 5360006))
+(line (p1 5330008) (p2 5340008))
+(line (p1 5280000) (p2 5300000))
+(line (p1 5300000) (p2 5310000))
+(line (p1 5310000) (p2 5320000))
+(line (p1 5280000) (p2 5280002))
+(line (p1 5280002) (p2 5280003))
+(line (p1 5280003) (p2 5280004))
+(line (p1 5280004) (p2 5320004))
+(line (p1 5320004) (p2 5320000))
+(line (p1 5320000) (p2 5330001))
+(line (p1 5330001) (p2 5330002))
+(line (p1 5330002) (p2 5330003))
+(line (p1 5330003) (p2 5330005))
+(line (p1 5330005) (p2 5320004))
+(line (p1 5330005) (p2 5310005))
+(line (p1 5310005) (p2 5300005))
+(line (p1 5300005) (p2 5290005))
+(line (p1 5290005) (p2 5280004))
+(line (p1 5340000) (p2 5360000))
+(line (p1 5360000) (p2 5370000))
+(line (p1 5370000) (p2 5380000))
+(line (p1 5340000) (p2 5340002))
+(line (p1 5340002) (p2 5340003))
+(line (p1 5340003) (p2 5340004))
+(line (p1 5340004) (p2 5380004))
+(line (p1 5380004) (p2 5380000))
+(line (p1 5380000) (p2 5390001))
+(line (p1 5390001) (p2 5390002))
+(line (p1 5390002) (p2 5390003))
+(line (p1 5390003) (p2 5390005))
+(line (p1 5390005) (p2 5380004))
+(line (p1 5390005) (p2 5370005))
+(line (p1 5370005) (p2 5360005))
+(line (p1 5360005) (p2 5350005))
+(line (p1 5350005) (p2 5340004))
+(line (p1 5280006) (p2 5300006))
+(line (p1 5300006) (p2 5310006))
+(line (p1 5310006) (p2 5320006))
+(line (p1 5280006) (p2 5280008))
+(line (p1 5280008) (p2 5280009))
+(line (p1 5280009) (p2 5280010))
+(line (p1 5280010) (p2 5320010))
+(line (p1 5320010) (p2 5320006))
+(line (p1 5320006) (p2 5330007))
+(line (p1 5330007) (p2 5330008))
+(line (p1 5330008) (p2 5330009))
+(line (p1 5330009) (p2 5330011))
+(line (p1 5330011) (p2 5320010))
+(line (p1 5330011) (p2 5310011))
+(line (p1 5310011) (p2 5300011))
+(line (p1 5300011) (p2 5290011))
+(line (p1 5290011) (p2 5280010))
+(line (p1 5340006) (p2 5360006))
+(line (p1 5360006) (p2 5370006))
+(line (p1 5370006) (p2 5380006))
+(line (p1 5340006) (p2 5340008))
+(line (p1 5340008) (p2 5340009))
+(line (p1 5340009) (p2 5340010))
+(line (p1 5340010) (p2 5380010))
+(line (p1 5380010) (p2 5380006))
+(line (p1 5380006) (p2 5390007))
+(line (p1 5390007) (p2 5390008))
+(line (p1 5390008) (p2 5390009))
+(line (p1 5390009) (p2 5390011))
+(line (p1 5390011) (p2 5380010))
+(line (p1 5390011) (p2 5370011))
+(line (p1 5370011) (p2 5360011))
+(line (p1 5360011) (p2 5350011))
+(line (p1 5350011) (p2 5340010))
+(line (p1 5270003) (p2 5280003))
+(line (p1 5250005) (p2 5250006))
+(line (p1 5300005) (p2 5300006))
+(line (p1 5270008) (p2 5280008))
+(line (p1 5450003) (p2 5460003))
+(line (p1 5430005) (p2 5430006))
+(line (p1 5480005) (p2 5480006))
+(line (p1 5450008) (p2 5460008))
+(line (p1 5400000) (p2 5420000))
+(line (p1 5420000) (p2 5430000))
+(line (p1 5430000) (p2 5440000))
+(line (p1 5400000) (p2 5400002))
+(line (p1 5400002) (p2 5400003))
+(line (p1 5400003) (p2 5400004))
+(line (p1 5400004) (p2 5440004))
+(line (p1 5440004) (p2 5440000))
+(line (p1 5440000) (p2 5450001))
+(line (p1 5450001) (p2 5450002))
+(line (p1 5450002) (p2 5450003))
+(line (p1 5450003) (p2 5450005))
+(line (p1 5450005) (p2 5440004))
+(line (p1 5450005) (p2 5430005))
+(line (p1 5430005) (p2 5420005))
+(line (p1 5420005) (p2 5410005))
+(line (p1 5410005) (p2 5400004))
+(line (p1 5460000) (p2 5480000))
+(line (p1 5480000) (p2 5490000))
+(line (p1 5490000) (p2 5500000))
+(line (p1 5460000) (p2 5460002))
+(line (p1 5460002) (p2 5460003))
+(line (p1 5460003) (p2 5460004))
+(line (p1 5460004) (p2 5500004))
+(line (p1 5500004) (p2 5500000))
+(line (p1 5500000) (p2 5510001))
+(line (p1 5510001) (p2 5510002))
+(line (p1 5510002) (p2 5510003))
+(line (p1 5510003) (p2 5510005))
+(line (p1 5510005) (p2 5500004))
+(line (p1 5510005) (p2 5490005))
+(line (p1 5490005) (p2 5480005))
+(line (p1 5480005) (p2 5470005))
+(line (p1 5470005) (p2 5460004))
+(line (p1 5400006) (p2 5420006))
+(line (p1 5420006) (p2 5430006))
+(line (p1 5430006) (p2 5440006))
+(line (p1 5400006) (p2 5400008))
+(line (p1 5400008) (p2 5400009))
+(line (p1 5400009) (p2 5400010))
+(line (p1 5400010) (p2 5440010))
+(line (p1 5440010) (p2 5440006))
+(line (p1 5440006) (p2 5450007))
+(line (p1 5450007) (p2 5450008))
+(line (p1 5450008) (p2 5450009))
+(line (p1 5450009) (p2 5450011))
+(line (p1 5450011) (p2 5440010))
+(line (p1 5450011) (p2 5430011))
+(line (p1 5430011) (p2 5420011))
+(line (p1 5420011) (p2 5410011))
+(line (p1 5410011) (p2 5400010))
+(line (p1 5460006) (p2 5480006))
+(line (p1 5480006) (p2 5490006))
+(line (p1 5490006) (p2 5500006))
+(line (p1 5460006) (p2 5460008))
+(line (p1 5460008) (p2 5460009))
+(line (p1 5460009) (p2 5460010))
+(line (p1 5460010) (p2 5500010))
+(line (p1 5500010) (p2 5500006))
+(line (p1 5500006) (p2 5510007))
+(line (p1 5510007) (p2 5510008))
+(line (p1 5510008) (p2 5510009))
+(line (p1 5510009) (p2 5510011))
+(line (p1 5510011) (p2 5500010))
+(line (p1 5510011) (p2 5490011))
+(line (p1 5490011) (p2 5480011))
+(line (p1 5480011) (p2 5470011))
+(line (p1 5470011) (p2 5460010))
+(line (p1 5390003) (p2 5400003))
+(line (p1 5370005) (p2 5370006))
+(line (p1 5420005) (p2 5420006))
+(line (p1 5390008) (p2 5400008))
+(line (p1 5570003) (p2 5580003))
+(line (p1 5550005) (p2 5550006))
+(line (p1 5600005) (p2 5600006))
+(line (p1 5570008) (p2 5580008))
+(line (p1 5520000) (p2 5540000))
+(line (p1 5540000) (p2 5550000))
+(line (p1 5550000) (p2 5560000))
+(line (p1 5520000) (p2 5520002))
+(line (p1 5520002) (p2 5520003))
+(line (p1 5520003) (p2 5520004))
+(line (p1 5520004) (p2 5560004))
+(line (p1 5560004) (p2 5560000))
+(line (p1 5560000) (p2 5570001))
+(line (p1 5570001) (p2 5570002))
+(line (p1 5570002) (p2 5570003))
+(line (p1 5570003) (p2 5570005))
+(line (p1 5570005) (p2 5560004))
+(line (p1 5570005) (p2 5550005))
+(line (p1 5550005) (p2 5540005))
+(line (p1 5540005) (p2 5530005))
+(line (p1 5530005) (p2 5520004))
+(line (p1 5580000) (p2 5600000))
+(line (p1 5600000) (p2 5610000))
+(line (p1 5610000) (p2 5620000))
+(line (p1 5580000) (p2 5580002))
+(line (p1 5580002) (p2 5580003))
+(line (p1 5580003) (p2 5580004))
+(line (p1 5580004) (p2 5620004))
+(line (p1 5620004) (p2 5620000))
+(line (p1 5620000) (p2 5630001))
+(line (p1 5630001) (p2 5630002))
+(line (p1 5630002) (p2 5630003))
+(line (p1 5630003) (p2 5630005))
+(line (p1 5630005) (p2 5620004))
+(line (p1 5630005) (p2 5610005))
+(line (p1 5610005) (p2 5600005))
+(line (p1 5600005) (p2 5590005))
+(line (p1 5590005) (p2 5580004))
+(line (p1 5520006) (p2 5540006))
+(line (p1 5540006) (p2 5550006))
+(line (p1 5550006) (p2 5560006))
+(line (p1 5520006) (p2 5520008))
+(line (p1 5520008) (p2 5520009))
+(line (p1 5520009) (p2 5520010))
+(line (p1 5520010) (p2 5560010))
+(line (p1 5560010) (p2 5560006))
+(line (p1 5560006) (p2 5570007))
+(line (p1 5570007) (p2 5570008))
+(line (p1 5570008) (p2 5570009))
+(line (p1 5570009) (p2 5570011))
+(line (p1 5570011) (p2 5560010))
+(line (p1 5570011) (p2 5550011))
+(line (p1 5550011) (p2 5540011))
+(line (p1 5540011) (p2 5530011))
+(line (p1 5530011) (p2 5520010))
+(line (p1 5580006) (p2 5600006))
+(line (p1 5600006) (p2 5610006))
+(line (p1 5610006) (p2 5620006))
+(line (p1 5580006) (p2 5580008))
+(line (p1 5580008) (p2 5580009))
+(line (p1 5580009) (p2 5580010))
+(line (p1 5580010) (p2 5620010))
+(line (p1 5620010) (p2 5620006))
+(line (p1 5620006) (p2 5630007))
+(line (p1 5630007) (p2 5630008))
+(line (p1 5630008) (p2 5630009))
+(line (p1 5630009) (p2 5630011))
+(line (p1 5630011) (p2 5620010))
+(line (p1 5630011) (p2 5610011))
+(line (p1 5610011) (p2 5600011))
+(line (p1 5600011) (p2 5590011))
+(line (p1 5590011) (p2 5580010))
+(line (p1 5510003) (p2 5520003))
+(line (p1 5490005) (p2 5490006))
+(line (p1 5540005) (p2 5540006))
+(line (p1 5510008) (p2 5520008))
+(line (p1 5690003) (p2 5700003))
+(line (p1 5670005) (p2 5670006))
+(line (p1 5720005) (p2 5720006))
+(line (p1 5690008) (p2 5700008))
+(line (p1 5640000) (p2 5660000))
+(line (p1 5660000) (p2 5670000))
+(line (p1 5670000) (p2 5680000))
+(line (p1 5640000) (p2 5640002))
+(line (p1 5640002) (p2 5640003))
+(line (p1 5640003) (p2 5640004))
+(line (p1 5640004) (p2 5680004))
+(line (p1 5680004) (p2 5680000))
+(line (p1 5680000) (p2 5690001))
+(line (p1 5690001) (p2 5690002))
+(line (p1 5690002) (p2 5690003))
+(line (p1 5690003) (p2 5690005))
+(line (p1 5690005) (p2 5680004))
+(line (p1 5690005) (p2 5670005))
+(line (p1 5670005) (p2 5660005))
+(line (p1 5660005) (p2 5650005))
+(line (p1 5650005) (p2 5640004))
+(line (p1 5700000) (p2 5720000))
+(line (p1 5720000) (p2 5730000))
+(line (p1 5730000) (p2 5740000))
+(line (p1 5700000) (p2 5700002))
+(line (p1 5700002) (p2 5700003))
+(line (p1 5700003) (p2 5700004))
+(line (p1 5700004) (p2 5740004))
+(line (p1 5740004) (p2 5740000))
+(line (p1 5740000) (p2 5750001))
+(line (p1 5750001) (p2 5750002))
+(line (p1 5750002) (p2 5750003))
+(line (p1 5750003) (p2 5750005))
+(line (p1 5750005) (p2 5740004))
+(line (p1 5750005) (p2 5730005))
+(line (p1 5730005) (p2 5720005))
+(line (p1 5720005) (p2 5710005))
+(line (p1 5710005) (p2 5700004))
+(line (p1 5640006) (p2 5660006))
+(line (p1 5660006) (p2 5670006))
+(line (p1 5670006) (p2 5680006))
+(line (p1 5640006) (p2 5640008))
+(line (p1 5640008) (p2 5640009))
+(line (p1 5640009) (p2 5640010))
+(line (p1 5640010) (p2 5680010))
+(line (p1 5680010) (p2 5680006))
+(line (p1 5680006) (p2 5690007))
+(line (p1 5690007) (p2 5690008))
+(line (p1 5690008) (p2 5690009))
+(line (p1 5690009) (p2 5690011))
+(line (p1 5690011) (p2 5680010))
+(line (p1 5690011) (p2 5670011))
+(line (p1 5670011) (p2 5660011))
+(line (p1 5660011) (p2 5650011))
+(line (p1 5650011) (p2 5640010))
+(line (p1 5700006) (p2 5720006))
+(line (p1 5720006) (p2 5730006))
+(line (p1 5730006) (p2 5740006))
+(line (p1 5700006) (p2 5700008))
+(line (p1 5700008) (p2 5700009))
+(line (p1 5700009) (p2 5700010))
+(line (p1 5700010) (p2 5740010))
+(line (p1 5740010) (p2 5740006))
+(line (p1 5740006) (p2 5750007))
+(line (p1 5750007) (p2 5750008))
+(line (p1 5750008) (p2 5750009))
+(line (p1 5750009) (p2 5750011))
+(line (p1 5750011) (p2 5740010))
+(line (p1 5750011) (p2 5730011))
+(line (p1 5730011) (p2 5720011))
+(line (p1 5720011) (p2 5710011))
+(line (p1 5710011) (p2 5700010))
+(line (p1 5630003) (p2 5640003))
+(line (p1 5610005) (p2 5610006))
+(line (p1 5660005) (p2 5660006))
+(line (p1 5630008) (p2 5640008))
+(line (p1 5810003) (p2 5820003))
+(line (p1 5790005) (p2 5790006))
+(line (p1 5840005) (p2 5840006))
+(line (p1 5810008) (p2 5820008))
+(line (p1 5760000) (p2 5780000))
+(line (p1 5780000) (p2 5790000))
+(line (p1 5790000) (p2 5800000))
+(line (p1 5760000) (p2 5760002))
+(line (p1 5760002) (p2 5760003))
+(line (p1 5760003) (p2 5760004))
+(line (p1 5760004) (p2 5800004))
+(line (p1 5800004) (p2 5800000))
+(line (p1 5800000) (p2 5810001))
+(line (p1 5810001) (p2 5810002))
+(line (p1 5810002) (p2 5810003))
+(line (p1 5810003) (p2 5810005))
+(line (p1 5810005) (p2 5800004))
+(line (p1 5810005) (p2 5790005))
+(line (p1 5790005) (p2 5780005))
+(line (p1 5780005) (p2 5770005))
+(line (p1 5770005) (p2 5760004))
+(line (p1 5820000) (p2 5840000))
+(line (p1 5840000) (p2 5850000))
+(line (p1 5850000) (p2 5860000))
+(line (p1 5820000) (p2 5820002))
+(line (p1 5820002) (p2 5820003))
+(line (p1 5820003) (p2 5820004))
+(line (p1 5820004) (p2 5860004))
+(line (p1 5860004) (p2 5860000))
+(line (p1 5860000) (p2 5870001))
+(line (p1 5870001) (p2 5870002))
+(line (p1 5870002) (p2 5870003))
+(line (p1 5870003) (p2 5870005))
+(line (p1 5870005) (p2 5860004))
+(line (p1 5870005) (p2 5850005))
+(line (p1 5850005) (p2 5840005))
+(line (p1 5840005) (p2 5830005))
+(line (p1 5830005) (p2 5820004))
+(line (p1 5760006) (p2 5780006))
+(line (p1 5780006) (p2 5790006))
+(line (p1 5790006) (p2 5800006))
+(line (p1 5760006) (p2 5760008))
+(line (p1 5760008) (p2 5760009))
+(line (p1 5760009) (p2 5760010))
+(line (p1 5760010) (p2 5800010))
+(line (p1 5800010) (p2 5800006))
+(line (p1 5800006) (p2 5810007))
+(line (p1 5810007) (p2 5810008))
+(line (p1 5810008) (p2 5810009))
+(line (p1 5810009) (p2 5810011))
+(line (p1 5810011) (p2 5800010))
+(line (p1 5810011) (p2 5790011))
+(line (p1 5790011) (p2 5780011))
+(line (p1 5780011) (p2 5770011))
+(line (p1 5770011) (p2 5760010))
+(line (p1 5820006) (p2 5840006))
+(line (p1 5840006) (p2 5850006))
+(line (p1 5850006) (p2 5860006))
+(line (p1 5820006) (p2 5820008))
+(line (p1 5820008) (p2 5820009))
+(line (p1 5820009) (p2 5820010))
+(line (p1 5820010) (p2 5860010))
+(line (p1 5860010) (p2 5860006))
+(line (p1 5860006) (p2 5870007))
+(line (p1 5870007) (p2 5870008))
+(line (p1 5870008) (p2 5870009))
+(line (p1 5870009) (p2 5870011))
+(line (p1 5870011) (p2 5860010))
+(line (p1 5870011) (p2 5850011))
+(line (p1 5850011) (p2 5840011))
+(line (p1 5840011) (p2 5830011))
+(line (p1 5830011) (p2 5820010))
+(line (p1 5750003) (p2 5760003))
+(line (p1 5730005) (p2 5730006))
+(line (p1 5780005) (p2 5780006))
+(line (p1 5750008) (p2 5760008))
+(line (p1 5930003) (p2 5940003))
+(line (p1 5910005) (p2 5910006))
+(line (p1 5960005) (p2 5960006))
+(line (p1 5930008) (p2 5940008))
+(line (p1 5880000) (p2 5900000))
+(line (p1 5900000) (p2 5910000))
+(line (p1 5910000) (p2 5920000))
+(line (p1 5880000) (p2 5880002))
+(line (p1 5880002) (p2 5880003))
+(line (p1 5880003) (p2 5880004))
+(line (p1 5880004) (p2 5920004))
+(line (p1 5920004) (p2 5920000))
+(line (p1 5920000) (p2 5930001))
+(line (p1 5930001) (p2 5930002))
+(line (p1 5930002) (p2 5930003))
+(line (p1 5930003) (p2 5930005))
+(line (p1 5930005) (p2 5920004))
+(line (p1 5930005) (p2 5910005))
+(line (p1 5910005) (p2 5900005))
+(line (p1 5900005) (p2 5890005))
+(line (p1 5890005) (p2 5880004))
+(line (p1 5940000) (p2 5960000))
+(line (p1 5960000) (p2 5970000))
+(line (p1 5970000) (p2 5980000))
+(line (p1 5940000) (p2 5940002))
+(line (p1 5940002) (p2 5940003))
+(line (p1 5940003) (p2 5940004))
+(line (p1 5940004) (p2 5980004))
+(line (p1 5980004) (p2 5980000))
+(line (p1 5980000) (p2 5990001))
+(line (p1 5990001) (p2 5990002))
+(line (p1 5990002) (p2 5990003))
+(line (p1 5990003) (p2 5990005))
+(line (p1 5990005) (p2 5980004))
+(line (p1 5990005) (p2 5970005))
+(line (p1 5970005) (p2 5960005))
+(line (p1 5960005) (p2 5950005))
+(line (p1 5950005) (p2 5940004))
+(line (p1 5880006) (p2 5900006))
+(line (p1 5900006) (p2 5910006))
+(line (p1 5910006) (p2 5920006))
+(line (p1 5880006) (p2 5880008))
+(line (p1 5880008) (p2 5880009))
+(line (p1 5880009) (p2 5880010))
+(line (p1 5880010) (p2 5920010))
+(line (p1 5920010) (p2 5920006))
+(line (p1 5920006) (p2 5930007))
+(line (p1 5930007) (p2 5930008))
+(line (p1 5930008) (p2 5930009))
+(line (p1 5930009) (p2 5930011))
+(line (p1 5930011) (p2 5920010))
+(line (p1 5930011) (p2 5910011))
+(line (p1 5910011) (p2 5900011))
+(line (p1 5900011) (p2 5890011))
+(line (p1 5890011) (p2 5880010))
+(line (p1 5940006) (p2 5960006))
+(line (p1 5960006) (p2 5970006))
+(line (p1 5970006) (p2 5980006))
+(line (p1 5940006) (p2 5940008))
+(line (p1 5940008) (p2 5940009))
+(line (p1 5940009) (p2 5940010))
+(line (p1 5940010) (p2 5980010))
+(line (p1 5980010) (p2 5980006))
+(line (p1 5980006) (p2 5990007))
+(line (p1 5990007) (p2 5990008))
+(line (p1 5990008) (p2 5990009))
+(line (p1 5990009) (p2 5990011))
+(line (p1 5990011) (p2 5980010))
+(line (p1 5990011) (p2 5970011))
+(line (p1 5970011) (p2 5960011))
+(line (p1 5960011) (p2 5950011))
+(line (p1 5950011) (p2 5940010))
+(line (p1 5870003) (p2 5880003))
+(line (p1 5850005) (p2 5850006))
+(line (p1 5900005) (p2 5900006))
+(line (p1 5870008) (p2 5880008))
+(line (p1 6050003) (p2 6060003))
+(line (p1 6030005) (p2 6030006))
+(line (p1 6080005) (p2 6080006))
+(line (p1 6050008) (p2 6060008))
+(line (p1 6000000) (p2 6020000))
+(line (p1 6020000) (p2 6030000))
+(line (p1 6030000) (p2 6040000))
+(line (p1 6000000) (p2 6000002))
+(line (p1 6000002) (p2 6000003))
+(line (p1 6000003) (p2 6000004))
+(line (p1 6000004) (p2 6040004))
+(line (p1 6040004) (p2 6040000))
+(line (p1 6040000) (p2 6050001))
+(line (p1 6050001) (p2 6050002))
+(line (p1 6050002) (p2 6050003))
+(line (p1 6050003) (p2 6050005))
+(line (p1 6050005) (p2 6040004))
+(line (p1 6050005) (p2 6030005))
+(line (p1 6030005) (p2 6020005))
+(line (p1 6020005) (p2 6010005))
+(line (p1 6010005) (p2 6000004))
+(line (p1 6060000) (p2 6080000))
+(line (p1 6080000) (p2 6090000))
+(line (p1 6090000) (p2 6100000))
+(line (p1 6060000) (p2 6060002))
+(line (p1 6060002) (p2 6060003))
+(line (p1 6060003) (p2 6060004))
+(line (p1 6060004) (p2 6100004))
+(line (p1 6100004) (p2 6100000))
+(line (p1 6100000) (p2 6110001))
+(line (p1 6110001) (p2 6110002))
+(line (p1 6110002) (p2 6110003))
+(line (p1 6110003) (p2 6110005))
+(line (p1 6110005) (p2 6100004))
+(line (p1 6110005) (p2 6090005))
+(line (p1 6090005) (p2 6080005))
+(line (p1 6080005) (p2 6070005))
+(line (p1 6070005) (p2 6060004))
+(line (p1 6000006) (p2 6020006))
+(line (p1 6020006) (p2 6030006))
+(line (p1 6030006) (p2 6040006))
+(line (p1 6000006) (p2 6000008))
+(line (p1 6000008) (p2 6000009))
+(line (p1 6000009) (p2 6000010))
+(line (p1 6000010) (p2 6040010))
+(line (p1 6040010) (p2 6040006))
+(line (p1 6040006) (p2 6050007))
+(line (p1 6050007) (p2 6050008))
+(line (p1 6050008) (p2 6050009))
+(line (p1 6050009) (p2 6050011))
+(line (p1 6050011) (p2 6040010))
+(line (p1 6050011) (p2 6030011))
+(line (p1 6030011) (p2 6020011))
+(line (p1 6020011) (p2 6010011))
+(line (p1 6010011) (p2 6000010))
+(line (p1 6060006) (p2 6080006))
+(line (p1 6080006) (p2 6090006))
+(line (p1 6090006) (p2 6100006))
+(line (p1 6060006) (p2 6060008))
+(line (p1 6060008) (p2 6060009))
+(line (p1 6060009) (p2 6060010))
+(line (p1 6060010) (p2 6100010))
+(line (p1 6100010) (p2 6100006))
+(line (p1 6100006) (p2 6110007))
+(line (p1 6110007) (p2 6110008))
+(line (p1 6110008) (p2 6110009))
+(line (p1 6110009) (p2 6110011))
+(line (p1 6110011) (p2 6100010))
+(line (p1 6110011) (p2 6090011))
+(line (p1 6090011) (p2 6080011))
+(line (p1 6080011) (p2 6070011))
+(line (p1 6070011) (p2 6060010))
+(line (p1 5990003) (p2 6000003))
+(line (p1 5970005) (p2 5970006))
+(line (p1 6020005) (p2 6020006))
+(line (p1 5990008) (p2 6000008))
+(stage (value duplicate))

Added: labs/jbossrules/benchmarks/src/rules/benchmarks/manners/manners-javabean-withprints.clp
===================================================================
--- labs/jbossrules/benchmarks/src/rules/benchmarks/manners/manners-javabean-withprints.clp	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/rules/benchmarks/manners/manners-javabean-withprints.clp	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,102 @@
+;; Manners.clp
+;; Manners benchmark test
+;; Adapted from CLIPS manners.ops
+;; James C. Owen
+;; 1/23/2002
+
+(import benchmarks.manners.*)
+
+( defclass guest Guest )
+( defclass last_seat LastSeat )
+( defclass seating Seating )
+( defclass context Context )
+( defclass path Path )
+( defclass chosen Chosen )
+( defclass count Count )
+   
+(defrule assign_first_seat ""
+   (context (state 0) (OBJECT ?contextObj) )
+   (guest (name ?n))
+   (count ( value ?cnt) (OBJECT ?countObj) )
+   =>
+   (bind ?seating ( new Seating ?cnt 0 TRUE 1 ?n 1 ?n ) )
+   (definstance seating ?seating static )
+   (bind ?path ( new Path ?cnt 1 ?n ) )
+   (definstance path ?path static )
+   (set ?countObj "value" (+ ?cnt 1))
+   (update ?countObj)
+   (printout t "leftSeat :1: leftGuestName :" ?n ": rightSeat :1: rightGuestName :" ?n ": count :" (+ ?cnt 1) ": pid :0: pathDone TRUE" crlf)
+   (set ?contextObj "state" 1 ) 
+   (update ?contextObj)
+)
+
+
+(defrule find_seating ""
+   (context (state 1) (OBJECT ?contextObj) )
+   (seating (leftSeat ?s1) (leftGuestName ?n1) (rightGuestName ?n2) (rightSeat ?s2) (id ?seatID) (pid ?seatPID) (pathDone TRUE) )
+   (guest (name ?n2) (sex ?sex1) (hobby ?h1) )
+   (guest (name ?g2) (sex ~?sex1) (hobby ?h1) )
+   (count ( value ?cnt) (OBJECT ?countObj) )
+   (not (path (id ?seatID) (guestName ?g2) ) )
+   (not (chosen (id ?seatID) (guestName ?g2) (hobby ?h1) ) )
+   =>
+   (bind ?s2plus1 (+ ?s2 1) )
+   (definstance seating (new Seating ?cnt ?seatID FALSE ?s2 ?n2 ?s2plus1 ?g2) static)
+   (definstance path (new Path ?cnt ?s2plus1 ?g2) static)
+   (definstance chosen (new Chosen ?seatID ?g2 ?h1) static ) 
+   
+   (bind ?cntPlus1 (+ ?cnt 1) )
+   (set ?countObj "value" ?cntPlus1 )
+   (update ?countObj)
+   
+   (set ?contextObj "state" 2 ) 
+   (update ?contextObj)
+
+   (printout t "leftSeat :" ?s1 ": leftGuestName :" ?n2 ": rightSeat :" ?s2plus1 ": rightGuestName :" ?g2 ": count :" ?cnt ": pid :" ?seatID ": pathDone FALSE" crlf)
+)
+
+(defrule make_path ""
+   (context (state 2) )
+   (seating (leftSeat ?s1) (leftGuestName ?nam1) (rightSeat ?s2) (rightGuestName ?nam2) (id ?sID) (pid ?sPID) (pathDone FALSE) )
+   (path (id ?sPID) (guestName ?n1) (seat ?s) )
+   (not (path (id ?sID) (guestName ?n1) ) )
+   =>
+   (definstance path (new Path ?sID ?s ?n1) static)
+)
+
+(defrule pathDone ""
+   (context (state 2) (OBJECT ?contextObj) )
+   (seating (pathDone FALSE) (OBJECT ?seatingObj) )
+   =>
+   (set ?seatingObj "pathDone" TRUE ) 
+   (update ?seatingObj)
+
+   (set ?contextObj "state" 3 ) 
+   (update ?contextObj)
+)
+
+(defrule are_we_done ""
+   (context (state 3) (OBJECT ?contextObj) )
+   (last_seat (seat ?l_seat) )
+   (seating (rightSeat ?l_seat) )
+   =>
+   (printout t "rule are_we_done: Yes, we are done:  Print Results!!" crlf)
+
+   (set ?contextObj "state" 4 ) 
+   (update ?contextObj)
+)
+
+
+(defrule continue "continue processing"
+   (context (state 3) (OBJECT ?contextObj) )
+   =>
+   (set ?contextObj "state" 1 ) 
+   (update ?contextObj)
+)
+
+(defrule all_done ""
+   (context (state 4) (OBJECT ?contextObj) )
+   =>
+   (printout t crlf "rule all done: Condition context print_results" crlf )
+)
+  

Added: labs/jbossrules/benchmarks/src/rules/benchmarks/manners/manners-javabean.clp
===================================================================
--- labs/jbossrules/benchmarks/src/rules/benchmarks/manners/manners-javabean.clp	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/rules/benchmarks/manners/manners-javabean.clp	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,102 @@
+;; Manners.clp
+;; Manners benchmark test
+;; Adapted from CLIPS manners.ops
+;; James C. Owen
+;; 1/23/2002
+
+(import benchmarks.manners.*)
+
+( defclass guest Guest )
+( defclass last_seat LastSeat )
+( defclass seating Seating )
+( defclass context Context )
+( defclass path Path )
+( defclass chosen Chosen )
+( defclass count Count )
+   
+(defrule assign_first_seat ""
+   (context (state 0) (OBJECT ?contextObj) )
+   (guest (name ?n))
+   (count ( value ?cnt) (OBJECT ?countObj) )
+   =>
+   (bind ?seating ( new Seating ?cnt 0 TRUE 1 ?n 1 ?n ) )
+   (definstance seating ?seating static )
+   (bind ?path ( new Path ?cnt 1 ?n ) )
+   (definstance path ?path static )
+   (set ?countObj "value" (+ ?cnt 1))
+   (update ?countObj)
+   ;(printout t "leftSeat :1: leftGuestName :" ?n ": rightSeat :1: rightGuestName :" ?n ": count :" (+ ?cnt 1) ": pid :0: pathDone TRUE" crlf)
+   (set ?contextObj "state" 1 ) 
+   (update ?contextObj)
+)
+
+
+(defrule find_seating ""
+   (context (state 1) (OBJECT ?contextObj) )
+   (seating (leftSeat ?s1) (leftGuestName ?n1) (rightGuestName ?n2) (rightSeat ?s2) (id ?seatID) (pid ?seatPID) (pathDone TRUE) )
+   (guest (name ?n2) (sex ?sex1) (hobby ?h1) )
+   (guest (name ?g2) (sex ~?sex1) (hobby ?h1) )
+   (count ( value ?cnt) (OBJECT ?countObj) )
+   (not (path (id ?seatID) (guestName ?g2) ) )
+   (not (chosen (id ?seatID) (guestName ?g2) (hobby ?h1) ) )
+   =>
+   (bind ?s2plus1 (+ ?s2 1) )
+   (definstance seating (new Seating ?cnt ?seatID FALSE ?s2 ?n2 ?s2plus1 ?g2) static)
+   (definstance path (new Path ?cnt ?s2plus1 ?g2) static)
+   (definstance chosen (new Chosen ?seatID ?g2 ?h1) static ) 
+   
+   (bind ?cntPlus1 (+ ?cnt 1) )
+   (set ?countObj "value" ?cntPlus1 )
+   (update ?countObj)
+   
+   (set ?contextObj "state" 2 ) 
+   (update ?contextObj)
+
+   ;(printout t "leftSeat :" ?s1 ": leftGuestName :" ?n2 ": rightSeat :" ?s2plus1 ": rightGuestName :" ?g2 ": count :" ?cnt ": pid :" ?seatID ": pathDone FALSE" crlf)
+)
+
+(defrule make_path ""
+   (context (state 2) )
+   (seating (leftSeat ?s1) (leftGuestName ?nam1) (rightSeat ?s2) (rightGuestName ?nam2) (id ?sID) (pid ?sPID) (pathDone FALSE) )
+   (path (id ?sPID) (guestName ?n1) (seat ?s) )
+   (not (path (id ?sID) (guestName ?n1) ) )
+   =>
+   (definstance path (new Path ?sID ?s ?n1) static)
+)
+
+(defrule pathDone ""
+   (context (state 2) (OBJECT ?contextObj) )
+   (seating (pathDone FALSE) (OBJECT ?seatingObj) )
+   =>
+   (set ?seatingObj "pathDone" TRUE ) 
+   (update ?seatingObj)
+
+   (set ?contextObj "state" 3 ) 
+   (update ?contextObj)
+)
+
+(defrule are_we_done ""
+   (context (state 3) (OBJECT ?contextObj) )
+   (last_seat (seat ?l_seat) )
+   (seating (rightSeat ?l_seat) )
+   =>
+   ;(printout t "rule are_we_done: Yes, we are done:  Print Results!!" crlf)
+
+   (set ?contextObj "state" 4 ) 
+   (update ?contextObj)
+)
+
+
+(defrule continue "continue processing"
+   (context (state 3) (OBJECT ?contextObj) )
+   =>
+   (set ?contextObj "state" 1 ) 
+   (update ?contextObj)
+)
+
+(defrule all_done ""
+   (context (state 4) (OBJECT ?contextObj) )
+   =>
+   ;(printout t crlf "rule all done: Condition context print_results" crlf )
+)
+  

Added: labs/jbossrules/benchmarks/src/rules/benchmarks/manners/manners-withprints.drl
===================================================================
--- labs/jbossrules/benchmarks/src/rules/benchmarks/manners/manners-withprints.drl	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/rules/benchmarks/manners/manners-withprints.drl	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,112 @@
+package benchmarks.manners
+
+rule assignFirstSeat
+    when
+        context : Context( state == Context.START_UP )
+        guest : Guest()
+        count : Count()
+    then
+        String guestName = guest.getName();
+        
+        Seating seating =  new Seating( count.getValue(), 1, true, 1, guestName, 1, guestName);
+        assert( seating );
+        
+        Path path = new Path( count.getValue(), 1, guestName );
+        assert( path );
+        
+        count.setValue(  count.getValue() + 1 );        
+        modify( count );
+
+		System.out.println( "assign first seat :  " + seating + " : " + path );
+
+        context.setState( Context.ASSIGN_SEATS );        
+        modify( context );
+end
+
+rule findSeating
+   when 
+       context : Context( state == Context.ASSIGN_SEATS )
+       Seating( seatingId:id, seatingPid:pid, pathDone == true, seatingRightSeat:rightSeat, seatingRightGuestName:rightGuestName )
+       Guest( name == seatingRightGuestName, rightGuestSex:sex, rightGuestHobby:hobby )
+       Guest( leftGuestName:name , sex != rightGuestSex, hobby == rightGuestHobby )
+
+       count : Count()
+
+       not ( Path( id == seatingId, guestName == leftGuestName) )
+       not ( Chosen( id == seatingId, guestName == leftGuestName, hobby == rightGuestHobby) )
+   then
+       int rightSeat = seatingRightSeat;
+       int seatId = seatingId;
+       int countValue = count.getValue();
+       
+       Seating seating = new Seating( countValue, seatId, false, rightSeat, seatingRightGuestName, rightSeat + 1, leftGuestName );
+       assert( seating );     
+                            
+       Path path = new Path( countValue, rightSeat + 1, leftGuestName  );
+       assert( path );
+       
+       Chosen chosen = new Chosen( seatId, leftGuestName, rightGuestHobby );
+       assert( chosen  );
+
+	   System.err.println( "find seating : " + seating + " : " + path + " : " + chosen);
+
+       count.setValue(  countValue + 1 );
+       modify( count );
+
+       context.setState( Context.MAKE_PATH );
+       modify( context );
+end
+
+rule makePath
+    when 
+        Context( state == Context.MAKE_PATH )
+        Seating( seatingId:id, seatingPid:pid, pathDone == false )
+        Path( id == seatingPid, pathGuestName:guestName, pathSeat:seat )
+        not Path( id == seatingId, guestName == pathGuestName )
+    then
+        assert( new Path( seatingId, pathSeat, pathGuestName ) );
+end 
+
+rule pathDone
+    when
+        context : Context( state == Context.MAKE_PATH ) 
+        seating : Seating( pathDone == false ) 
+    then
+        seating.setPathDone( true ); 
+        modify( seating );
+        
+        context.setState( Context.CHECK_DONE ); 
+		modify( context );
+end
+
+
+rule areWeDone
+    when
+        context : Context( state == Context.CHECK_DONE ) 
+        LastSeat( lastSeat: seat )
+        Seating( rightSeat == lastSeat ) 
+    then
+        context.setState(Context.PRINT_RESULTS ); 
+        modify( context );
+end
+
+rule continue
+    when
+        context : Context( state == Context.CHECK_DONE ) 
+    then
+        context.setState( Context.ASSIGN_SEATS ); 
+        modify( context );
+end
+
+
+rule allDone
+    when
+        context : Context( state == Context.PRINT_RESULTS ) 
+    then
+    	System.out.println( "All Done" );
+end
+
+//query getResults
+//	context : Context( state == Context.PRINT_RESULTS ) 
+//end 
+ 
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/rules/benchmarks/manners/manners.clp
===================================================================
--- labs/jbossrules/benchmarks/src/rules/benchmarks/manners/manners.clp	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/rules/benchmarks/manners/manners.clp	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,109 @@
+(deftemplate guest
+   (slot name) 
+   (slot sex)
+   (slot hobby) )
+   
+(deftemplate last_seat
+   (slot seat) )
+   
+(deftemplate seating
+   (slot seat1)
+   (slot name1)
+   (slot name2)
+   (slot seat2)
+   (slot id)
+   (slot pid)
+   (slot path_done) )
+   
+(deftemplate context
+   (slot name) )
+   
+(deftemplate path
+   (slot id)
+   (slot name)
+   (slot seat) )
+   
+(deftemplate chosen
+   (slot id)
+   (slot name)
+   (slot hobby) )
+
+(deftemplate count
+   (slot c) )
+   
+(defrule assign_first_seat "assign the first seat"
+   ?context <- (context (name "startup") )
+   (guest (name ?n))
+   ?count <- (count (c ?cnt) )
+   =>
+   (assert (seating (seat1 1) (name1 ?n) (name2 ?n) (seat2 1) (id ?cnt) (pid 0) (path_done TRUE) ) )
+   (assert (path (id ?cnt) (name ?n) (seat 1) ) )
+   (printout t "first seat seat1=1 name=" ?n " name2=" ?n " seat2=1 id=" ?cnt " pid=0 path_done TRUE" crlf)
+   (bind ?cntPlus1 (+ ?cnt 1) )
+   (modify ?count (c ?cntPlus1) )
+   (modify ?context (name "assign_seats") )
+)
+(defrule find_seating "find seating for guest"
+   ?context <- (context (name "assign_seats") )
+   (seating (seat2 ?s2) (name2 ?n2) (id ?id) (path_done TRUE) )
+   (guest (name ?n2) (sex ?sex1) (hobby ?h1) )
+   (guest (name ?g2) (sex ~?sex1) (hobby ?h1) )
+   ?count <- (count (c ?cnt) )
+   (not (path (id ?id) (name ?g2) ) )
+   (not (chosen (id ?id) (name ?g2) (hobby ?h1) ) )
+=>
+   (bind ?s2plus1 (+ ?s2 1) )
+   (assert (seating (seat1 ?s2) (name1 ?n2) (name2 ?g2) (seat2 ?s2plus1) (id ?cnt) (pid ?id) (path_done FALSE) ) )
+   (assert (path (id ?cnt) (name ?g2) (seat ?s2plus1) ) )
+   (assert (chosen (id ?id) (name ?g2) (hobby ?h1) ) ) 
+   (bind ?cntPlus1 (+ ?cnt 1) )
+   (modify ?count (c ?cntPlus1) )
+   (modify ?context (name "make_path") )
+   (printout t "seat1=" ?s2 " : name1=" ?n2 " : seat2=" ?s2plus1 " : name2=" ?g2 " : id=" ?cnt " : pid=" ?id " : path_done=FALSE" crlf)
+)
+(defrule make_path
+   ?context <- (context (name "make_path") )
+   (seating (id ?id) (pid ?sPID) (path_done FALSE) )
+   (path (id ?sPID) (name ?n1) (seat ?s) )
+   (not (path (id ?id) (name ?n1) ) )
+=>
+   (assert (path (id ?id) (name ?n1) (seat ?s) ) )
+;   (printout t "make_path - id=" ?id " name=" ?n1 " seat=" ?s crlf)
+)
+(defrule path_done "path is done"
+   ?context <- (context (name "make_path") )
+   ?seating <- (seating (path_done FALSE) )
+=>
+   (modify ?seating (path_done TRUE) )
+   (modify ?context (name "check_done") )
+;   (printout t "path is done " crlf)
+)
+(defrule continue "continue matching"
+   ?context <- (context (name "check_done") )
+=>
+   (modify ?context (name "assign_seats") )
+;   (printout t "assign seats again" crlf) 
+)
+(defrule are_we_done "are we done?"
+   ?context <- (context (name "check_done") )
+   (last_seat (seat ?lseat) )
+   (seating (seat2 ?lseat) )
+=>
+   (printout t "Yes, we are done:  Print Results!!" crlf)
+   (modify ?context (name "all_done") )
+)
+(defrule all_done "all done with test"
+  ?context <- (context (name "all_done") )
+=>
+  (modify ?context (name "print_results") )
+  (printout t crlf "rule all done: Condition context print_results" crlf )
+)
+(defrule print_results "print the results"
+  (context (name "print_results") )
+  ?seating <- (seating (id ?id) (seat2 ?s2) )
+  (last_seat (seat ?s2) )
+  (path (id ?id) (name ?n1) (seat ?s1) )
+=>
+  (printout t "name=" ?n1 " seat=" ?s1 crlf)
+  (retract ?seating)
+)

Added: labs/jbossrules/benchmarks/src/rules/benchmarks/manners/manners.drl
===================================================================
--- labs/jbossrules/benchmarks/src/rules/benchmarks/manners/manners.drl	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/rules/benchmarks/manners/manners.drl	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,104 @@
+package benchmarks.manners
+
+rule assignFirstSeat
+    when
+        context : Context( state == Context.START_UP )
+        guest : Guest()
+        count : Count()
+    then
+        String guestName = guest.getName();
+        
+        Seating seating =  new Seating( count.getValue(), 1, true, 1, guestName, 1, guestName);
+        assert( seating );
+        
+        Path path = new Path( count.getValue(), 1, guestName );
+        assert( path );
+        
+        count.setValue(  count.getValue() + 1 );        
+        modify( count );
+
+        context.setState( Context.ASSIGN_SEATS );        
+        modify( context );
+end
+
+rule findSeating
+   when 
+       context : Context( state == Context.ASSIGN_SEATS )
+       Seating( seatingId:id, seatingPid:pid, pathDone == true, seatingRightSeat:rightSeat, seatingRightGuestName:rightGuestName )
+       Guest( name == seatingRightGuestName, rightGuestSex:sex, rightGuestHobby:hobby )
+       Guest( leftGuestName:name , sex != rightGuestSex, hobby == rightGuestHobby )
+
+       count : Count()
+
+       not ( Path( id == seatingId, guestName == leftGuestName) )
+       not ( Chosen( id == seatingId, guestName == leftGuestName, hobby == rightGuestHobby) )
+   then
+       int rightSeat = seatingRightSeat;
+       int seatId = seatingId;
+       int countValue = count.getValue();
+       
+       Seating seating = new Seating( countValue, seatId, false, rightSeat, seatingRightGuestName, rightSeat + 1, leftGuestName );
+       assert( seating );     
+                            
+       Path path = new Path( countValue, rightSeat + 1, leftGuestName  );
+       assert( path );
+       
+       Chosen chosen = new Chosen( seatId, leftGuestName, rightGuestHobby );
+       assert( chosen  );
+
+       count.setValue(  countValue + 1 );
+       modify( count );
+
+       context.setState( Context.MAKE_PATH );
+       modify( context );
+end
+
+rule makePath
+    when 
+        Context( state == Context.MAKE_PATH )
+        Seating( seatingId:id, seatingPid:pid, pathDone == false )
+        Path( id == seatingPid, pathGuestName:guestName, pathSeat:seat )
+        not Path( id == seatingId, guestName == pathGuestName )
+    then
+        assert( new Path( seatingId, pathSeat, pathGuestName ) );
+end 
+
+rule pathDone
+    when
+        context : Context( state == Context.MAKE_PATH ) 
+        seating : Seating( pathDone == false ) 
+    then
+        seating.setPathDone( true ); 
+        modify( seating );
+        
+        context.setState( Context.CHECK_DONE ); 
+		modify( context );
+end
+
+
+rule areWeDone
+    when
+        context : Context( state == Context.CHECK_DONE ) 
+        LastSeat( lastSeat: seat )
+        Seating( rightSeat == lastSeat ) 
+    then
+        context.setState(Context.PRINT_RESULTS ); 
+        modify( context );
+end
+
+rule continue
+    when
+        context : Context( state == Context.CHECK_DONE ) 
+    then
+        context.setState( Context.ASSIGN_SEATS ); 
+        modify( context );
+end
+
+
+rule allDone
+    when
+        context : Context( state == Context.PRINT_RESULTS ) 
+    then
+    	System.out.println( "All Done" );
+end
+ 
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/rules/benchmarks/waltz/waltz-withprints.clp
===================================================================
--- labs/jbossrules/benchmarks/src/rules/benchmarks/waltz/waltz-withprints.clp	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/rules/benchmarks/waltz/waltz-withprints.clp	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,507 @@
+; Copyright -c- 1996 KnowledgeBased Systems Corporation (KBSC)
+; Original code in CLIPS by Satoshi Nishiyama and the University of Texas at Austin 
+; modified for use with Jess by James Owen
+; Note that this is a benchmark program ONLY and is not warranted to do anything
+; KBSC assumes no responsiblity for anyone using or mis-using this program
+
+; Waltz 50 does nothing more than create a 3-D image from 2-D line points
+; by creating junctions, edges from lines 
+; Waltz 50, unlike the regular Waltz, does this 50 times
+
+; If you find a mistake, please email jco at kbsc.com with details.  Thanks...
+; 
+ 
+(load-package benchmarks.waltz.WaltzFile)
+
+; Notes:  
+; Lines have the lable "line" followed by the 2 points defining the line.  
+; Edges are like lines accept that they can be labeled permanently labelled and plotted.
+; Junctions are defined by 4 points.  
+; The basepoint is where the 3 (2) lines intersect.
+; The points p1, p2, p3 are the other endpoints of the lines at this junction
+
+; ==================
+(deftemplate stage 
+	(slot value))
+; =================
+(deftemplate line 
+	(slot p1) 
+	(slot p2))
+	; ================
+(deftemplate edge 
+	(slot p1) 
+	(slot p2 )
+	(slot joined )
+	(slot label )
+	(slot plotted))
+; =====================
+(deftemplate junction 
+	(slot p1 )
+	(slot p2 )
+	(slot p3 )
+	(slot base_point )
+	(slot type))
+	
+
+; ------------------------------------ 
+; The first rule does nothing more than 
+; check to see if the start flag is in WM
+(defrule begin
+	(initial-fact)
+	=>)
+
+; --------------------------------------------------- 
+; If the duplicate flag is set, and there is still a line in WM, delete the line
+; and add two edges. One edge runs from p1 to p2 and the other runs from p2 to
+; p1.  We then plot the edge.
+(defrule reverse_edges
+	(stage (value duplicate))
+	?f2 <- (line (p1 ?p1) (p2 ?p2))
+	=>
+	(printout t "Draw " ?p1 "-" ?p2 crlf)
+	(assert (edge (p1 ?p1) (p2 ?p2) (joined false)))
+    (assert (edge (p1 ?p2) (p2 ?p1) (joined false)))
+	(retract ?f2))
+
+; -------------------------------------------- 
+; If the duplicate flag is set, and there are no more lines, then remove the
+; duplicating flag and set the make junctions flag.
+(defrule done_reversing
+	(declare (salience -10))
+	?f1 <- (stage (value duplicate))
+        (not (line))
+	=>
+	(modify ?f1 (value detect_junctions))
+	(printout t "reversing done" crlf)
+ )
+ ; ----------------------------------------
+; If three edges meet at a point and none of them have already been joined in
+; a junction, then make the corresponding type of junction and label the
+; edges joined.  This production calls make-3_junction to determine
+; what type of junction it is based on the angles inscribed by the
+; intersecting edges
+(defrule make-3_junction
+	(declare (salience 10))
+	(stage (value detect_junctions))
+	?f2 <- (edge (p1 ?base_point) (p2 ?p1) (joined false))
+	?f3 <- (edge (p1 ?base_point) (p2 ?p2&~?p1) (joined false))
+	?f4 <- (edge (p1 ?base_point) (p2 ?p3&~?p1&~?p2) (joined false))
+	=>
+	(make_3_junction ?base_point ?p1 ?p2 ?p3)
+	(modify ?f2 (joined true))
+	(modify ?f3 (joined true))
+	(modify ?f4 (joined true))
+	;(printout t "make 3 junction" crlf)
+ )
+ 
+ 
+; ---------------------------------
+;If two, and only two, edges meet that have not already been joined, then
+;the junction is an "L"
+(defrule make_L
+	(stage (value detect_junctions))
+	?f2 <- (edge (p1 ?base_point) (p2 ?p2) (joined false))
+	?f3 <- (edge (p1 ?base_point) (p2 ?p3&~?p2) (joined false))
+	(not (edge (p1 ?base_point) (p2 ~?p2&~?p3)))
+	=>
+	(assert (junction
+		(type L)
+		(base_point ?base_point)
+		(p1 ?p2)
+		(p2 ?p3)))
+	(modify ?f2 (joined true))
+	(modify ?f3 (joined true))
+	;(printout t "make L" crlf) 
+)	
+; ---------------------------------
+;If the detect junctions flag is set, and there are no more un_joined edges,
+;set the find_initial_boundary flag
+(defrule done_detecting
+	(declare (salience -10))
+	?f1 <- (stage (value detect_junctions))
+	=>
+	(modify ?f1 (value find_initial_boundary))
+	(printout t "detecting done" crlf) 	
+ )
+; -----------------------------------
+;If the initial boundary junction is an L, then we know it's labelling
+(defrule initial_boundary_junction_L
+	?f1 <- (stage (value find_initial_boundary))
+    (junction (type L) (base_point ?base_point) (p1 ?p1) (p2 ?p2))
+	?f3 <- (edge (p1 ?base_point) (p2 ?p1))
+	?f4 <- (edge (p1 ?base_point) (p2 ?p2))
+    (not (junction (base_point ?bp&:(>  ?bp ?base_point))))
+	=>
+    (modify ?f3 (label B))
+	(modify ?f4 (label B))
+	(modify ?f1 (value find_second_boundary))
+	(printout t "initial boundary junction L" crlf) 	
+)
+	
+ 
+; --------------------------------------
+;Ditto for an arrow
+(defrule initial_boundary_junction_arrow
+	?f1 <- (stage (value find_initial_boundary))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	?f3 <- (edge (p1 ?bp) (p2 ?p1))
+	?f4 <- (edge (p1 ?bp) (p2 ?p2))
+	?f5 <- (edge (p1 ?bp) (p2 ?p3))
+	(not (junction (base_point ?b &:(> ?b ?bp))))
+	=>
+	(modify ?f3 (label B))
+	(modify ?f4 (label +))
+	(modify ?f5 (label B))
+	(modify ?f1 (value find_second_boundary))
+	(printout t "initial boundary junction arrow" crlf) 	
+ )
+; --------------------------------------
+;If we have already found the first boundary point, then find the second
+;boundary point, and label it.
+ 
+(defrule second_boundary_junction_L
+	?f1 <- (stage (value find_second_boundary))
+    (junction (type L) (base_point ?base_point) (p1 ?p1) (p2 ?p2))
+	?f3 <- (edge (p1 ?base_point) (p2 ?p1))
+	?f4 <- (edge (p1 ?base_point) (p2 ?p2))
+    (not (junction (base_point ?bp&:(< ?bp ?base_point))))
+	=>
+    (modify ?f3 (label B))
+	(modify ?f4 (label B))
+	(modify ?f1 (value labeling))
+	(printout t "second boundary junction L" crlf) 		
+ )
+; --------------------------------------
+(defrule second_boundary_junction_arrow
+	?f1 <- (stage (value find_second_boundary))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	?f3 <- (edge (p1 ?bp) (p2 ?p1))
+	?f4 <- (edge (p1 ?bp) (p2 ?p2))
+	?f5 <- (edge (p1 ?bp) (p2 ?p3))
+	(not (junction (base_point ?b&:(< ?b ?bp))))
+	=>
+	(modify ?f3 (label B))
+	(modify ?f4 (label +))
+	(modify ?f5 (label B))
+	(modify ?f1 (value labeling))
+	(printout t "second boundary junction arrow" crlf) 			
+ )
+ 
+; --------------------------------------
+;If we have an edge whose label we already know definitely, then
+;label the corresponding edge in the other direction
+(defrule match_edge
+	(stage (value labeling))
+	?f2 <- (edge (p1 ?p1) (p2 ?p2) (label ?label& + | - | B ))
+	?f3 <- (edge (p1 ?p2) (p2 ?p1) (label nil))
+	=>
+	(modify ?f2 (plotted t))
+	(modify ?f3 (label ?label) (plotted t))
+	(printout t "match edge  - Plot: " ?label " " ?p1 " " ?p2 crlf)
+) 
+;The following productions propogate the possible labellings of the edges
+;based on the labellings of edges incident on adjacent junctions.  Since
+;from the initial boundary productions, we have determined the labellings of
+;of atleast two junctions, this propogation will label all of the junctions
+;with the possible labellings.  The search space is pruned due to filtering,
+;i.e.(not only label a junction in the ways physically possible based on the
+;labellings of adjacent junctions.
+ 
+ 
+; --------------------------------------
+(defrule label_L
+	(stage (value labeling))
+	(junction (type L) (base_point ?p1))
+	(edge (p1 ?p1) (p2 ?p2) (label + | - ))
+	?f4 <- (edge (p1 ?p1) (p2 ~?p2) (label nil))
+	=>
+	(modify ?f4 (label B))
+	(printout t "Label L" crlf) 		
+)	
+ 
+ 
+; --------------------------------------
+(defrule label_tee_A
+	(declare (salience 5))
+	(stage (value labeling))
+	(junction (type tee) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	?f3 <- (edge (p1 ?bp) (p2 ?p1) (label nil))
+	?f4 <- (edge (p1 ?bp) (p2 ?p3))
+	=>
+	(modify ?f3 (label B))
+	(modify ?f4 (label B))
+	(printout t "Label tee A" crlf) 		
+)		
+ 
+ 
+; --------------------------------------
+(defrule label_tee_B
+	(stage (value labeling))
+	(junction (type tee) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	?f3 <- (edge (p1 ?bp) (p2 ?p1))
+	?f4 <- (edge (p1 ?bp) (p2 ?p3) (label nil))
+	=>
+	(modify ?f3 (label B))
+	(modify ?f4 (label B))
+	(printout t "Label tee B" crlf) 			
+ )
+ 
+; --------------------------------------
+(defrule label_fork-1
+	(stage (value labeling))
+	(junction (type fork) (base_point ?bp))
+	(edge (p1 ?bp) (p2 ?p1) (label +))
+	?f4 <- (edge (p1 ?bp) (p2 ?p2&~?p1) (label nil))
+	?f5 <- (edge (p1 ?bp) (p2 ~?p2 &~?p1))
+	=>
+	(modify ?f4 (label +))
+	(modify ?f5 (label +))
+	(printout t "Label fork 1" crlf) 		
+)		
+ 
+ 
+; --------------------------------------
+(defrule label_fork-2
+	(stage (value labeling))
+	(junction (type fork) (base_point ?bp))
+	(edge (p1 ?bp) (p2 ?p1) (label B))
+	(edge (p1 ?bp) (p2 ?p2&~?p1) (label - ))
+	?f5 <- (edge (p1 ?bp) (p2 ~?p2&~?p1) (label nil))
+	=>
+	(modify ?f5 (label B))
+	(printout t "Label fork 2" crlf) 			
+ )
+ 
+; --------------------------------------
+(defrule label_fork-3
+	(stage (value labeling))
+	(junction (type fork) (base_point ?bp))
+	(edge (p1 ?bp) (p2 ?p1) (label B))
+	(edge (p1 ?bp) (p2 ?p2&~?p1) (label B))
+	?f5 <- (edge (p1 ?bp) (p2 ~?p2&~?p1) (label nil))
+	=>
+	(modify ?f5 (label -))
+	(printout t "Label fork 3" crlf)
+)	
+ 
+ 
+; --------------------------------------
+(defrule label_fork-4
+	(stage (value labeling))
+	(junction (type fork) (base_point ?bp))
+	(edge (p1 ?bp) (p2 ?p1) (label -))
+	(edge (p1 ?bp) (p2 ?p2&~?p1) (label -))
+	?f5 <- (edge (p1 ?bp) (p2 ~?p2&~?p1) (label nil))
+	=>
+	(modify ?f5 (label -))
+	(printout t "Label fork 4" crlf)	
+)	
+ 
+ 
+ 
+; --------------------------------------
+(defrule label_arrow-1A
+	(declare (salience 5))
+	(stage (value labeling))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	(edge (p1 ?bp) (p2 ?p1) (label ?label & B | - ))
+	?f4 <- (edge (p1 ?bp) (p2 ?p2) (label nil))
+	?f5 <- (edge (p1 ?bp) (p2 ?p3))
+	=>
+	(modify ?f4 (label +))
+	(modify ?f5 (label ?label))
+	(printout t "Label arrow 1A" crlf)	
+)	 
+; --------------------------------------
+(defrule label_arrow-1B
+	(stage (value labeling))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	(edge (p1 ?bp) (p2 ?p1) (label ?label & B | - ))
+	?f4 <- (edge (p1 ?bp) (p2 ?p2))
+	?f5 <- (edge (p1 ?bp) (p2 ?p3) (label nil))
+	=>
+	(modify ?f4 (label +))
+	(modify ?f5 (label ?label))	
+	(printout t "Label arrow 1B" crlf)	
+)	 
+ 
+; --------------------------------------
+(defrule label_arrow-2A
+	(declare (salience 5))
+	(stage (value labeling))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	(edge (p1 ?bp) (p2 ?p3) (label ?label & B | - ))
+	?f4 <- (edge (p1 ?bp) (p2 ?p2) (label nil))
+	?f5 <- (edge (p1 ?bp) (p2 ?p1))
+	=>
+	(modify ?f4 (label +))
+	(modify ?f5 (label ?label))
+	(printout t "Label arrow 2A" crlf)	
+)		
+ 
+; --------------------------------------
+(defrule label_arrow-2B
+	(stage (value labeling))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	(edge (p1 ?bp) (p2 ?p3) (label ?label & B | - ))
+	?f4 <- (edge (p1 ?bp) (p2 ?p2))
+	?f5 <- (edge (p1 ?bp) (p2 ?p1) (label nil))
+	=>
+	(modify ?f4 (label +))
+	(modify ?f5 (label ?label))
+	(printout t "Label arrow 2B" crlf)		
+ )
+ 
+; --------------------------------------
+(defrule label_arrow-3A
+	(declare (salience 5))
+	(stage (value labeling))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	(edge (p1 ?bp) (p2 ?p1) (label +))
+	?f4 <- (edge (p1 ?bp) (p2 ?p2) (label nil))
+	?f5 <- (edge (p1 ?bp) (p2 ?p3))
+	=>
+	(modify ?f4 (label -))
+	(modify ?f5 (label +))
+	(printout t "Label arrow 3A" crlf)	
+)		
+ 
+; --------------------------------------
+(defrule label_arrow-3B
+	(stage (value labeling))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	(edge (p1 ?bp) (p2 ?p1) (label +))
+	?f4 <- (edge (p1 ?bp) (p2 ?p2))
+	?f5 <- (edge (p1 ?bp) (p2 ?p3) (label nil))
+	=>
+	(modify ?f4 (label -))
+	(modify ?f5 (label +))
+	(printout t "Label arrow 3B" crlf)	
+)		
+ 
+ 
+; --------------------------------------
+(defrule label_arrow-4A
+	(declare (salience 5))
+	(stage (value labeling))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	(edge (p1 ?bp) (p2 ?p3) (label +))
+	?f4 <- (edge (p1 ?bp) (p2 ?p2) (label nil))
+	?f5 <- (edge (p1 ?bp) (p2 ?p1))
+	=>
+	(modify ?f4 (label -))
+	(modify ?f5 (label +))
+	(printout t "Label arrow 4A" crlf)	
+)		
+ 
+; --------------------------------------
+(defrule label_arrow-4B
+	(stage (value labeling))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	(edge (p1 ?bp) (p2 ?p3) (label +))
+	?f4 <- (edge (p1 ?bp) (p2 ?p2))
+	?f5 <- (edge (p1 ?bp) (p2 ?p1) (label nil))
+	=>
+	(modify ?f4 (label -))
+	(modify ?f5 (label +))
+	(printout t "Label arrow 4B" crlf)
+)		
+ 
+ 
+; --------------------------------------
+(defrule label_arrow-5A
+	(declare (salience 5))
+	(stage (value labeling))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	(edge (p1 ?bp) (p2 ?p2) (label -))
+	?f4 <- (edge (p1 ?bp) (p2 ?p1))
+	?f5 <- (edge (p1 ?bp) (p2 ?p3) (label nil))
+	=>
+	(modify ?f4 (label +))
+	(modify ?f5 (label +))
+	(printout t "Label arrow 5A" crlf)
+)		
+ 
+ 
+; --------------------------------------
+(defrule label_arrow-5B
+	(stage (value labeling))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	(edge (p1 ?bp) (p2 ?p2) (label -))
+	?f4 <- (edge (p1 ?bp) (p2 ?p1) (label nil))
+	?f5 <- (edge (p1 ?bp) (p2 ?p3))
+	=>
+	(modify ?f4 (label +))
+	(modify ?f5 (label +))
+	(printout t "Label arrow 5B" crlf)	
+)	
+ 
+ 
+; --------------------------------------
+; Originally, someone with CLIPS or UT made the following comment
+; I don't think that we (KBSC) quite agree with this since Jess uses
+; an MEA conflict resolution strategy by default.  However, in the interest
+; of historical continuity we have left the original comment with the rule.
+; 2 Sept 2006 jco
+; --------------------------------------
+;The conflict resolution mechanism will onle execute a production if no
+;productions that are more complicated are satisfied.  This production is
+;simple, so all of the above dictionary productions will fire before this
+;change of state production
+(defrule done_labeling
+	(declare (salience -10))
+	?f1 <- (stage (value labeling))
+	=>
+	(modify ?f1 (value plot_remaining_edges))
+	(printout t "done labelling"  crlf)		
+)
+ 
+; --------------------------------------
+;At this point, some labellings may have not been plotted, so plot them
+(defrule plot_remaining
+	(stage (value plot_remaining_edges))
+	?f2 <- (edge (plotted nil) (label ?label&~nil) (p1 ?p1) (p2 ?p2))
+	=>
+	(printout t "Plot " ?label " " ?p1 " " ?p2 crlf)
+	(modify ?f2 (plotted t)))
+ 
+; --------------------------------------
+; Again - the original author, probably Danny, left this comment in the rule.
+; While it is a total kludge, it seems to have worked quite well for the past
+; 20 years or so.  :-)
+
+; --------------------------------------
+;If we have been un able to label an edge, assume that it is a boundary.
+;This is a total Kludge, but what the hell. (if we assume only valid drawings
+;will be given for labeling, this assumption generally is true!)
+(defrule plot_boundaries
+	(stage (value plot_remaining_edges))
+	?f2 <- (edge (plotted nil) (label nil) (p1 ?p1) (p2 ?p2))
+	=>
+	(printout t "Plot " B " " ?p1 " " ?p2 crlf)
+	(modify ?f2 (plotted t)))
+ 
+; --------------------------------------
+;If there is no more work to do, then we are done and flag it.
+(defrule done_plotting
+	(declare (salience -10))
+	?f1 <- (stage (value plot_remaining_edges))
+	=>
+	(modify ?f1 (value done))
+	(printout t "done plotting" crlf)			
+)	
+ 
+; --------------------------------------
+; Again, this is historical comment and does NOT describe what this rules does
+; which is, well, nothing of value.  We'll probably change it before the year
+; is up.  :-)  
+; 2 Sept 2006 jco
+; --------------------------------------
+;Prompt the user as to where he can see a trace of the OPS5
+;execution
+(defrule done
+	(stage (value done))
+	=>
+	)
+ 
+ 
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/rules/benchmarks/waltz/waltz-withprints.drl
===================================================================
--- labs/jbossrules/benchmarks/src/rules/benchmarks/waltz/waltz-withprints.drl	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/rules/benchmarks/waltz/waltz-withprints.drl	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,479 @@
+#created on: 25/03/2006
+package benchmarks.waltz
+
+import benchmarks.waltz.Stage
+import benchmarks.waltz.Line
+import benchmarks.waltz.Edge
+import benchmarks.waltz.Junction
+import benchmarks.waltz.WaltzUtil
+
+#If the duplicate flag is set, and there is still a line in WM, delete the line
+#and add two edges. One edge runs from p1 to p2 and the other runs from p2 to
+#p1.  We then plot the edge.
+rule "reverse edges"
+	when
+		Stage(value == Stage.DUPLICATE)
+		$line : Line ( $p1:p1, $p2:p2 )
+	then 
+		System.out.println("Draw "+$p1+" "+$p2);
+		assert( new Edge ( $p1, $p2, false, Edge.NIL, false ) );
+		assert( new Edge ( $p2, $p1, false, Edge.NIL, false ) );
+		retract( $line ); 
+end
+
+#If the duplicating flag is set, and there are no more lines, then remove the
+#duplicating flag and set the make junctions flag.
+rule "reversing done" salience -10
+	when
+        $stage: Stage ( value == Stage.DUPLICATE )
+        not ( Line() )
+	then
+        $stage.setValue ( Stage.DETECT_JUNCTIONS );
+        modify($stage);
+    	System.out.println("reversing done");
+end
+
+#If three edges meet at a point and none of them have already been joined in
+#a junction, then make the corresponding type of junction and label the
+#edges joined.  This production calls make-3_junction to determine
+#what type of junction it is based on the angles inscribed by the
+#intersecting edges
+rule "make 3 junction" salience 10
+	when
+        Stage ( value == Stage.DETECT_JUNCTIONS )
+        $edge1: Edge( $basePoint:p1, $edge1P2:p2, joined==false )
+        $edge2: Edge( p1==$basePoint, $edge2P2:p2 != $edge1P2, joined == false )
+        $edge3: Edge( p1==$basePoint, $edge3P2:p2 != $edge1P2, p2 != $edge2P2, joined == false )
+	then
+	    Junction junction = WaltzUtil.make_3_junction( $basePoint, $edge1P2, $edge2P2, $edge3P2 );
+        System.out.println( junction );
+	    assert( junction );
+	    $edge1.setJoined(true);
+	    $edge2.setJoined(true);
+	    $edge3.setJoined(true);
+	    modify( $edge1 );
+	    modify( $edge2 );
+	    modify( $edge3 );
+end
+
+#If two, and only two, edges meet that have not already been joined, then
+#the junction is an "L"
+rule "make L"
+	when
+        Stage ( value == Stage.DETECT_JUNCTIONS )
+        $edge1: Edge( $basePoint:p1, $edge1P2:p2, joined==false )
+        $edge2: Edge( p1==$basePoint, $edge2P2:p2 != $edge1P2, joined == false )
+        not Edge( p1==$basePoint, p2 != $edge1P2, p2 != $edge2P2 )
+	then
+	    assert( new Junction($edge1P2, $edge2P2, 0, $basePoint, Junction.L) );
+	    $edge1.setJoined(true);
+	    $edge2.setJoined(true);
+	    modify( $edge1 );
+	    modify( $edge2 );
+	    System.out.println("make L");
+end
+
+#If the detect junctions flag is set, and there are no more un_joined edges,
+#set the find_initial_boundary flag
+rule "detecting done" salience -10
+    when
+        $stage : Stage ( value == Stage.DETECT_JUNCTIONS )
+ 	then
+ 	    $stage.setValue( Stage.FIND_INITIAL_BOUNDARY );
+ 	    modify( $stage );
+    	System.out.println("detecting done");
+end
+
+#If the initial boundary junction is an L, then we know it's labelling
+rule "initial boundary junction L"
+	when
+	    $stage : Stage ( value == Stage.FIND_INITIAL_BOUNDARY )
+	             Junction( type == Junction.L, $basePoint:basePoint, $p1:p1, $p2:p2 )
+	    $edge1 : Edge ( p1 == $basePoint, p2 == $p1 )
+	    $edge2 : Edge ( p1 == $basePoint, p2 == $p2 )
+        not Junction( basePoint > $basePoint )
+	then
+	    $edge1.setLabel( Edge.B );
+	    $edge2.setLabel( Edge.B );
+	    $stage.setValue( Stage.FIND_SECOND_BOUNDARY );
+	    modify( $edge1 );
+	    modify( $edge2 );
+	    modify( $stage );
+    	System.out.println("initial boundary junction L");
+end
+
+# Ditto for an arrow
+rule "initial boundary junction arrow"
+	when
+	    $stage : Stage ( value == Stage.FIND_INITIAL_BOUNDARY )
+	             Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+	    $edge1 : Edge ( p1 == $basePoint, p2 == $p1 )
+	    $edge2 : Edge ( p1 == $basePoint, p2 == $p2 )
+	    $edge3 : Edge ( p1 == $basePoint, p2 == $p3 )
+        not Junction( basePoint > $basePoint )
+	then
+	    $edge1.setLabel( Edge.B );
+	    $edge2.setLabel( Edge.PLUS );
+	    $edge3.setLabel( Edge.B );
+	    $stage.setValue( Stage.FIND_SECOND_BOUNDARY );
+	    modify( $edge1 );
+	    modify( $edge2 );
+	    modify( $edge3 );
+	    modify( $stage );
+    	System.out.println("initial boundary junction arrow");
+end
+
+# If we have already found the first boundary point, then find the second
+# boundary point, and label it.
+rule "second boundary junction L"
+	when
+	    $stage : Stage ( value == Stage.FIND_SECOND_BOUNDARY )
+	             Junction( type == Junction.L, $basePoint:basePoint, $p1:p1, $p2:p2 )
+	    $edge1 : Edge ( p1 == $basePoint, p2 == $p1 )
+	    $edge2 : Edge ( p1 == $basePoint, p2 == $p2 )
+        not Junction( basePoint < $basePoint )
+	then
+	    $edge1.setLabel( Edge.B );
+	    $edge2.setLabel( Edge.B );
+	    $stage.setValue( Stage.LABELING );
+	    modify( $edge1 );
+	    modify( $edge2 );
+	    modify( $stage );
+    	System.out.println("second boundary junction L");
+end
+
+# Ditto for arrow
+rule "second boundary junction arrow"
+	when
+	    $stage : Stage ( value == Stage.FIND_SECOND_BOUNDARY )
+	             Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+	    $edge1 : Edge ( p1 == $basePoint, p2 == $p1 )
+	    $edge2 : Edge ( p1 == $basePoint, p2 == $p2 )
+	    $edge3 : Edge ( p1 == $basePoint, p2 == $p3 )
+        not Junction( basePoint < $basePoint )
+	then
+	    $edge1.setLabel( Edge.B );
+	    $edge2.setLabel( Edge.PLUS );
+	    $edge3.setLabel( Edge.B );
+	    $stage.setValue( Stage.LABELING );
+	    modify( $edge1 );
+	    modify( $edge2 );
+	    modify( $edge3 );
+	    modify( $stage );
+    	System.out.println("second boundary junction arrow");
+end
+ 
+# If we have an edge whose label we already know definitely, then
+# label the corresponding edge in the other direction
+rule "match edge"
+	when
+	    Stage( value == Stage.LABELING )
+        $edge1: Edge( $p1:p1, $p2:p2, $label:label == Edge.PLUS | == Edge.MINUS | == Edge.B )
+        $edge2: Edge( p1 == $p2, p2 == $p1, label == Edge.NIL )
+	then
+	    $edge1.setPlotted( true );
+	    $edge2.setLabel( $label );
+	    $edge2.setPlotted( true );
+	    modify( $edge1 );
+	    modify( $edge2 );
+	    System.out.println("match edge - Plot "+$label+" "+$p1+" "+$p2);
+end
+
+# The following productions propogate the possible labellings of the edges
+# based on the labellings of edges incident on adjacent junctions.  Since
+# from the initial boundary productions, we have determined the labellings of
+# of atleast two junctions, this propogation will label all of the junctions
+# with the possible labellings.  The search space is pruned due to filtering,
+# i.e.(not only label a junction in the ways physically possible based on the
+# labellings of adjacent junctions.
+rule "label L"
+	when
+	    Stage( value == Stage.LABELING )
+	    Junction( type == Junction.L, $basePoint:basePoint )
+	    Edge( p1 == $basePoint, $Edge1P2 : p2, label == Edge.PLUS | == Edge.MINUS )
+        $edge: Edge( p1 == $basePoint, p2 != $Edge1P2, label == Edge.NIL )
+	then
+	    $edge.setLabel( Edge.B );
+	    modify( $edge );
+  	    System.out.println("Label L");
+end 
+ 
+rule "label tee A" salience 5
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.TEE, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        $edge1: Edge( p1 == $basePoint, p2 == $p1, label == Edge.NIL )
+        $edge2: Edge( p1 == $basePoint, p2 == $p3 )
+	then
+	    $edge1.setLabel( Edge.B );
+	    $edge2.setLabel( Edge.B );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    System.out.println("Label tee A");	    
+end 
+
+
+rule "label tee B"
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.TEE, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        $edge1: Edge( p1 == $basePoint, p2 == $p1 )
+        $edge2: Edge( p1 == $basePoint, p2 == $p3, label == Edge.NIL )
+	then
+	    $edge1.setLabel( Edge.B );
+	    $edge2.setLabel( Edge.B );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    System.out.println("Label tee B");	    	    
+end
+
+rule "label fork 1"
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.FORK, $basePoint:basePoint )
+                Edge( p1 == $basePoint, $p1:p2, label == Edge.PLUS )
+        $edge1: Edge( p1 == $basePoint, $p2:p2 != $p1, label == Edge.NIL )
+        $edge2: Edge( p1 == $basePoint, p2 != $p1, p2 != $p2 )
+	then
+	    $edge1.setLabel( Edge.PLUS );
+	    $edge2.setLabel( Edge.PLUS );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    System.out.println("label fork 1");	    	    
+end
+
+rule "label fork 2"
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.FORK, $basePoint:basePoint )
+        Edge( p1 == $basePoint, $p1:p2, label == Edge.B )
+        Edge( p1 == $basePoint, $p2:p2 != $p1, label == Edge.MINUS )
+        $edge: Edge( p1 == $basePoint, p2 != $p1, p2 != $p2, label == Edge.NIL )
+	then
+	    $edge.setLabel( Edge.B );
+	    modify( $edge );
+  	    System.out.println("label fork 2");	   	    
+end
+
+rule "label fork 3"
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.FORK, $basePoint:basePoint )
+        Edge( p1 == $basePoint, $p1:p2, label == Edge.B )
+        Edge( p1 == $basePoint, $p2:p2 != $p1, label == Edge.B )
+        $edge: Edge( p1 == $basePoint, p2 != $p1, p2 != $p2, label == Edge.NIL )
+	then
+	    $edge.setLabel( Edge.MINUS );
+	    modify( $edge );
+  	    System.out.println("label fork 3");	   	    
+end
+
+rule "label fork 4"
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.FORK, $basePoint:basePoint )
+        Edge( p1 == $basePoint, $p1:p2, label == Edge.MINUS )
+        Edge( p1 == $basePoint, $p2:p2 != $p1, label == Edge.MINUS )
+        $edge: Edge( p1 == $basePoint, p2 != $p1, p2 != $p2, label == Edge.NIL )
+	then
+	    $edge.setLabel( Edge.MINUS );
+	    modify( $edge );
+  	    System.out.println("label fork 4");	   	    
+end
+ 
+rule "label arrow 1A" salience 5
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        Edge( p1 == $basePoint, p2 == $p1, $label:label == Edge.B | == Edge.MINUS )
+        $edge1: Edge( p1 == $basePoint, p2 == $p2, label == Edge.NIL )
+        $edge2: Edge( p1 == $basePoint, p2 == $p3 )
+	then
+	    $edge1.setLabel( Edge.PLUS );
+	    $edge2.setLabel( $label );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    System.out.println("label arrow 1A");	   	    
+end
+ 
+rule "label arrow 1B" 
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        Edge( p1 == $basePoint, p2 == $p1, $label:label == Edge.B | == Edge.MINUS )
+        $edge1: Edge( p1 == $basePoint, p2 == $p2 )
+        $edge2: Edge( p1 == $basePoint, p2 == $p3, label == Edge.NIL )
+	then
+	    $edge1.setLabel( Edge.PLUS );
+	    $edge2.setLabel( $label );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    System.out.println("label arrow 1B");	  
+end
+ 
+rule "label arrow 2A" salience 5 
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        Edge( p1 == $basePoint, p2 == $p3, $label:label == Edge.B | == Edge.MINUS )
+        $edge1: Edge( p1 == $basePoint, p2 == $p2, label == Edge.NIL )
+        $edge2: Edge( p1 == $basePoint, p2 == $p1 )
+	then
+	    $edge1.setLabel( Edge.PLUS );
+	    $edge2.setLabel( $label );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    System.out.println("label arrow 2A");	  	    
+end
+ 
+rule "label arrow 2B"
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        Edge( p1 == $basePoint, p2 == $p3,  $label:label == Edge.B | == Edge.MINUS  )
+        $edge1: Edge( p1 == $basePoint, p2 == $p2 )
+        $edge2: Edge( p1 == $basePoint, p2 == $p1, label == Edge.NIL )
+	then
+	    $edge1.setLabel( Edge.PLUS );
+	    $edge2.setLabel( $label );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    System.out.println("label arrow 2B");	  	    	    
+end
+ 
+rule "label arrow 3A" salience 5 
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        Edge( p1 == $basePoint, p2 == $p1, label == Edge.PLUS )
+        $edge1: Edge( p1 == $basePoint, p2 == $p2, label == Edge.NIL )
+        $edge2: Edge( p1 == $basePoint, p2 == $p3 )
+	then
+	    $edge1.setLabel( Edge.MINUS );
+	    $edge2.setLabel( Edge.PLUS );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    System.out.println("label arrow 3A");	  	    	    
+end
+ 
+rule "label arrow 3B" 
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        Edge( p1 == $basePoint, p2 == $p1, label == Edge.PLUS )
+        $edge1: Edge( p1 == $basePoint, p2 == $p2 )
+        $edge2: Edge( p1 == $basePoint, p2 == $p3, label == Edge.NIL )
+	then
+	    $edge1.setLabel( Edge.MINUS );
+	    $edge2.setLabel( Edge.PLUS );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    System.out.println("label arrow 3B");	  	    	    
+end
+ 
+rule "label arrow 4A" salience 5 
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        Edge( p1 == $basePoint, p2 == $p3, label == Edge.PLUS )
+        $edge1: Edge( p1 == $basePoint, p2 == $p2, label == Edge.NIL )
+        $edge2: Edge( p1 == $basePoint, p2 == $p1 )
+	then
+	    $edge1.setLabel( Edge.MINUS );
+	    $edge2.setLabel( Edge.PLUS );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    System.out.println("label arrow 4A");	  	    	    
+end
+ 
+rule "label arrow 4B" 
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        Edge( p1 == $basePoint, p2 == $p3, label == Edge.PLUS )
+        $edge1: Edge( p1 == $basePoint, p2 == $p2 )
+        $edge2: Edge( p1 == $basePoint, p2 == $p1, label == Edge.NIL )
+	then
+	    $edge1.setLabel( Edge.MINUS );
+	    $edge2.setLabel( Edge.PLUS );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    System.out.println("label arrow 4B");	  	    	    
+end
+ 
+rule "label arrow 5A" salience 5 
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        Edge( p1 == $basePoint, p2 == $p2, label == Edge.MINUS )
+        $edge1: Edge( p1 == $basePoint, p2 == $p1 )
+        $edge2: Edge( p1 == $basePoint, p2 == $p3, label == Edge.NIL )
+	then
+	    $edge1.setLabel( Edge.PLUS );
+	    $edge2.setLabel( Edge.PLUS );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    System.out.println("label arrow 5A");	  	    	    
+end
+
+rule "label arrow 5B" 
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        Edge( p1 == $basePoint, p2 == $p2, label == Edge.MINUS )
+        $edge1: Edge( p1 == $basePoint, p2 == $p1, label == Edge.NIL )
+        $edge2: Edge( p1 == $basePoint, p2 == $p3 )
+	then
+	    $edge1.setLabel( Edge.PLUS );
+	    $edge2.setLabel( Edge.PLUS );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    System.out.println("label arrow 5B");	  	    	    
+end
+ 
+# The conflict resolution mechanism will only execute a production if no
+# productions that are more complicated are satisfied.  This production is
+# simple, so all of the above dictionary productions will fire before this
+# change of state production
+rule "done labeling" salience -10
+	when
+        $stage: Stage( value == Stage.LABELING )
+	then
+        $stage.setValue( Stage.PLOT_REMAINING_EDGES );
+        modify( $stage );
+    	System.out.println("done labeling");
+end
+
+# At this point, some labellings may have not been plotted, so plot them
+rule "plot remaining"
+	when
+	    Stage( value == Stage.PLOT_REMAINING_EDGES )
+	    $edge: Edge( plotted == false, $label:label != Edge.NIL, $p1:p1, $p2:p2 )
+	then
+	    System.out.println("Plot "+$label+" "+$p1+" "+$p2);
+	    $edge.setPlotted( true );
+	    modify( $edge );
+end
+
+# If we have been un able to label an edge, assume that it is a boundary.
+# This is a total Kludge, but what the hell. (if we assume only valid drawings
+# will be given for labeling, this assumption generally is true!)
+rule "plot boundaries"
+    when
+	    Stage( value == Stage.PLOT_REMAINING_EDGES )
+	    $edge: Edge( plotted == false, label == Edge.NIL, $p1:p1, $p2:p2 )
+	then
+	    System.out.println("Plot B "+$p1+" "+$p2);
+	    $edge.setPlotted( true );
+	    modify( $edge );
+end
+
+# If there is no more work to do, then we are done and flag it.
+rule "done plotting" salience -10
+	when
+	    $stage: Stage( value == Stage.PLOT_REMAINING_EDGES )
+	then
+	    $stage.setValue( Stage.DONE );
+	    modify( $stage );
+    	System.out.println("Stage: done");
+end

Added: labs/jbossrules/benchmarks/src/rules/benchmarks/waltz/waltz.clp
===================================================================
--- labs/jbossrules/benchmarks/src/rules/benchmarks/waltz/waltz.clp	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/rules/benchmarks/waltz/waltz.clp	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,507 @@
+; Copyright -c- 1996 KnowledgeBased Systems Corporation (KBSC)
+; Original code in CLIPS by Satoshi Nishiyama and the University of Texas at Austin 
+; modified for use with Jess by James Owen
+; Note that this is a benchmark program ONLY and is not warranted to do anything
+; KBSC assumes no responsiblity for anyone using or mis-using this program
+
+; Waltz 50 does nothing more than create a 3-D image from 2-D line points
+; by creating junctions, edges from lines 
+; Waltz 50, unlike the regular Waltz, does this 50 times
+
+; If you find a mistake, please email jco at kbsc.com with details.  Thanks...
+; 
+ 
+(load-package benchmarks.waltz.WaltzFile)
+
+; Notes:  
+; Lines have the lable "line" followed by the 2 points defining the line.  
+; Edges are like lines accept that they can be labeled permanently labelled and plotted.
+; Junctions are defined by 4 points.  
+; The basepoint is where the 3 (2) lines intersect.
+; The points p1, p2, p3 are the other endpoints of the lines at this junction
+
+; ==================
+(deftemplate stage 
+	(slot value))
+; =================
+(deftemplate line 
+	(slot p1) 
+	(slot p2))
+	; ================
+(deftemplate edge 
+	(slot p1) 
+	(slot p2 )
+	(slot joined )
+	(slot label )
+	(slot plotted))
+; =====================
+(deftemplate junction 
+	(slot p1 )
+	(slot p2 )
+	(slot p3 )
+	(slot base_point )
+	(slot type))
+	
+
+; ------------------------------------ 
+; The first rule does nothing more than 
+; check to see if the start flag is in WM
+(defrule begin
+	(initial-fact)
+	=>)
+
+; --------------------------------------------------- 
+; If the duplicate flag is set, and there is still a line in WM, delete the line
+; and add two edges. One edge runs from p1 to p2 and the other runs from p2 to
+; p1.  We then plot the edge.
+(defrule reverse_edges
+	(stage (value duplicate))
+	?f2 <- (line (p1 ?p1) (p2 ?p2))
+	=>
+	;(printout t "Draw " ?p1 "-" ?p2 crlf)
+	(assert (edge (p1 ?p1) (p2 ?p2) (joined false)))
+    (assert (edge (p1 ?p2) (p2 ?p1) (joined false)))
+	(retract ?f2))
+
+; -------------------------------------------- 
+; If the duplicate flag is set, and there are no more lines, then remove the
+; duplicating flag and set the make junctions flag.
+(defrule done_reversing
+	(declare (salience -10))
+	?f1 <- (stage (value duplicate))
+        (not (line))
+	=>
+	(modify ?f1 (value detect_junctions))
+	;(printout t "reversing done" crlf)
+ )
+ ; ----------------------------------------
+; If three edges meet at a point and none of them have already been joined in
+; a junction, then make the corresponding type of junction and label the
+; edges joined.  This production calls make-3_junction to determine
+; what type of junction it is based on the angles inscribed by the
+; intersecting edges
+(defrule make-3_junction
+	(declare (salience 10))
+	(stage (value detect_junctions))
+	?f2 <- (edge (p1 ?base_point) (p2 ?p1) (joined false))
+	?f3 <- (edge (p1 ?base_point) (p2 ?p2&~?p1) (joined false))
+	?f4 <- (edge (p1 ?base_point) (p2 ?p3&~?p1&~?p2) (joined false))
+	=>
+	(make_3_junction ?base_point ?p1 ?p2 ?p3)
+	(modify ?f2 (joined true))
+	(modify ?f3 (joined true))
+	(modify ?f4 (joined true))
+	;(printout t "make 3 junction" crlf)
+ )
+ 
+ 
+; ---------------------------------
+;If two, and only two, edges meet that have not already been joined, then
+;the junction is an "L"
+(defrule make_L
+	(stage (value detect_junctions))
+	?f2 <- (edge (p1 ?base_point) (p2 ?p2) (joined false))
+	?f3 <- (edge (p1 ?base_point) (p2 ?p3&~?p2) (joined false))
+	(not (edge (p1 ?base_point) (p2 ~?p2&~?p3)))
+	=>
+	(assert (junction
+		(type L)
+		(base_point ?base_point)
+		(p1 ?p2)
+		(p2 ?p3)))
+	(modify ?f2 (joined true))
+	(modify ?f3 (joined true))
+	;(printout t "make L" crlf) 
+)	
+; ---------------------------------
+;If the detect junctions flag is set, and there are no more un_joined edges,
+;set the find_initial_boundary flag
+(defrule done_detecting
+	(declare (salience -10))
+	?f1 <- (stage (value detect_junctions))
+	=>
+	(modify ?f1 (value find_initial_boundary))
+	;(printout t "detecting done" crlf) 	
+ )
+; -----------------------------------
+;If the initial boundary junction is an L, then we know it's labelling
+(defrule initial_boundary_junction_L
+	?f1 <- (stage (value find_initial_boundary))
+    (junction (type L) (base_point ?base_point) (p1 ?p1) (p2 ?p2))
+	?f3 <- (edge (p1 ?base_point) (p2 ?p1))
+	?f4 <- (edge (p1 ?base_point) (p2 ?p2))
+    (not (junction (base_point ?bp&:(>  ?bp ?base_point))))
+	=>
+    (modify ?f3 (label B))
+	(modify ?f4 (label B))
+	(modify ?f1 (value find_second_boundary))
+	;(printout t "initial boundary junction L" crlf) 	
+)
+	
+ 
+; --------------------------------------
+;Ditto for an arrow
+(defrule initial_boundary_junction_arrow
+	?f1 <- (stage (value find_initial_boundary))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	?f3 <- (edge (p1 ?bp) (p2 ?p1))
+	?f4 <- (edge (p1 ?bp) (p2 ?p2))
+	?f5 <- (edge (p1 ?bp) (p2 ?p3))
+	(not (junction (base_point ?b &:(> ?b ?bp))))
+	=>
+	(modify ?f3 (label B))
+	(modify ?f4 (label +))
+	(modify ?f5 (label B))
+	(modify ?f1 (value find_second_boundary))
+	;(printout t "initial boundary junction arrow" crlf) 	
+ )
+; --------------------------------------
+;If we have already found the first boundary point, then find the second
+;boundary point, and label it.
+ 
+(defrule second_boundary_junction_L
+	?f1 <- (stage (value find_second_boundary))
+    (junction (type L) (base_point ?base_point) (p1 ?p1) (p2 ?p2))
+	?f3 <- (edge (p1 ?base_point) (p2 ?p1))
+	?f4 <- (edge (p1 ?base_point) (p2 ?p2))
+    (not (junction (base_point ?bp&:(< ?bp ?base_point))))
+	=>
+    (modify ?f3 (label B))
+	(modify ?f4 (label B))
+	(modify ?f1 (value labeling))
+	;(printout t "second boundary junction L" crlf) 		
+ )
+; --------------------------------------
+(defrule second_boundary_junction_arrow
+	?f1 <- (stage (value find_second_boundary))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	?f3 <- (edge (p1 ?bp) (p2 ?p1))
+	?f4 <- (edge (p1 ?bp) (p2 ?p2))
+	?f5 <- (edge (p1 ?bp) (p2 ?p3))
+	(not (junction (base_point ?b&:(< ?b ?bp))))
+	=>
+	(modify ?f3 (label B))
+	(modify ?f4 (label +))
+	(modify ?f5 (label B))
+	(modify ?f1 (value labeling))
+	;(printout t "second boundary junction arrow" crlf) 			
+ )
+ 
+; --------------------------------------
+;If we have an edge whose label we already know definitely, then
+;label the corresponding edge in the other direction
+(defrule match_edge
+	(stage (value labeling))
+	?f2 <- (edge (p1 ?p1) (p2 ?p2) (label ?label& + | - | B ))
+	?f3 <- (edge (p1 ?p2) (p2 ?p1) (label nil))
+	=>
+	(modify ?f2 (plotted t))
+	(modify ?f3 (label ?label) (plotted t))
+	;(printout t "match edge  - Plot: " ?label " " ?p1 " " ?p2 crlf)
+) 
+;The following productions propogate the possible labellings of the edges
+;based on the labellings of edges incident on adjacent junctions.  Since
+;from the initial boundary productions, we have determined the labellings of
+;of atleast two junctions, this propogation will label all of the junctions
+;with the possible labellings.  The search space is pruned due to filtering,
+;i.e.(not only label a junction in the ways physically possible based on the
+;labellings of adjacent junctions.
+ 
+ 
+; --------------------------------------
+(defrule label_L
+	(stage (value labeling))
+	(junction (type L) (base_point ?p1))
+	(edge (p1 ?p1) (p2 ?p2) (label + | - ))
+	?f4 <- (edge (p1 ?p1) (p2 ~?p2) (label nil))
+	=>
+	(modify ?f4 (label B))
+	;(printout t "Label L" crlf) 		
+)	
+ 
+ 
+; --------------------------------------
+(defrule label_tee_A
+	(declare (salience 5))
+	(stage (value labeling))
+	(junction (type tee) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	?f3 <- (edge (p1 ?bp) (p2 ?p1) (label nil))
+	?f4 <- (edge (p1 ?bp) (p2 ?p3))
+	=>
+	(modify ?f3 (label B))
+	(modify ?f4 (label B))
+	;(printout t "Label tee A" crlf) 		
+)		
+ 
+ 
+; --------------------------------------
+(defrule label_tee_B
+	(stage (value labeling))
+	(junction (type tee) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	?f3 <- (edge (p1 ?bp) (p2 ?p1))
+	?f4 <- (edge (p1 ?bp) (p2 ?p3) (label nil))
+	=>
+	(modify ?f3 (label B))
+	(modify ?f4 (label B))
+	;(printout t "Label tee B" crlf) 			
+ )
+ 
+; --------------------------------------
+(defrule label_fork-1
+	(stage (value labeling))
+	(junction (type fork) (base_point ?bp))
+	(edge (p1 ?bp) (p2 ?p1) (label +))
+	?f4 <- (edge (p1 ?bp) (p2 ?p2&~?p1) (label nil))
+	?f5 <- (edge (p1 ?bp) (p2 ~?p2 &~?p1))
+	=>
+	(modify ?f4 (label +))
+	(modify ?f5 (label +))
+	;(printout t "Label fork 1" crlf) 		
+)		
+ 
+ 
+; --------------------------------------
+(defrule label_fork-2
+	(stage (value labeling))
+	(junction (type fork) (base_point ?bp))
+	(edge (p1 ?bp) (p2 ?p1) (label B))
+	(edge (p1 ?bp) (p2 ?p2&~?p1) (label - ))
+	?f5 <- (edge (p1 ?bp) (p2 ~?p2&~?p1) (label nil))
+	=>
+	(modify ?f5 (label B))
+	;(printout t "Label fork 2" crlf) 			
+ )
+ 
+; --------------------------------------
+(defrule label_fork-3
+	(stage (value labeling))
+	(junction (type fork) (base_point ?bp))
+	(edge (p1 ?bp) (p2 ?p1) (label B))
+	(edge (p1 ?bp) (p2 ?p2&~?p1) (label B))
+	?f5 <- (edge (p1 ?bp) (p2 ~?p2&~?p1) (label nil))
+	=>
+	(modify ?f5 (label -))
+	;(printout t "Label fork 3" crlf)
+)	
+ 
+ 
+; --------------------------------------
+(defrule label_fork-4
+	(stage (value labeling))
+	(junction (type fork) (base_point ?bp))
+	(edge (p1 ?bp) (p2 ?p1) (label -))
+	(edge (p1 ?bp) (p2 ?p2&~?p1) (label -))
+	?f5 <- (edge (p1 ?bp) (p2 ~?p2&~?p1) (label nil))
+	=>
+	(modify ?f5 (label -))
+	;(printout t "Label fork 4" crlf)	
+)	
+ 
+ 
+ 
+; --------------------------------------
+(defrule label_arrow-1A
+	(declare (salience 5))
+	(stage (value labeling))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	(edge (p1 ?bp) (p2 ?p1) (label ?label & B | - ))
+	?f4 <- (edge (p1 ?bp) (p2 ?p2) (label nil))
+	?f5 <- (edge (p1 ?bp) (p2 ?p3))
+	=>
+	(modify ?f4 (label +))
+	(modify ?f5 (label ?label))
+	;(printout t "Label arrow 1A" crlf)	
+)	 
+; --------------------------------------
+(defrule label_arrow-1B
+	(stage (value labeling))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	(edge (p1 ?bp) (p2 ?p1) (label ?label & B | - ))
+	?f4 <- (edge (p1 ?bp) (p2 ?p2))
+	?f5 <- (edge (p1 ?bp) (p2 ?p3) (label nil))
+	=>
+	(modify ?f4 (label +))
+	(modify ?f5 (label ?label))	
+	;(printout t "Label arrow 1B" crlf)	
+)	 
+ 
+; --------------------------------------
+(defrule label_arrow-2A
+	(declare (salience 5))
+	(stage (value labeling))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	(edge (p1 ?bp) (p2 ?p3) (label ?label & B | - ))
+	?f4 <- (edge (p1 ?bp) (p2 ?p2) (label nil))
+	?f5 <- (edge (p1 ?bp) (p2 ?p1))
+	=>
+	(modify ?f4 (label +))
+	(modify ?f5 (label ?label))
+	;(printout t "Label arrow 2A" crlf)	
+)		
+ 
+; --------------------------------------
+(defrule label_arrow-2B
+	(stage (value labeling))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	(edge (p1 ?bp) (p2 ?p3) (label ?label & B | - ))
+	?f4 <- (edge (p1 ?bp) (p2 ?p2))
+	?f5 <- (edge (p1 ?bp) (p2 ?p1) (label nil))
+	=>
+	(modify ?f4 (label +))
+	(modify ?f5 (label ?label))
+	;(printout t "Label arrow 2B" crlf)		
+ )
+ 
+; --------------------------------------
+(defrule label_arrow-3A
+	(declare (salience 5))
+	(stage (value labeling))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	(edge (p1 ?bp) (p2 ?p1) (label +))
+	?f4 <- (edge (p1 ?bp) (p2 ?p2) (label nil))
+	?f5 <- (edge (p1 ?bp) (p2 ?p3))
+	=>
+	(modify ?f4 (label -))
+	(modify ?f5 (label +))
+	;(printout t "Label arrow 3A" crlf)	
+)		
+ 
+; --------------------------------------
+(defrule label_arrow-3B
+	(stage (value labeling))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	(edge (p1 ?bp) (p2 ?p1) (label +))
+	?f4 <- (edge (p1 ?bp) (p2 ?p2))
+	?f5 <- (edge (p1 ?bp) (p2 ?p3) (label nil))
+	=>
+	(modify ?f4 (label -))
+	(modify ?f5 (label +))
+	;(printout t "Label arrow 3B" crlf)	
+)		
+ 
+ 
+; --------------------------------------
+(defrule label_arrow-4A
+	(declare (salience 5))
+	(stage (value labeling))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	(edge (p1 ?bp) (p2 ?p3) (label +))
+	?f4 <- (edge (p1 ?bp) (p2 ?p2) (label nil))
+	?f5 <- (edge (p1 ?bp) (p2 ?p1))
+	=>
+	(modify ?f4 (label -))
+	(modify ?f5 (label +))
+	;(printout t "Label arrow 4A" crlf)	
+)		
+ 
+; --------------------------------------
+(defrule label_arrow-4B
+	(stage (value labeling))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	(edge (p1 ?bp) (p2 ?p3) (label +))
+	?f4 <- (edge (p1 ?bp) (p2 ?p2))
+	?f5 <- (edge (p1 ?bp) (p2 ?p1) (label nil))
+	=>
+	(modify ?f4 (label -))
+	(modify ?f5 (label +))
+	;(printout t "Label arrow 4B" crlf)
+)		
+ 
+ 
+; --------------------------------------
+(defrule label_arrow-5A
+	(declare (salience 5))
+	(stage (value labeling))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	(edge (p1 ?bp) (p2 ?p2) (label -))
+	?f4 <- (edge (p1 ?bp) (p2 ?p1))
+	?f5 <- (edge (p1 ?bp) (p2 ?p3) (label nil))
+	=>
+	(modify ?f4 (label +))
+	(modify ?f5 (label +))
+	;(printout t "Label arrow 5A" crlf)
+)		
+ 
+ 
+; --------------------------------------
+(defrule label_arrow-5B
+	(stage (value labeling))
+	(junction (type arrow) (base_point ?bp) (p1 ?p1) (p2 ?p2) (p3 ?p3))
+	(edge (p1 ?bp) (p2 ?p2) (label -))
+	?f4 <- (edge (p1 ?bp) (p2 ?p1) (label nil))
+	?f5 <- (edge (p1 ?bp) (p2 ?p3))
+	=>
+	(modify ?f4 (label +))
+	(modify ?f5 (label +))
+	;(printout t "Label arrow 5B" crlf)	
+)	
+ 
+ 
+; --------------------------------------
+; Originally, someone with CLIPS or UT made the following comment
+; I don't think that we (KBSC) quite agree with this since Jess uses
+; an MEA conflict resolution strategy by default.  However, in the interest
+; of historical continuity we have left the original comment with the rule.
+; 2 Sept 2006 jco
+; --------------------------------------
+;The conflict resolution mechanism will onle execute a production if no
+;productions that are more complicated are satisfied.  This production is
+;simple, so all of the above dictionary productions will fire before this
+;change of state production
+(defrule done_labeling
+	(declare (salience -10))
+	?f1 <- (stage (value labeling))
+	=>
+	(modify ?f1 (value plot_remaining_edges))
+	;(printout t "done labelling"  crlf)		
+)
+ 
+; --------------------------------------
+;At this point, some labellings may have not been plotted, so plot them
+(defrule plot_remaining
+	(stage (value plot_remaining_edges))
+	?f2 <- (edge (plotted nil) (label ?label&~nil) (p1 ?p1) (p2 ?p2))
+	=>
+	;(printout t "Plot " ?label " " ?p1 " " ?p2 crlf)
+	(modify ?f2 (plotted t)))
+ 
+; --------------------------------------
+; Again - the original author, probably Danny, left this comment in the rule.
+; While it is a total kludge, it seems to have worked quite well for the past
+; 20 years or so.  :-)
+
+; --------------------------------------
+;If we have been un able to label an edge, assume that it is a boundary.
+;This is a total Kludge, but what the hell. (if we assume only valid drawings
+;will be given for labeling, this assumption generally is true!)
+(defrule plot_boundaries
+	(stage (value plot_remaining_edges))
+	?f2 <- (edge (plotted nil) (label nil) (p1 ?p1) (p2 ?p2))
+	=>
+	;(printout t "Plot " B " " ?p1 " " ?p2 crlf)
+	(modify ?f2 (plotted t)))
+ 
+; --------------------------------------
+;If there is no more work to do, then we are done and flag it.
+(defrule done_plotting
+	(declare (salience -10))
+	?f1 <- (stage (value plot_remaining_edges))
+	=>
+	(modify ?f1 (value done))
+	;(printout t "done plotting" crlf)			
+)	
+ 
+; --------------------------------------
+; Again, this is historical comment and does NOT describe what this rules does
+; which is, well, nothing of value.  We'll probably change it before the year
+; is up.  :-)  
+; 2 Sept 2006 jco
+; --------------------------------------
+;Prompt the user as to where he can see a trace of the OPS5
+;execution
+(defrule done
+	(stage (value done))
+	=>
+	)
+ 
+ 
\ No newline at end of file

Added: labs/jbossrules/benchmarks/src/rules/benchmarks/waltz/waltz.drl
===================================================================
--- labs/jbossrules/benchmarks/src/rules/benchmarks/waltz/waltz.drl	2006-10-30 23:33:48 UTC (rev 7240)
+++ labs/jbossrules/benchmarks/src/rules/benchmarks/waltz/waltz.drl	2006-10-31 00:33:08 UTC (rev 7241)
@@ -0,0 +1,479 @@
+#created on: 25/03/2006
+package benchmarks.waltz
+
+import benchmarks.waltz.Stage
+import benchmarks.waltz.Line
+import benchmarks.waltz.Edge
+import benchmarks.waltz.Junction
+import benchmarks.waltz.WaltzUtil
+
+#If the duplicate flag is set, and there is still a line in WM, delete the line
+#and add two edges. One edge runs from p1 to p2 and the other runs from p2 to
+#p1.  We then plot the edge.
+rule "reverse edges"
+	when
+		Stage(value == Stage.DUPLICATE)
+		$line : Line ( $p1:p1, $p2:p2 )
+	then 
+		//System.out.println("Draw "+$p1+" "+$p2);
+		assert( new Edge ( $p1, $p2, false, Edge.NIL, false ) );
+		assert( new Edge ( $p2, $p1, false, Edge.NIL, false ) );
+		retract( $line ); 
+end
+
+#If the duplicating flag is set, and there are no more lines, then remove the
+#duplicating flag and set the make junctions flag.
+rule "reversing done" salience -10
+	when
+        $stage: Stage ( value == Stage.DUPLICATE )
+        not ( Line() )
+	then
+        $stage.setValue ( Stage.DETECT_JUNCTIONS );
+        modify($stage);
+    	//System.out.println("reversing done");
+end
+
+#If three edges meet at a point and none of them have already been joined in
+#a junction, then make the corresponding type of junction and label the
+#edges joined.  This production calls make-3_junction to determine
+#what type of junction it is based on the angles inscribed by the
+#intersecting edges
+rule "make 3 junction" salience 10
+	when
+        Stage ( value == Stage.DETECT_JUNCTIONS )
+        $edge1: Edge( $basePoint:p1, $edge1P2:p2, joined==false )
+        $edge2: Edge( p1==$basePoint, $edge2P2:p2 != $edge1P2, joined == false )
+        $edge3: Edge( p1==$basePoint, $edge3P2:p2 != $edge1P2, p2 != $edge2P2, joined == false )
+	then
+	    Junction junction = WaltzUtil.make_3_junction( $basePoint, $edge1P2, $edge2P2, $edge3P2 );
+        //System.out.println( junction );
+	    assert( junction );
+	    $edge1.setJoined(true);
+	    $edge2.setJoined(true);
+	    $edge3.setJoined(true);
+	    modify( $edge1 );
+	    modify( $edge2 );
+	    modify( $edge3 );
+end
+
+#If two, and only two, edges meet that have not already been joined, then
+#the junction is an "L"
+rule "make L"
+	when
+        Stage ( value == Stage.DETECT_JUNCTIONS )
+        $edge1: Edge( $basePoint:p1, $edge1P2:p2, joined==false )
+        $edge2: Edge( p1==$basePoint, $edge2P2:p2 != $edge1P2, joined == false )
+        not Edge( p1==$basePoint, p2 != $edge1P2, p2 != $edge2P2 )
+	then
+	    assert( new Junction($edge1P2, $edge2P2, 0, $basePoint, Junction.L) );
+	    $edge1.setJoined(true);
+	    $edge2.setJoined(true);
+	    modify( $edge1 );
+	    modify( $edge2 );
+	    //System.out.println("make L");
+end
+
+#If the detect junctions flag is set, and there are no more un_joined edges,
+#set the find_initial_boundary flag
+rule "detecting done" salience -10
+    when
+        $stage : Stage ( value == Stage.DETECT_JUNCTIONS )
+ 	then
+ 	    $stage.setValue( Stage.FIND_INITIAL_BOUNDARY );
+ 	    modify( $stage );
+    	//System.out.println("detecting done");
+end
+
+#If the initial boundary junction is an L, then we know it's labelling
+rule "initial boundary junction L"
+	when
+	    $stage : Stage ( value == Stage.FIND_INITIAL_BOUNDARY )
+	             Junction( type == Junction.L, $basePoint:basePoint, $p1:p1, $p2:p2 )
+	    $edge1 : Edge ( p1 == $basePoint, p2 == $p1 )
+	    $edge2 : Edge ( p1 == $basePoint, p2 == $p2 )
+        not Junction( basePoint > $basePoint )
+	then
+	    $edge1.setLabel( Edge.B );
+	    $edge2.setLabel( Edge.B );
+	    $stage.setValue( Stage.FIND_SECOND_BOUNDARY );
+	    modify( $edge1 );
+	    modify( $edge2 );
+	    modify( $stage );
+    	//System.out.println("initial boundary junction L");
+end
+
+# Ditto for an arrow
+rule "initial boundary junction arrow"
+	when
+	    $stage : Stage ( value == Stage.FIND_INITIAL_BOUNDARY )
+	             Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+	    $edge1 : Edge ( p1 == $basePoint, p2 == $p1 )
+	    $edge2 : Edge ( p1 == $basePoint, p2 == $p2 )
+	    $edge3 : Edge ( p1 == $basePoint, p2 == $p3 )
+        not Junction( basePoint > $basePoint )
+	then
+	    $edge1.setLabel( Edge.B );
+	    $edge2.setLabel( Edge.PLUS );
+	    $edge3.setLabel( Edge.B );
+	    $stage.setValue( Stage.FIND_SECOND_BOUNDARY );
+	    modify( $edge1 );
+	    modify( $edge2 );
+	    modify( $edge3 );
+	    modify( $stage );
+    	//System.out.println("initial boundary junction arrow");
+end
+
+# If we have already found the first boundary point, then find the second
+# boundary point, and label it.
+rule "second boundary junction L"
+	when
+	    $stage : Stage ( value == Stage.FIND_SECOND_BOUNDARY )
+	             Junction( type == Junction.L, $basePoint:basePoint, $p1:p1, $p2:p2 )
+	    $edge1 : Edge ( p1 == $basePoint, p2 == $p1 )
+	    $edge2 : Edge ( p1 == $basePoint, p2 == $p2 )
+        not Junction( basePoint < $basePoint )
+	then
+	    $edge1.setLabel( Edge.B );
+	    $edge2.setLabel( Edge.B );
+	    $stage.setValue( Stage.LABELING );
+	    modify( $edge1 );
+	    modify( $edge2 );
+	    modify( $stage );
+    	//System.out.println("second boundary junction L");
+end
+
+# Ditto for arrow
+rule "second boundary junction arrow"
+	when
+	    $stage : Stage ( value == Stage.FIND_SECOND_BOUNDARY )
+	             Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+	    $edge1 : Edge ( p1 == $basePoint, p2 == $p1 )
+	    $edge2 : Edge ( p1 == $basePoint, p2 == $p2 )
+	    $edge3 : Edge ( p1 == $basePoint, p2 == $p3 )
+        not Junction( basePoint < $basePoint )
+	then
+	    $edge1.setLabel( Edge.B );
+	    $edge2.setLabel( Edge.PLUS );
+	    $edge3.setLabel( Edge.B );
+	    $stage.setValue( Stage.LABELING );
+	    modify( $edge1 );
+	    modify( $edge2 );
+	    modify( $edge3 );
+	    modify( $stage );
+    	//System.out.println("second boundary junction arrow");
+end
+ 
+# If we have an edge whose label we already know definitely, then
+# label the corresponding edge in the other direction
+rule "match edge"
+	when
+	    Stage( value == Stage.LABELING )
+        $edge1: Edge( $p1:p1, $p2:p2, $label:label == Edge.PLUS | == Edge.MINUS | == Edge.B )
+        $edge2: Edge( p1 == $p2, p2 == $p1, label == Edge.NIL )
+	then
+	    $edge1.setPlotted( true );
+	    $edge2.setLabel( $label );
+	    $edge2.setPlotted( true );
+	    modify( $edge1 );
+	    modify( $edge2 );
+	    //System.out.println("match edge - Plot "+$label+" "+$p1+" "+$p2);
+end
+
+# The following productions propogate the possible labellings of the edges
+# based on the labellings of edges incident on adjacent junctions.  Since
+# from the initial boundary productions, we have determined the labellings of
+# of atleast two junctions, this propogation will label all of the junctions
+# with the possible labellings.  The search space is pruned due to filtering,
+# i.e.(not only label a junction in the ways physically possible based on the
+# labellings of adjacent junctions.
+rule "label L"
+	when
+	    Stage( value == Stage.LABELING )
+	    Junction( type == Junction.L, $basePoint:basePoint )
+	    Edge( p1 == $basePoint, $Edge1P2 : p2, label == Edge.PLUS | == Edge.MINUS )
+        $edge: Edge( p1 == $basePoint, p2 != $Edge1P2, label == Edge.NIL )
+	then
+	    $edge.setLabel( Edge.B );
+	    modify( $edge );
+  	    //System.out.println("Label L");
+end 
+ 
+rule "label tee A" salience 5
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.TEE, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        $edge1: Edge( p1 == $basePoint, p2 == $p1, label == Edge.NIL )
+        $edge2: Edge( p1 == $basePoint, p2 == $p3 )
+	then
+	    $edge1.setLabel( Edge.B );
+	    $edge2.setLabel( Edge.B );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    //System.out.println("Label tee A");	    
+end 
+
+
+rule "label tee B"
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.TEE, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        $edge1: Edge( p1 == $basePoint, p2 == $p1 )
+        $edge2: Edge( p1 == $basePoint, p2 == $p3, label == Edge.NIL )
+	then
+	    $edge1.setLabel( Edge.B );
+	    $edge2.setLabel( Edge.B );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    //System.out.println("Label tee B");	    	    
+end
+
+rule "label fork 1"
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.FORK, $basePoint:basePoint )
+                Edge( p1 == $basePoint, $p1:p2, label == Edge.PLUS )
+        $edge1: Edge( p1 == $basePoint, $p2:p2 != $p1, label == Edge.NIL )
+        $edge2: Edge( p1 == $basePoint, p2 != $p1, p2 != $p2 )
+	then
+	    $edge1.setLabel( Edge.PLUS );
+	    $edge2.setLabel( Edge.PLUS );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    //System.out.println("label fork 1");	    	    
+end
+
+rule "label fork 2"
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.FORK, $basePoint:basePoint )
+        Edge( p1 == $basePoint, $p1:p2, label == Edge.B )
+        Edge( p1 == $basePoint, $p2:p2 != $p1, label == Edge.MINUS )
+        $edge: Edge( p1 == $basePoint, p2 != $p1, p2 != $p2, label == Edge.NIL )
+	then
+	    $edge.setLabel( Edge.B );
+	    modify( $edge );
+  	    //System.out.println("label fork 2");	   	    
+end
+
+rule "label fork 3"
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.FORK, $basePoint:basePoint )
+        Edge( p1 == $basePoint, $p1:p2, label == Edge.B )
+        Edge( p1 == $basePoint, $p2:p2 != $p1, label == Edge.B )
+        $edge: Edge( p1 == $basePoint, p2 != $p1, p2 != $p2, label == Edge.NIL )
+	then
+	    $edge.setLabel( Edge.MINUS );
+	    modify( $edge );
+  	    //System.out.println("label fork 3");	   	    
+end
+
+rule "label fork 4"
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.FORK, $basePoint:basePoint )
+        Edge( p1 == $basePoint, $p1:p2, label == Edge.MINUS )
+        Edge( p1 == $basePoint, $p2:p2 != $p1, label == Edge.MINUS )
+        $edge: Edge( p1 == $basePoint, p2 != $p1, p2 != $p2, label == Edge.NIL )
+	then
+	    $edge.setLabel( Edge.MINUS );
+	    modify( $edge );
+  	    //System.out.println("label fork 4");	   	    
+end
+ 
+rule "label arrow 1A" salience 5
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        Edge( p1 == $basePoint, p2 == $p1, $label:label == Edge.B | == Edge.MINUS )
+        $edge1: Edge( p1 == $basePoint, p2 == $p2, label == Edge.NIL )
+        $edge2: Edge( p1 == $basePoint, p2 == $p3 )
+	then
+	    $edge1.setLabel( Edge.PLUS );
+	    $edge2.setLabel( $label );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    //System.out.println("label arrow 1A");	   	    
+end
+ 
+rule "label arrow 1B" 
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        Edge( p1 == $basePoint, p2 == $p1, $label:label == Edge.B | == Edge.MINUS )
+        $edge1: Edge( p1 == $basePoint, p2 == $p2 )
+        $edge2: Edge( p1 == $basePoint, p2 == $p3, label == Edge.NIL )
+	then
+	    $edge1.setLabel( Edge.PLUS );
+	    $edge2.setLabel( $label );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    //System.out.println("label arrow 1B");	  
+end
+ 
+rule "label arrow 2A" salience 5 
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        Edge( p1 == $basePoint, p2 == $p3, $label:label == Edge.B | == Edge.MINUS )
+        $edge1: Edge( p1 == $basePoint, p2 == $p2, label == Edge.NIL )
+        $edge2: Edge( p1 == $basePoint, p2 == $p1 )
+	then
+	    $edge1.setLabel( Edge.PLUS );
+	    $edge2.setLabel( $label );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    //System.out.println("label arrow 2A");	  	    
+end
+ 
+rule "label arrow 2B"
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        Edge( p1 == $basePoint, p2 == $p3,  $label:label == Edge.B | == Edge.MINUS  )
+        $edge1: Edge( p1 == $basePoint, p2 == $p2 )
+        $edge2: Edge( p1 == $basePoint, p2 == $p1, label == Edge.NIL )
+	then
+	    $edge1.setLabel( Edge.PLUS );
+	    $edge2.setLabel( $label );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    //System.out.println("label arrow 2B");	  	    	    
+end
+ 
+rule "label arrow 3A" salience 5 
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        Edge( p1 == $basePoint, p2 == $p1, label == Edge.PLUS )
+        $edge1: Edge( p1 == $basePoint, p2 == $p2, label == Edge.NIL )
+        $edge2: Edge( p1 == $basePoint, p2 == $p3 )
+	then
+	    $edge1.setLabel( Edge.MINUS );
+	    $edge2.setLabel( Edge.PLUS );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    //System.out.println("label arrow 3A");	  	    	    
+end
+ 
+rule "label arrow 3B" 
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        Edge( p1 == $basePoint, p2 == $p1, label == Edge.PLUS )
+        $edge1: Edge( p1 == $basePoint, p2 == $p2 )
+        $edge2: Edge( p1 == $basePoint, p2 == $p3, label == Edge.NIL )
+	then
+	    $edge1.setLabel( Edge.MINUS );
+	    $edge2.setLabel( Edge.PLUS );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    //System.out.println("label arrow 3B");	  	    	    
+end
+ 
+rule "label arrow 4A" salience 5 
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        Edge( p1 == $basePoint, p2 == $p3, label == Edge.PLUS )
+        $edge1: Edge( p1 == $basePoint, p2 == $p2, label == Edge.NIL )
+        $edge2: Edge( p1 == $basePoint, p2 == $p1 )
+	then
+	    $edge1.setLabel( Edge.MINUS );
+	    $edge2.setLabel( Edge.PLUS );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    //System.out.println("label arrow 4A");	  	    	    
+end
+ 
+rule "label arrow 4B" 
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        Edge( p1 == $basePoint, p2 == $p3, label == Edge.PLUS )
+        $edge1: Edge( p1 == $basePoint, p2 == $p2 )
+        $edge2: Edge( p1 == $basePoint, p2 == $p1, label == Edge.NIL )
+	then
+	    $edge1.setLabel( Edge.MINUS );
+	    $edge2.setLabel( Edge.PLUS );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    //System.out.println("label arrow 4B");	  	    	    
+end
+ 
+rule "label arrow 5A" salience 5 
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        Edge( p1 == $basePoint, p2 == $p2, label == Edge.MINUS )
+        $edge1: Edge( p1 == $basePoint, p2 == $p1 )
+        $edge2: Edge( p1 == $basePoint, p2 == $p3, label == Edge.NIL )
+	then
+	    $edge1.setLabel( Edge.PLUS );
+	    $edge2.setLabel( Edge.PLUS );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    //System.out.println("label arrow 5A");	  	    	    
+end
+
+rule "label arrow 5B" 
+	when
+        Stage( value == Stage.LABELING )
+        Junction( type == Junction.ARROW, $basePoint:basePoint, $p1:p1, $p2:p2, $p3:p3 )
+        Edge( p1 == $basePoint, p2 == $p2, label == Edge.MINUS )
+        $edge1: Edge( p1 == $basePoint, p2 == $p1, label == Edge.NIL )
+        $edge2: Edge( p1 == $basePoint, p2 == $p3 )
+	then
+	    $edge1.setLabel( Edge.PLUS );
+	    $edge2.setLabel( Edge.PLUS );
+	    modify( $edge1 );
+	    modify( $edge2 );
+  	    //System.out.println("label arrow 5B");	  	    	    
+end
+ 
+# The conflict resolution mechanism will only execute a production if no
+# productions that are more complicated are satisfied.  This production is
+# simple, so all of the above dictionary productions will fire before this
+# change of state production
+rule "done labeling" salience -10
+	when
+        $stage: Stage( value == Stage.LABELING )
+	then
+        $stage.setValue( Stage.PLOT_REMAINING_EDGES );
+        modify( $stage );
+    	//System.out.println("done labeling");
+end
+
+# At this point, some labellings may have not been plotted, so plot them
+rule "plot remaining"
+	when
+	    Stage( value == Stage.PLOT_REMAINING_EDGES )
+	    $edge: Edge( plotted == false, $label:label != Edge.NIL, $p1:p1, $p2:p2 )
+	then
+	    //System.out.println("Plot "+$label+" "+$p1+" "+$p2);
+	    $edge.setPlotted( true );
+	    modify( $edge );
+end
+
+# If we have been un able to label an edge, assume that it is a boundary.
+# This is a total Kludge, but what the hell. (if we assume only valid drawings
+# will be given for labeling, this assumption generally is true!)
+rule "plot boundaries"
+    when
+	    Stage( value == Stage.PLOT_REMAINING_EDGES )
+	    $edge: Edge( plotted == false, label == Edge.NIL, $p1:p1, $p2:p2 )
+	then
+	    //System.out.println("Plot B "+$p1+" "+$p2);
+	    $edge.setPlotted( true );
+	    modify( $edge );
+end
+
+# If there is no more work to do, then we are done and flag it.
+rule "done plotting" salience -10
+	when
+	    $stage: Stage( value == Stage.PLOT_REMAINING_EDGES )
+	then
+	    $stage.setValue( Stage.DONE );
+	    modify( $stage );
+    	//System.out.println("Stage: done");
+end




More information about the jboss-svn-commits mailing list