Admin/mira.py
author krauss
Fri, 04 Mar 2011 11:52:54 +0100
changeset 41894 7c4a4b02dbdb
parent 41652 4f4336e730b9
child 42040 869df9b88deb
permissions -rw-r--r--
produce helpful mira summary for more errors
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
41542
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
     1
"""
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
     2
    Test configuration descriptions for mira.
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
     3
"""
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
     4
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
     5
import os
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
     6
from os import path
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
     7
from glob import glob
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
     8
import subprocess
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
     9
import re
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    10
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    11
import util
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    12
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    13
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    14
# build and evaluation tools
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    15
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    16
def prepare_isabelle_repository(loc_isabelle, loc_contrib, loc_dependency_heaps, parallelism = True):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    17
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    18
    loc_contrib = path.expanduser(loc_contrib)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    19
    if not path.exists(loc_contrib):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    20
        raise IOError('Bad file: %s' % loc_contrib)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    21
    subprocess.check_call(['ln', '-s', loc_contrib, '%s/contrib' % loc_isabelle])
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    22
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    23
    contributed_components = path.join(loc_isabelle, 'Admin', 'contributed_components')
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    24
    if path.exists(contributed_components):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    25
        components = []
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    26
        for component in util.readfile_lines(contributed_components):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    27
            loc_component = path.join(loc_isabelle, component)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    28
            if path.exists(loc_component):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    29
                components.append(loc_component)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    30
        writer = open(path.join(loc_isabelle, 'etc', 'components'), 'a')
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    31
        for component in components:
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    32
            writer.write(component + '\n')
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    33
        writer.close()
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    34
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    35
    if loc_dependency_heaps:
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    36
        isabelle_path = loc_dependency_heaps + '/$ISABELLE_IDENTIFIER:$ISABELLE_OUTPUT'
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    37
    else:
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    38
        isabelle_path = '$ISABELLE_OUTPUT'
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    39
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    40
    if parallelism:
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    41
        parallelism_options = '-M max'
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    42
    else:
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    43
        parallelism_options = '-M 1 -q 0'
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    44
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    45
    extra_settings = '''
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    46
ISABELLE_HOME_USER="$ISABELLE_HOME/home_user"
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    47
ISABELLE_OUTPUT="$ISABELLE_HOME/heaps"
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    48
ISABELLE_BROWSER_INFO="$ISABELLE_HOME/browser_info"
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    49
ISABELLE_PATH="%s"
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    50
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    51
ISABELLE_USEDIR_OPTIONS="$ISABELLE_USEDIR_OPTIONS %s -t true -v true -d pdf -g true -i true"
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    52
''' % (isabelle_path, parallelism_options)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    53
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    54
    writer = open(path.join(loc_isabelle, 'etc', 'settings'), 'a')
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    55
    writer.write(extra_settings)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    56
    writer.close()
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    57
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    58
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    59
def extract_isabelle_run_timing(logdata):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    60
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    61
    def to_secs(h, m, s):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    62
        return (int(h) * 60 + int(m)) * 60 + int(s)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    63
    pat = r'Finished (\S+) \((\d+):(\d+):(\d+) elapsed time, (\d+):(\d+):(\d+) cpu time'
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    64
    pat2 = r'Timing (\S+) \((\d+) threads, (\d+\.\d+)s elapsed time, (\d+\.\d+)s cpu time, (\d+\.\d+)s GC time\)'
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    65
    t = dict((name, {'elapsed': to_secs(eh,em,es), 'cpu': to_secs(ch,cm,cs)})
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    66
             for name, eh, em, es, ch, cm, cs in re.findall(pat, logdata))
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    67
    for name, threads, elapsed, cpu, gc in re.findall(pat2, logdata):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    68
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    69
        if name not in t:
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    70
            t[name] = {}
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    71
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    72
        t[name]['threads'] = int(threads)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    73
        t[name]['elapsed_inner'] = elapsed
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    74
        t[name]['cpu_inner'] = cpu
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    75
        t[name]['gc'] = gc
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    76
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    77
    return t
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    78
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    79
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    80
def extract_isabelle_run_summary(logdata):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    81
41894
7c4a4b02dbdb produce helpful mira summary for more errors
krauss
parents: 41652
diff changeset
    82
    re_error = re.compile(r'^(?:make: )?\*\*\* (.*)$', re.MULTILINE)
