예제 #1
0
def verify_bpl(args):
    """Verify the Boogie source file with a back-end verifier."""

    if args.verifier == 'svcomp':
        verify_bpl_svcomp(args)
        return

    elif args.verifier == 'boogie' or args.modular:
        command = ["boogie"]
        command += [args.bpl_file]
        command += ["/nologo", "/noinfer", "/doModSetAnalysis"]
        command += ["/timeLimit:%s" % args.time_limit]
        command += ["/errorLimit:%s" % args.max_violations]
        if not args.modular:
            command += ["/loopUnroll:%d" % args.unroll]

    elif args.verifier == 'corral':
        command = ["corral"]
        command += [args.bpl_file]
        command += ["/tryCTrace", "/noTraceOnDisk", "/printDataValues:1"]
        command += ["/k:%d" % args.context_bound]
        command += ["/useProverEvaluate"]
        command += ["/timeLimit:%s" % args.time_limit]
        command += ["/cex:%s" % args.max_violations]
        command += ["/maxStaticLoopBound:%d" % args.loop_limit]
        command += ["/recursionBound:%d" % args.unroll]

    elif args.verifier == 'symbooglix':
        command = ['symbooglix']
        command += [args.bpl_file]
        command += ["--file-logging=0"]
        command += ["--entry-points=%s" % ",".join(args.entry_points)]
        command += ["--timeout=%d" % args.time_limit]
        command += ["--max-loop-depth=%d" % args.unroll]

    if (args.bit_precise or args.float) and args.verifier != 'symbooglix':
        x = "bopt:" if args.verifier != 'boogie' else ""
        command += ["/%sproverOpt:OPTIMIZE_FOR_BV=true" % x]
        command += ["/%sboolControlVC" % x]

    if args.verifier_options:
        command += args.verifier_options.split()

    verifier_output = try_command(command, timeout=args.time_limit)
    verifier_output = transform_out(args, verifier_output)
    result = verification_result(verifier_output)

    if args.smackd:
        print smackdOutput(verifier_output)

    elif result == 'verified':
        print results(args)[result]

    else:
        if result == 'error' or result == 'invalid-deref' or result == 'invalid-free' or result == 'invalid-memtrack' or result == 'overflow':
            error = error_trace(verifier_output, args)

            if args.error_file:
                with open(args.error_file, 'w') as f:
                    f.write(error)

            if not args.quiet:
                print error

            if args.replay:
                replay_error_trace(verifier_output, args)

        sys.exit(results(args)[result])
예제 #2
0
def verify_bpl(args):
    """Verify the Boogie source file with a back-end verifier."""

    if args.verifier == 'svcomp':
        verify_bpl_svcomp(args)
        return

    elif args.verifier == 'boogie':
        command = ["boogie"]
        command += [args.bpl_file]
        command += ["/nologo", "/noinfer", "/doModSetAnalysis"]
        command += ["/timeLimit:%s" % args.time_limit]
        command += ["/errorLimit:%s" % args.max_violations]
        command += ["/loopUnroll:%d" % args.unroll]

    elif args.verifier == 'corral':
        command = ["corral"]
        command += [args.bpl_file]
        command += ["/tryCTrace", "/noTraceOnDisk", "/printDataValues:1"]
        command += ["/k:%d" % args.context_bound]
        command += ["/useProverEvaluate"]
        command += ["/timeLimit:%s" % args.time_limit]
        command += ["/cex:%s" % args.max_violations]
        command += ["/maxStaticLoopBound:%d" % args.loop_limit]
        command += ["/recursionBound:%d" % args.unroll]

    else:
        # Duality!
        command = ["corral", args.bpl_file]
        command += [
            "/tryCTrace", "/noTraceOnDisk", "/useDuality",
            "/oldStratifiedInlining"
        ]
        command += ["/recursionBound:1073741824", "/k:1"]

    if args.bit_precise:
        x = "bopt:" if args.verifier != 'boogie' else ""
        command += ["/%sproverOpt:OPTIMIZE_FOR_BV=true" % x]
        command += ["/%sz3opt:smt.relevancy=0" % x]
        command += ["/%sz3opt:smt.bv.enable_int2bv=true" % x]
        command += ["/%sboolControlVC" % x]

    if args.verifier_options:
        command += args.verifier_options.split()

    verifier_output = try_command(command, timeout=args.time_limit)
    result = verification_result(verifier_output)

    if args.smackd:
        print smackdOutput(verifier_output)

    elif result == 'verified':
        print results(args)[result]

    else:
        if result == 'error':
            error = error_trace(verifier_output, args)

            if args.error_file:
                with open(args.error_file, 'w') as f:
                    f.write(error)

            if not args.quiet:
                print error

        sys.exit(results(args)[result])
