Z3 sometimes reports two errors, with the first one referring to line 1 for some strange reason -- but it makes no sense to kill line 1, so we traverse the errors in reverse and consider only the last error
--- a/src/HOL/Tools/SMT/lib/scripts/z3_wrapper Fri Dec 17 09:56:04 2010 +0100
+++ b/src/HOL/Tools/SMT/lib/scripts/z3_wrapper Fri Dec 17 11:12:37 2010 +0100
@@ -29,7 +29,7 @@
print STDERR join("", @err_lines);
if ($code != 0) {
- foreach my $err_line (@err_lines) {
+ foreach my $err_line (reverse(@err_lines)) {
if ($err_line =~ /[lL]ine ([0-9]+)/) {
my $line_num = $1;