41542
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    83
    summary = '\n'.join(re_error.findall(logdata))
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    84
    if summary == '':
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    85
        summary = 'ok'
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    86
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    87
    return summary
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    88
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    89
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    90
def isabelle_usedir(env, isa_path, isabelle_usedir_opts, base_image, dir_name):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    91
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    92
    return env.run_process('%s/bin/isabelle' % isa_path, 'usedir',
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    93
        isabelle_usedir_opts, base_image, dir_name)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    94
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    95
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    96
def isabelle_dependency_only(env, case, paths, dep_paths, playground):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    97
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    98
    p = paths[0]
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
    99
    result = path.join(p, 'heaps')
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   100
    os.makedirs(result)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   101
    for dep_path in dep_paths:
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   102
        subprocess.check_call(['cp', '-R'] + glob(dep_path + '/*') + [result])
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   103
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   104
    return (True, 'ok', {}, {}, result)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   105
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   106
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   107
def build_isabelle_image(subdir, base, img, env, case, paths, dep_paths, playground):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   108
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   109
    p = paths[0]
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   110
    dep_path = dep_paths[0]
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   111
    prepare_isabelle_repository(p, env.settings.contrib, dep_path)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   112
    os.chdir(path.join(p, 'src', subdir))
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   113
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   114
    (return_code, log) = isabelle_usedir(env, p, '-b', base, img)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   115
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   116
    result = path.join(p, 'heaps')
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   117
    return (return_code == 0, extract_isabelle_run_summary(log),
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   118
      {'timing': extract_isabelle_run_timing(log)}, {'log': log}, result)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   119
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   120
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   121
def isabelle_makeall(env, case, paths, dep_paths, playground):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   122
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   123
    p = paths[0]
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   124
    dep_path = dep_paths[0]
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   125
    prepare_isabelle_repository(p, env.settings.contrib, dep_path)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   126
    os.chdir(p)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   127
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   128
    (return_code, log) = env.run_process('%s/bin/isabelle' % p, 'makeall', '-k', 'all')
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   129
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   130
    return (return_code == 0, extract_isabelle_run_summary(log),
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   131
      {'timing': extract_isabelle_run_timing(log)}, {'log': log}, None)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   132
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   133
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   134
# Isabelle configurations
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   135
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   136
@configuration(repos = [Isabelle], deps = [])
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   137
def Pure(env, case, paths, dep_paths, playground):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   138
    """Pure image"""
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   139
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   140
    p = paths[0]
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   141
    prepare_isabelle_repository(p, env.settings.contrib, '')
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   142
    os.chdir(path.join(p, 'src', 'Pure'))
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   143
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   144
    (return_code, log) = env.run_process('%s/bin/isabelle' % p, 'make', 'Pure')
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   145
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   146
    result = path.join(p, 'heaps')
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   147
    return (return_code == 0, extract_isabelle_run_summary(log),
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   148
      {'timing': extract_isabelle_run_timing(log)}, {'log': log}, result)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   149
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   150
@configuration(repos = [Isabelle], deps = [(Pure, [0])])
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   151
def FOL(*args):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   152
    """FOL image"""
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   153
    return build_isabelle_image('FOL', 'Pure', 'FOL', *args)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   154
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   155
@configuration(repos = [Isabelle], deps = [(Pure, [0])])
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   156
def HOL(*args):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   157
    """HOL image"""
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   158
    return build_isabelle_image('HOL', 'Pure', 'HOL', *args)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   159
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   160
@configuration(repos = [Isabelle], deps = [(HOL, [0])])
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   161
def HOL_HOLCF(*args):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   162
    """HOL-HOLCF image"""
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   163
    return build_isabelle_image('HOL/HOLCF', 'HOL', 'HOLCF', *args)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   164
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   165
@configuration(repos = [Isabelle], deps = [(HOL, [0])])
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   166
def HOL_Nominal(*args):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   167
    """HOL-Nominal image"""
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   168
    return build_isabelle_image('HOL/Nominal', 'HOL', 'HOL-Nominal', *args)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   169
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   170
@configuration(repos = [Isabelle], deps = [(HOL, [0])])
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   171
def HOL_Word(*args):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   172
    """HOL-Word image"""
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   173
    return build_isabelle_image('HOL/Word', 'HOL', 'HOL-Word', *args)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   174
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   175
@configuration(repos = [Isabelle], deps = [
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   176
    (HOL, [0]),
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   177
    (HOL_HOLCF, [0]),
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   178
    (HOL_Nominal, [0]),
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   179
    (HOL_Word, [0])
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   180
  ])
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   181
def AFP_images(*args):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   182
    """Isabelle images needed for the AFP"""
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   183
    return isabelle_dependency_only(*args)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   184
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   185
@configuration(repos = [Isabelle], deps = [
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   186
    (AFP_images, [0])
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   187
  ])
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   188
def Isabelle_makeall(*args):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   189
    """Isabelle makeall"""
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   190
    return isabelle_makeall(*args)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   191
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   192
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   193
# Mutabelle configurations
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   194
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   195
def invoke_mutabelle(theory, env, case, paths, dep_paths, playground):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   196
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   197
    """Mutant testing for counterexample generators in Isabelle"""
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   198
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   199
    (loc_isabelle,) = paths
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   200
    (dep_isabelle,) = dep_paths
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   201
    prepare_isabelle_repository(loc_isabelle, env.settings.contrib, dep_isabelle)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   202
    os.chdir(loc_isabelle)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   203
    
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   204
    (return_code, log) = env.run_process('bin/isabelle',
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   205
      'mutabelle', '-O', playground, theory)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   206
    
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   207
    try:
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   208
        mutabelle_log = util.readfile(path.join(playground, 'log'))
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   209
    except IOError:
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   210
        mutabelle_log = ''
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   211
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   212
    return (return_code == 0 and mutabelle_log != '', extract_isabelle_run_summary(log),
41652
4f4336e730b9 report mutabelle log in mira configuration
haftmann
parents: 41554
diff changeset
   213
      {'timing': extract_isabelle_run_timing(log)},
4f4336e730b9 report mutabelle log in mira configuration
haftmann
parents: 41554
diff changeset
   214
      {'log': log, 'mutabelle_log': mutabelle_log}, None)
