예제 #1
0
def check_isolate():
    temporals = [p for p in im.module.labeled_props if p.temporal]
    mod = im.module
    if temporals:
        if len(temporals) > 1:
            raise IvyError(None,'multiple temporal properties in an isolate not supported yet')
        from ivy_l2s import l2s
        l2s(mod, temporals[0])
        mod.concept_spaces = []
        mod.update_conjs()
    ifc.check_fragment()
    with im.module.theory_context():
        summarize_isolate(mod)
        return
        check_properties()
        some_temporals = any(p.temporal for p in im.module.labeled_props)
        check_temporals()
        ag = ivy_art.AnalysisGraph(initializer=ivy_alpha.alpha)
        if im.module.initializers:
            cex = ag.check_bounded_safety(ag.states[0])
            if cex is not None:
                display_cex("safety failed in initializer",cex)
        with ivy_interp.EvalContext(check=False):
            initiation_checked = False
            if not some_temporals:
                check_conjectures('Initiation','These conjectures are false initially.',ag,ag.states[0])
                initiation_checked = True
            for actname in get_checked_actions():
                old_checked_assert = act.checked_assert.get()
                assertions = find_assertions(actname)
                if assertions and not initiation_checked:
                    check_conjectures('Initiation','These conjectures are false initially.',ag,ag.states[0])
                    initiation_checked = True
                print "trying {}...".format(actname)
                if act.checked_assert.get():
                    assertions = [a for a in assertions if a.lineno == act.checked_assert.get()]
                tried = set()
                for asn in assertions:
                    if asn.lineno not in tried:
                        tried.add(asn.lineno)
                        act.checked_assert.value = asn.lineno
                        print '{}: {}'.format(asn.lineno,asn)
                        ag.execute_action(actname,prestate=ag.states[0])
                        cex = ag.check_bounded_safety(ag.states[-1],bound=1)
                        if cex is not None:
                            display_cex("safety failed",cex)
                if initiation_checked:
                    print "checking consecution..."
                    ag.execute_action(actname,prestate=ag.states[0],abstractor=ivy_alpha.alpha)
                    check_conjectures('Consecution','These conjectures are not inductive.',ag,ag.states[-1])
                act.checked_assert.value = old_checked_assert
예제 #2
0
def print_isolate():
    temporals = [p for p in im.module.labeled_props if p.temporal]
    mod = im.module
    if temporals:
        if len(temporals) > 1:
            raise IvyError(
                None,
                'multiple temporal properties in an isolate not supported yet')
        from ivy_l2s import l2s
        l2s(mod, temporals[0])
        mod.concept_spaces = []
        mod.update_conjs()


#     ifc.check_fragment()
    print_module_vmt(mod)
예제 #3
0
def check_temporals():
    props = im.module.labeled_props
    proved = []
    for prop in props:
        if prop.temporal:
            from ivy_l2s import l2s
            mod = im.module.copy()
            mod.labeled_axioms.extend(proved)
            mod.labeled_props = []
            l2s(mod, prop)
            mod.concept_spaces = []
            mod.update_conjs()
            with mod:
                check_isolate()
        proved.append(prop)
    # filter out any temporal stuff from conjectures and concept spaces
    im.module.labeled_conjs = [x for x in im.module.labeled_conjs if not has_temporal_stuff(x.formula)]
    im.module.concept_spaces = [x for x in im.module.concept_spaces if not has_temporal_stuff(x[1])]