source: vis_dev/zchaff/run_till_fix.pl @ 20

Last change on this file since 20 was 10, checked in by cecile, 13 years ago

Zchaff

File size: 767 bytes
Line 
1#!/usr/bin/perl -w
2
3use strict;
4
5die "Usage:\nrun_till_fix CNF_Filename [Num_Max_Iterations]" if (@ARGV < 1);
6   
7my $file = $ARGV[0];
8my $max_iteration = @ARGV > 1 ? $ARGV[1] : 1000;
9my $last_cls_count = 0; 
10my $filename = $file."_itr_0";
11$filename =~ s/.*\///;
12
13system("cp $file $filename");
14
15$file =~ s/.*\///;
16
17for (my $i = 0; $i < $max_iteration; ++$i) {
18 
19  open INPUT, "<$filename" or die "$!\n";
20 
21  my @tokens;
22 
23  while (<INPUT>) {
24    @tokens = split / /;
25    last if ($tokens[0] eq "p");
26  }
27 
28  last if $tokens[3] == $last_cls_count;
29 
30  $last_cls_count = $tokens[3];
31 
32  system("zchaff $filename");
33  system("zverify_df $filename resolve_trace -core");
34  my $j = $i + 1;
35  $filename = $file."_itr_".$j;
36  system("mv unsat_core.cnf $filename");
37}
Note: See TracBrowser for help on using the repository browser.