if not os.path.isfile(os.path.join(cpath,args.cfile)): print(UP.cfile_not_found_err_msg(cpath,args.cfile)) exit(1) sempath = os.path.join(cpath,'semantics') if not os.path.isdir(sempath): print(UP.semantics_not_found_err_msg(cpath)) exit(1) cfapp = CApplication(sempath,args.cfile) cfile = cfapp.get_cfile() if not cfile.has_function_by_name(args.cfunction): print(UP.cfunction_not_found_err_sg(cpath,args.cfile,args.cfunction)) exit(1) cfunction = cfile.get_function_by_name(args.cfunction) if args.open: print(RP.function_code_open_tostring(cfunction)) elif args.violations: print(RP.function_code_violation_tostring(cfunction)) elif args.predicate: print(RP.function_code_predicate_tostring(cfunction,args.predicate)) else: print(RP.function_code_tostring(cfunction)) print(RP.function_proofobligation_stats_tostring(cfunction))
if not os.path.isdir(cpath): print(UP.cpath_not_found_err_msg(cpath)) exit(1) sempath = os.path.join(cpath, 'semantics') if not os.path.isdir(sempath): print(UP.semantics_not_found_err_msg(cpath)) exit(1) cfapp = CApplication(sempath, args.cfile) cfile = cfapp.get_cfile() if not cfile.has_function_by_name(args.cfunction): print(UP.cfunction_not_found_err_msg(cpath, args.cfile, args.cfunction)) exit(1) cfunction = cfile.get_function_by_name(args.cfunction) dc = ['deadcode'] if args.open: print(RP.function_code_open_tostring(cfunction)) else: print(RP.function_code_tostring(cfunction)) print( RP.function_proofobligation_stats_tostring(cfunction, extradsmethods=dc))