示例#1
0
def verify_opt(opt, quiet=False, limit=500):
  logger = logging.getLogger('test_loops.verify')
  logger.info('checking %s', opt.name)

  if not quiet:
    print
    opt.dump()

  users_count = alive.countUsers(opt.src_bb)
  users = {}
  for k in opt.src.iterkeys():
    n_users = users_count.get(k)
    users[k] = [alive.get_users_var(k) != n_users] if n_users else []

  proofs = 0
  for types in opt.type_models():
    if limit and proofs >= limit:
      logger.warning('Hit limit while checking %s', opt.name)
      break
    alive.set_ptr_size(types)
    alive.fixupTypes(opt.src, types)
    alive.fixupTypes(opt.tgt, types)
    opt.pre.fixupTypes(types)

    alive.check_typed_opt(opt.pre, opt.src_bb, opt.src, opt.tgt_bb, opt.tgt,
      types, users)
    proofs += 1
    if not quiet:
      sys.stderr.write('\rDone: ' + str(proofs))

  if not quiet:
    sys.stderr.write('\n')
示例#2
0
def check_opt(opt):
  opt.dump()
  print

  users_count = alive.countUsers(opt.src_bb)
  users = {}
  for k in opt.src.iterkeys():
    n_users = users_count.get(k)
    users[k] = [alive.get_users_var(k) != n_users] if n_users else []

  proofs = 0
  for types in opt.type_models():
    set_ptr_size(types)
    fixupTypes(opt.src, types)
    fixupTypes(opt.tgt, types)
    opt.pre.fixupTypes(types)

    alive.check_typed_opt(opt.pre, opt.src_bb, opt.src, opt.tgt_bb, opt.tgt, 
      types, users)
    proofs += 1
    sys.stderr.write('\rDone: ' + str(proofs))
    #sys.stderr.flush()

  sys.stderr.write('\n')