Sort search results in order of relevance, where relevance =
a) better if 0 premises for intro or 1 premise for elim/dest rules
b) better if substitution size wrt to current goal is smaller
Only applies to intro, dest, elim, and simp
(contributed by Rafal Kolanski, NICTA)
#!/usr/bin/env perl
#
# $Id$
# Author: Makarius
#
# DESCRIPTION: Simple report generator for Poly/ML profiling output.
use strict;
my %log = ();
my @output = ();
while (<ARGV>) {
if (m,^([ 0-9]{10}) (\S+$|GARBAGE COLLECTION.*$),) {
my $count = $1;
my $fun = $2;
$fun =~ s,-?\(\d+\).*$,,g;
$fun =~ s,/\d+$,,g;
if ($count =~ m,^\s*(\d)+$,) {
if (defined($log{$fun})) {
$log{$fun} += $count;
} else {
$log{$fun} = $count;
}
}
}
}
foreach my $fun (keys %log) {
push @output, (sprintf "%12d %s\n", $log{$fun}, $fun);
}
print (sort @output);