#!/usr/bin/perl
$last = $revnum = $ruleno = -1;
while (<>) {
	if($_ =~ /Rule ([0-9]+)\/([0-9]+)/m || $_ =~ /^END OF THE FULL LOGICAL RULESET$/) {
		if($last != $revnum) {
			print "Problem with Rule $ruleno/$revnum ($last)\n";
		}
		$revnum = $2;
		$ruleno = $1;
	}
	if($_ =~ /^(Created|Initial)/) {
		$last = 0;
	} elsif($_ =~ /^Amended\(([0-9]+)\)/m) {
		$last = $1;
	}
}
