doc-src/TutorialI/Overview/LNCS/makeDemo
author chaieb
Wed, 19 May 2004 11:23:59 +0200
changeset 14758 af3b71a46a1c
parent 13262 bbfc360db011
permissions -rwxr-xr-x
A new implementation for presburger arithmetic following the one suggested in technical report Chaieb Amine and Tobias Nipkow. It is generic an smaller. the tactic has also changed and allows the abstaction over fuction occurences whose type is nat or int.

#!/usr/bin/perl -w

sub doit {
    my ($file) = @_;

    open (FILE, $file) || die $!;
    undef $/; $text = <FILE>; $/ = "\n";
    close FILE || die $!;

    $_ = $text;

    s/text_raw\{\*([^*]|\*[^}])*\*\}//sg;       # actual work done here
    s/text\{\*([^*]|\*[^}])*\*\}//sg;       # actual work done here
    s/\(\*<\*\)//sg;
    s/\(\*>\*\)//sg;

    $result = $_;

    if ($text ne $result) {
        print STDERR "fixing $file\n";
#        if (! -f "$file~~") {
#            rename $file, "$file~~" || die $!;
#        }
        open (FILE, "> Demo/$file") || die $!;
        print FILE $result;
        close FILE || die $!;
    }
}


foreach $file (@ARGV) {
  eval { &doit($file); };
  if ($@) { print STDERR "*** doit $file: ", $@, "\n"; }
}