41542
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   215
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   216
@configuration(repos = [Isabelle], deps = [(HOL, [0])])
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   217
def Mutabelle_Relation(*args):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   218
    """Mutabelle regression suite on Relation theory"""
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   219
    return invoke_mutabelle('Relation', *args)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   220
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   221
@configuration(repos = [Isabelle], deps = [(HOL, [0])])
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   222
def Mutabelle_List(*args):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   223
    """Mutabelle regression suite on List theory"""
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   224
    return invoke_mutabelle('List', *args)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   225
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   226
@configuration(repos = [Isabelle], deps = [(HOL, [0])])
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   227
def Mutabelle_Set(*args):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   228
    """Mutabelle regression suite on Set theory"""
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   229
    return invoke_mutabelle('Set', *args)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   230
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   231
@configuration(repos = [Isabelle], deps = [(HOL, [0])])
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   232
def Mutabelle_Map(*args):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   233
    """Mutabelle regression suite on Map theory"""
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   234
    return invoke_mutabelle('Map', *args)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   235
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   236
@configuration(repos = [Isabelle], deps = [(HOL, [0])])
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   237
def Mutabelle_Divides(*args):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   238
    """Mutabelle regression suite on Divides theory"""
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   239
    return invoke_mutabelle('Divides', *args)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   240
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   241
@configuration(repos = [Isabelle], deps = [(HOL, [0])])
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   242
def Mutabelle_MacLaurin(*args):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   243
    """Mutabelle regression suite on MacLaurin theory"""
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   244
    return invoke_mutabelle('MacLaurin', *args)
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   245
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   246
@configuration(repos = [Isabelle], deps = [(HOL, [0])])
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   247
def Mutabelle_Fun(*args):
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   248
    """Mutabelle regression suite on Fun theory"""
a5478b1c8b8a configuration file for mira
haftmann
parents:
diff changeset
   249
    return invoke_mutabelle('Fun', *args)