Example #1
0
    def do_checks (eqs):
        checks = (linear_eq_induct_step_checks (p, restrs, hyps, tag, split, eqs)
            + linear_eq_induct_base_checks (p, restrs, hyps, tag, split, eqs))

        groups = check.proof_check_groups (checks)
        for group in groups:
            (res, _) = check.test_hyp_group (rep, group)
            if not res:
                return False
        return True
Example #2
0
    def do_checks(eqs_assume, eqs):
        checks = (check.single_loop_induct_step_checks(
            p, restrs, hyps, tag, split, 1, eqs, eqs_assume=eqs_assume) +
                  check.single_loop_induct_base_checks(p, restrs, hyps, tag,
                                                       split, 1, eqs))

        groups = check.proof_check_groups(checks)
        for group in groups:
            (res, _) = check.test_hyp_group(rep, group)
            if not res:
                return False
        return True
Example #3
0
def proof_failed_groups(p=None, proof=None):
    if p == None:
        p = problem.last_problem[0]
    if proof == None:
        proof = search.last_proof[0]
    checks = check.proof_checks(p, proof)
    groups = check.proof_check_groups(checks)
    failed = []
    for group in groups:
        rep = rep_graph.mk_graph_slice(p)
        (res, el) = check.test_hyp_group(rep, group)
        if not res:
            failed.append(group)
            print "Failed element: %s" % el
    failed_nms = set([s for group in failed for (_, _, s) in group])
    print "Failed: %s" % failed_nms
    return failed
Example #4
0
def proof_failed_groups(p=None, proof=None):
    if p == None:
        p = problem.last_problem[0]
    if proof == None:
        proof = search.last_proof[0]
    checks = check.proof_checks(p, proof)
    groups = check.proof_check_groups(checks)
    failed = []
    for group in groups:
        rep = rep_graph.mk_graph_slice(p)
        (res, el) = check.test_hyp_group(rep, group)
        if not res:
            failed.append(group)
            print 'Failed element: %s' % el
    failed_nms = set([s for group in failed for (_, _, s) in group])
    print 'Failed: %s' % failed_nms
    return failed
Example #5
0
    rep = rep_graph.mk_graph_slice(p)
    i_seq_opts = [(0, 1), (1, 1), (2, 1)]
    j_seq_opts = [(0, 1), (0, 2), (1, 1)]
    tags = [p.node_tags[asm_split][0], c_tag]
    try:
        split = search.find_split(rep, asm_split, restrs, hyps, i_seq_opts, j_seq_opts, 5, tags=[asm_tag, c_tag])
    except solver.SolverFailure, e:
        return None
    if not split or split[0] != "Split":
        trace("no split found (%s)." % repr(split))
        return None
    (_, split) = split
    rep = rep_graph.mk_graph_slice(p)
    checks = check.split_checks(p, (), hyps, split, tags=[asm_tag, c_tag])
    groups = check.proof_check_groups(checks)
    try:
        for group in groups:
            (res, el) = check.test_hyp_group(rep, group)
            if not res:
                trace("split check failed!")
                trace("failed at %s" % el)
                return None
    except solver.SolverFailure, e:
        return None
    (as_details, c_details, _, n, _) = split
    (c_split, (seq_start, step), _) = c_details
    c_bound = dict(c_bounds).get(p.loop_id(c_split))
    if not c_bound:
        trace("key split was not bounded (%r, %r)." % (c_split, c_bounds))
        return None
Example #6
0
                               asm_split,
                               restrs,
                               hyps,
                               i_seq_opts,
                               j_seq_opts,
                               5,
                               tags=[asm_tag, c_tag])
 except solver.SolverFailure, e:
     return None
 if not split or split[0] != 'Split':
     trace('no split found (%s).' % repr(split))
     return None
 (_, split) = split
 rep = rep_graph.mk_graph_slice(p)
 checks = check.split_checks(p, (), hyps, split, tags=[asm_tag, c_tag])
 groups = check.proof_check_groups(checks)
 try:
     for group in groups:
         (res, el) = check.test_hyp_group(rep, group)
         if not res:
             trace('split check failed!')
             trace('failed at %s' % el)
             return None
 except solver.SolverFailure, e:
     return None
 (as_details, c_details, _, n, _) = split
 (c_split, (seq_start, step), _) = c_details
 c_bound = dict(c_bounds).get(p.loop_id(c_split))
 if not c_bound:
     trace('key split was not bounded (%r, %r).' % (c_split, c_bounds))
     return None