sub allPrefs { my( $x, $bits, $y )= @_; $Pref->{$x}{$x}= EQU(); onePref( $x, $bits, $y ); while( my($z,$v)= each %{$Pref->{$y}} ) { onePref( $x, $bits & $v, $z ); } } sub partialOrder { for my $chain ( @_ ) { while( $chain =~ /\G\s*(\w+)\s*([<=>])\s*(?=(\w+))/gc ) { my( $x, $c, $y )= ( $1, $2, $3 ); my $bits= $OpBits{$c}; allPrefs( $x, $bits, $y ); allPrefs( $y, $RevBits{$bits}, $x ); } if( $chain !~ /\G\s*(\w+)\s*$/g ) { die "Invalid preferences ($chain).\n"; } } }