Advertisement
dvulakh

post.clingo.short.pl

Mar 4th, 2020
699
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.40 KB | None | 0 0
  1.  
  2. # Take input
  3. $fl = <STDIN>;
  4. chomp $fl;
  5. $/ = undef;
  6.  
  7. open($fin, '<', $fl) or die "Cannot open file\n";
  8. $clingout = <$fin>;
  9. close $fin;
  10.  
  11. # Find number of solutions and runtime
  12. if ($clingout =~ /Models\s*:\s*(\S*)\+/) { print "$1\n"; }
  13. elsif ($clingout =~ /Models\s*:\s*(\S*)/) { print "$1\n"; }
  14. else { print "-1\n"; }
  15.  
  16. if ($clingout =~ /Time\s*:\s*(\S*)s/) { print "$1\n"; }
  17. else { print "0\n"; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement