Ejemplo n.º 1
0
def report_epr_error(unstrat, bad_interpreted):
    msg = "The verification condition is not in logic epr."
    for sorts, asts in unstrat:
        msg += "\n\nNote: the following functions form a cycle:\n"
        for a in asts:
            if isinstance(a, il.Symbol):
                msg += '  {}\n'.format(il.sym_decl_to_str(a))
            else:
                msg += '  {}\n'.format(iu.IvyError(a, "skolem function"))
    if bad_interpreted:
        msg += "\n\nNote: the following interpreted functions occur over variables:\n"
        for sym in bad_interpreted:
            msg += '  {}\n'.format(il.sym_decl_to_str(sym))

    raise iu.IvyError(None, msg)
Ejemplo n.º 2
0
def report_epr_error(unstrat,bad_interpreted):
    msg = "The verification condition is not in logic epr."
    for sorts,asts in unstrat:
        msg += "\n\nNote: the following functions form a cycle:\n"
        for a in asts:
            if isinstance(a,il.Symbol):
                msg += '  {}\n'.format(il.sym_decl_to_str(a))
            else:
                msg += '  {}\n'.format(iu.IvyError(a,"skolem function"))                
    if bad_interpreted:
        msg += "\n\nNote: the following interpreted functions occur over variables:\n"
        for sym in bad_interpreted:
            msg += '  {}\n'.format(il.sym_decl_to_str(sym))
            
    raise iu.IvyError(None,msg)
Ejemplo n.º 3
0
def report_error(logic,note,ast):
    msg = "The verification condition is not in logic {}{} because {}.".format(logic,note,il.reason())
    if il.reason() == "functions are not stratified":
        for sorts,asts in unstrat:
            msg += "\n\nNote: the following functions form a cycle:\n"
            for a in asts:
                if isinstance(a,il.Symbol):
                    msg += '  {}\n'.format(il.sym_decl_to_str(a))
                else:
                    msg += '  {}\n'.format(iu.IvyError(a,"quantifier alternation"))                
    raise iu.IvyError(ast,msg)
Ejemplo n.º 4
0
def report_error(logic,note,ast):
    msg = "The verification condition is not in logic {}{} because {}.".format(logic,note,il.reason())
    if il.reason() == "functions are not stratified":
        for sorts,asts in unstrat:
            msg += "\n\nNote: the following functions form a cycle:\n"
            for a in asts:
                if isinstance(a,il.Symbol):
                    msg += '  {}\n'.format(il.sym_decl_to_str(a))
                else:
                    msg += '  {}\n'.format(iu.IvyError(a,"quantifier alternation"))                
    raise iu.IvyError(ast,msg)
Ejemplo n.º 5
0
 def sub(thing,ind):
     indent(0,'{\n')
     for x in thing.prems():
         if isinstance(x,LabeledFormula):
             fmla = x.formula
             if isinstance(fmla,SchemaBody):
                 indent(ind+1,'property ' + ('[{}] '.format(x.label) if x.label is not None else ''))
                 sub(fmla,ind+1)
             else:
                 indent(ind+1,'property ' + str(x) + '\n')
         elif isinstance(x,ivy_logic.UninterpretedSort):
             indent(ind+1,'type ' + str(x) + '\n')
         else:
             foob = ivy_logic.sym_decl_to_str(x.args[0]) if isinstance(x.args[0],ivy_logic.Symbol) else str(x.args[0])
             indent(ind+1,foob + '\n')
     indent(ind+1,'property ' + str(thing.conc()) + '\n')
     indent(ind,'}\n')