예제 #3
0
파일: top.py 프로젝트: Guoanshisb/smack
def verify_bpl(args):
  """Verify the Boogie source file with a back-end verifier."""

  if args.verifier == 'svcomp':
    verify_bpl_svcomp(args)
    return

  elif args.verifier == 'boogie':
    command = ["boogie"]
    command += [args.bpl_file]
    command += ["/nologo", "/noinfer", "/doModSetAnalysis"]
    command += ["/timeLimit:%s" % args.time_limit]
    command += ["/errorLimit:%s" % args.max_violations]
    command += ["/loopUnroll:%d" % args.unroll]

  elif args.verifier == 'corral':
    command = ["corral"]
    command += [args.bpl_file]
    command += ["/tryCTrace", "/noTraceOnDisk", "/printDataValues:1"]
    command += ["/k:%d" % args.context_bound]
    command += ["/useProverEvaluate"]
    command += ["/timeLimit:%s" % args.time_limit]
    command += ["/cex:%s" % args.max_violations]
    command += ["/maxStaticLoopBound:%d" % args.loop_limit]
    command += ["/recursionBound:%d" % args.unroll]

  else:
    # Duality!
    command = ["corral", args.bpl_file]
    command += ["/tryCTrace", "/noTraceOnDisk", "/useDuality", "/oldStratifiedInlining"]
    command += ["/recursionBound:1073741824", "/k:1"]

  if args.bit_precise:
    x = "bopt:" if args.verifier != 'boogie' else ""
    command += ["/%sproverOpt:OPTIMIZE_FOR_BV=true" % x]
    command += ["/%sz3opt:smt.relevancy=0" % x]
    command += ["/%sz3opt:smt.bv.enable_int2bv=true" % x]
    command += ["/%sboolControlVC" % x]

  if args.verifier_options:
    command += args.verifier_options.split()

  verifier_output = try_command(command, timeout=args.time_limit)
  result = verification_result(verifier_output)

  if args.smackd:
    print smackdOutput(verifier_output)

  elif result == 'verified':
    print results(args)[result]

  else:
    if result == 'error':
      error = error_trace(verifier_output, args)

      if args.error_file:
        with open(args.error_file, 'w') as f:
          f.write(error)

      if not args.quiet:
        print error

    sys.exit(results(args)[result])
예제 #4
0
파일: top.py 프로젝트: smackers/smack
def verify_bpl(args):
  """Verify the Boogie source file with a back-end verifier."""

  if args.verifier == 'svcomp':
    verify_bpl_svcomp(args)
    return

  elif args.verifier == 'boogie' or args.modular:
    command = ["boogie"]
    command += [args.bpl_file]
    command += ["/nologo", "/noinfer", "/doModSetAnalysis"]
    command += ["/timeLimit:%s" % args.time_limit]
    command += ["/errorLimit:%s" % args.max_violations]
    if not args.modular:
      command += ["/loopUnroll:%d" % args.unroll]

  elif args.verifier == 'corral':
    command = ["corral"]
    command += [args.bpl_file]
    command += ["/tryCTrace", "/noTraceOnDisk", "/printDataValues:1"]
    command += ["/k:%d" % args.context_bound]
    command += ["/useProverEvaluate"]
    command += ["/timeLimit:%s" % args.time_limit]
    command += ["/cex:%s" % args.max_violations]
    command += ["/maxStaticLoopBound:%d" % args.loop_limit]
    command += ["/recursionBound:%d" % args.unroll]
	
  elif args.verifier == 'symbooglix':
    command = ['symbooglix']
    command += [args.bpl_file]
    command += ["--file-logging=0"]
    command += ["--entry-points=%s" % ",".join(args.entry_points)]
    command += ["--timeout=%d" % args.time_limit]
    command += ["--max-loop-depth=%d" % args.unroll]

  else:
    # Duality!
    command = ["corral", args.bpl_file]
    command += ["/tryCTrace", "/noTraceOnDisk", "/useDuality", "/oldStratifiedInlining"]
    command += ["/recursionBound:1073741824", "/k:1"]

  if (args.bit_precise or args.float) and args.verifier != 'symbooglix':
    x = "bopt:" if args.verifier != 'boogie' else ""
    command += ["/%sproverOpt:OPTIMIZE_FOR_BV=true" % x]
    command += ["/%sboolControlVC" % x]

  if args.verifier_options:
    command += args.verifier_options.split()

  verifier_output = try_command(command, timeout=args.time_limit)
  verifier_output = transform_out(args, verifier_output)
  result = verification_result(verifier_output)

  if args.smackd:
    print smackdOutput(verifier_output)

  elif result == 'verified':
    print results(args)[result]

  else:
    if result == 'error' or result == 'invalid-deref' or result == 'invalid-free' or result == 'invalid-memtrack' or result == 'overflow':
      error = error_trace(verifier_output, args)

      if args.error_file:
        with open(args.error_file, 'w') as f:
          f.write(error)

      if not args.quiet:
        print error

      if args.replay:
         replay_error_trace(verifier_output, args)

    sys.exit(results(args)[result])