예제 #1
0
파일: ivy_check.py 프로젝트: juanmaneo/ivy
def main():
    ivy.read_params()
    if len(sys.argv) != 2 or not sys.argv[1].endswith('ivy'):
        usage()
    with im.Module():
        isolate = ivy_compiler.isolate.get()
        ivy.source_file(sys.argv[1],ivy.open_read(sys.argv[1]),create_isolate=False)

        # If user specifies an isolate, check it. Else, if any isolates
        # are specificied in the file, check all, else check globally.

        if isolate != None:
            isolates = [isolate]
        else:
            isolates = sorted(list(im.module.isolates))
            if len(isolates) == 0:
                isolates = [None]

        for isolate in isolates:
            if len(im.module.isolates[isolate].verified()) == 0:
                continue # skip if nothing to verify
            with im.module.copy():
                ivy_isolate.create_isolate(isolate,ext='ext')
                ag = ivy_art.AnalysisGraph(initializer=ivy_alpha.alpha)
                with utl.ErrorPrinter():
                    with ivy_interp.EvalContext(check=False):
                        ag.execute_action('ext')
                        cex = ag.check_bounded_safety(ag.states[-1])
                        if cex is not None:
                            display_cex("safety failed",cex)
    print "OK"
예제 #2
0
파일: ivy_check.py 프로젝트: xornand/ivy
def main():
    ivy.read_params()
    if len(sys.argv) != 2 or not sys.argv[1].endswith('ivy'):
        usage()
    with im.Module():
        isolate = ivy_compiler.isolate.get()
        ivy.source_file(sys.argv[1],
                        ivy.open_read(sys.argv[1]),
                        create_isolate=False)

        # If user specifies an isolate, check it. Else, if any isolates
        # are specificied in the file, check all, else check globally.

        if isolate != None:
            isolates = [isolate]
        else:
            isolates = sorted(list(im.module.isolates))
            if len(isolates) == 0:
                isolates = [None]

        for isolate in isolates:
            if len(im.module.isolates[isolate].verified()) == 0:
                continue  # skip if nothing to verify
            with im.module.copy():
                ivy_isolate.create_isolate(isolate, ext='ext')
                ag = ivy_art.AnalysisGraph(initializer=ivy_alpha.alpha)
                with utl.ErrorPrinter():
                    with ivy_interp.EvalContext(check=False):
                        ag.execute_action('ext')
                        cex = ag.check_bounded_safety(ag.states[-1])
                        if cex is not None:
                            display_cex("safety failed", cex)
    print "OK"
예제 #3
0
파일: ivy_show.py 프로젝트: odedp/ivy
def main():
    ivy.read_params()
    iu.set_parameters({'show_compiled':'true'})
    if len(sys.argv) != 2 or not sys.argv[1].endswith('ivy'):
        usage()
    with im.Module():
        with utl.ErrorPrinter():
            ivy.source_file(sys.argv[1],ivy.open_read(sys.argv[1]),create_isolate=False)
            check_module()
예제 #4
0
def main():
    ivy.read_params()
    iu.set_parameters({'show_compiled': 'true'})
    if len(sys.argv) != 2 or not sys.argv[1].endswith('ivy'):
        usage()
    with im.Module():
        with utl.ErrorPrinter():
            ivy.source_file(sys.argv[1],
                            ivy.open_read(sys.argv[1]),
                            create_isolate=False)
            check_module()
예제 #5
0
파일: ivy_check.py 프로젝트: pbnj-io/ivy
    print msg
    if diagnose.get():
        ui.ui_main_loop(ag)
    exit(1)
    
def usage():
    print "usage: \n  {} file.ivy".format(sys.argv[0])
    sys.exit(1)

if __name__ == "__main__":
    ivy.read_params()
    if len(sys.argv) != 2 or not sys.argv[1].endswith('ivy'):
        usage()
    with im.Module():
        isolate = ivy_compiler.isolate.get()
        ivy.source_file(sys.argv[1],ivy.open_read(sys.argv[1]),create_isolate=False)

        # If user specifies an isolate, check it. Else, if any isolates
        # are specificied in the file, check all, else check globally.

        if isolate != None:
            isolates = [isolate]
        else:
            isolates = sorted(list(im.module.isolates))
            if len(isolates) == 0:
                isolates = [None]

        for isolate in isolates:
            if len(im.module.isolates[isolate].verified()) == 0:
                continue # skip if nothing to verify
            iu.dbg('isolate')