// --------------------------------------------------
// The following code is used to test the property
// filter.
// --------------------------------------------------

import engine.*;

ruleset r
{
  inout boolean passedInRule1;
  inout boolean passedInRule2;
  inout boolean passedInRule3;
  inout boolean passedInRule4;
  inout boolean passedInRule5;
}

rule rule1
{
   property TheProperty = "yoooo";
   when {
     ?i: Integer();
   }
   then {
     //   out.println("rule1 fired with TheProperty's value equals to yoooo. OK");
     passedInRule1 = true;
   }
}

rule ilog.rule2
{
   property TheProperty = "yoo";
   when {
     ?i: Integer();
   }
   then {
     //     out.println("rule2 fired with TheProperty's value equals to yoo. KO");
     passedInRule2 = true;
   }
}

rule ilog.rules.engine.rule3
{
   when {
     ?i: Integer();
   }
   then {
     //     out.println("rule3 fired without the TheProperty property. KO");
     passedInRule3 = true;
   }
}

rule ilog.rules.engine.rule4
{
   property TheProperty = "yoooo";
   when {
     ?i: Integer(intValue() < 0);
   }
   then {
     //     out.println("rule4 fired with TheProperty's value equals to yoooo but a not verified condition. KO");
     passedInRule4 = true;
   }
}

rule ilog.rules.enginerule5
{
   property TheProperty = "yoooo";
   when {
     ?i: Integer();
   }
   then {
     //     out.println("rule5 fired with TheProperty's value equals to yoooo. OK");
     passedInRule5 = true;
   }
}
