123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191(******************************************************************************)(* *)(* The Alt-Ergo theorem prover *)(* Copyright (C) 2006-2013 *)(* *)(* Sylvain Conchon *)(* Evelyne Contejean *)(* *)(* Francois Bobot *)(* Mohamed Iguernelala *)(* Stephane Lescuyer *)(* Alain Mebsout *)(* *)(* CNRS - INRIA - Universite Paris Sud *)(* *)(* This file is distributed under the terms of the Apache Software *)(* License version 2.0 *)(* *)(* ------------------------------------------------------------------------ *)(* *)(* Alt-Ergo: The SMT Solver For Software Verification *)(* Copyright (C) 2013-2018 --- OCamlPro SAS *)(* *)(* This file is distributed under the terms of the Apache Software *)(* License version 2.0 *)(* *)(******************************************************************************)openFormattypeerror=|BitvExtractofint*int|BitvExtractRangeofint*int|ClashTypeofstring|ClashLabelofstring*string|ClashParamofstring|TypeDuplicateVarofstring|UnboundedVarofstring|UnknownTypeofstring|WrongArityofstring*int|SymbAlreadyDefinedofstring|SymbUndefinedofstring|NotAPropVarofstring|NotAPredicateofstring|UnificationofTy.t*Ty.t|ShouldBeApplyofstring|WrongNumberofArgsofstring|ShouldHaveTypeofTy.t*Ty.t|ShouldHaveTypeIntorRealofTy.t|ShouldHaveTypeIntofTy.t|ShouldHaveTypeBitvofTy.t|ArrayIndexShouldHaveTypeInt|ShouldHaveTypeArray|ShouldHaveTypeRecordofTy.t|ShouldBeARecord|ShouldHaveLabelofstring*string|NoLabelInTypeofHstring.t*Ty.t|ShouldHaveTypeProp|NoRecordTypeofHstring.t|DuplicateLabelofHstring.t|DuplicatePatternofstring|WrongLabelofHstring.t*Ty.t|WrongNumberOfLabels|Notrigger|CannotGeneralize|SyntaxError|ThExtErrorofstring|ThSemTriggerError|WrongDeclInTheory|ShouldBeADTofTy.t|MatchNotExhaustiveofHstring.tlist|MatchUnusedCasesofHstring.tlist|NotAdtConstrofstring*Ty.t(* this is a typing error *)exceptionErroroferror*Loc.t(* these two exception are used by the lexer and the parser *)exceptionLexical_errorofLoc.t*stringexceptionSyntax_errorofLoc.t*stringletreportfmt=function|BitvExtract(i,j)->fprintffmt"bitvector extraction malformed (%d>%d)"ij|BitvExtractRange(n,j)->fprintffmt"extraction out of range (%d>%d)"jn|ClashTypes->fprintffmt"the type %s is already defined"s|ClashParams->fprintffmt"parameter %s is bound twice"s|ClashLabel(s,t)->fprintffmt"the label %s already appears in type %s"st|CannotGeneralize->fprintffmt"cannot generalize the type of this expression"|TypeDuplicateVars->fprintffmt"duplicate type variable %s"s|UnboundedVars->fprintffmt"unbounded variable %s"s|UnknownTypes->fprintffmt"unknown type %s"s|WrongArity(s,n)->fprintffmt"the type %s has %d arguments"sn|SymbAlreadyDefineds->fprintffmt"the symbol %s is already defined"s|SymbUndefineds->fprintffmt"undefined symbol %s"s|NotAPropVars->fprintffmt"%s is not a propositional variable"s|NotAPredicates->fprintffmt"%s is not a predicate"s|Unification(t1,t2)->fprintffmt"%a and %a cannot be unified"Ty.printt1Ty.printt2|ShouldBeApplys->fprintffmt"%s is a function symbol, it should be apply"s|WrongNumberofArgss->fprintffmt"Wrong number of arguments when applying %s"s|ShouldHaveType(ty1,ty2)->fprintffmt"this expression has type %a but is here used with type %a"Ty.printty1Ty.printty2|ShouldHaveTypeBitvt->fprintffmt"this expression has type %a but it should be a bitvector"Ty.printt|ShouldHaveTypeIntorRealt->fprintffmt"this expression has type %a but it should have type int or real"Ty.printt|ShouldHaveTypeIntt->fprintffmt"this expression has type %a but it should have type int"Ty.printt|ShouldHaveTypeArray->fprintffmt"this expression should have type farray"|ShouldHaveTypeRecordt->fprintffmt"this expression has type %a but it should have a record type"Ty.printt|ShouldBeARecord->fprintffmt"this expression should have a record type"|ShouldHaveLabel(s,a)->fprintffmt"this expression has type %s which has no label %s"sa|NoLabelInType(lb,ty)->fprintffmt"no label %s in type %a"(Hstring.viewlb)Ty.printty|ShouldHaveTypeProp->fprintffmt"this expression should have type prop"|NoRecordTypes->fprintffmt"no record type has label %s"(Hstring.views)|DuplicateLabels->fprintffmt"label %s is defined several times"(Hstring.views)|DuplicatePatterns->fprintffmt"pattern %s is bound several times"s|WrongLabel(s,ty)->fprintffmt"wrong label %s in type %a"(Hstring.views)Ty.printty|WrongNumberOfLabels->fprintffmt"wrong number of labels"|ArrayIndexShouldHaveTypeInt->fprintffmt"index of arrays should hava type int"|Notrigger->fprintffmt"No trigger for this lemma"|SyntaxError->fprintffmt"syntax error"|ThExtErrors->fprintffmt"Theory extension %S not recognized"s|ThSemTriggerError->fprintffmt"Semantic triggers are only allowed inside Theories"|WrongDeclInTheory->fprintffmt"Currently, this kind of declarations are not allowed inside theories"|ShouldBeADTty->fprintffmt"%a is not an algebraic, a record or an enumeration datatype"Ty.printty|MatchNotExhaustivemissing->fprintffmt"Pattern-matching is not exhaustive. These cases are missing: %a"(Util.print_list~sep:" |"~pp:Hstring.print)missing|MatchUnusedCasesdead->fprintffmt"Pattern-matching contains unreachable cases. These cases are removed: %a"(Util.print_list~sep:" |"~pp:Hstring.print)dead|NotAdtConstr(lbl,ty)->fprintffmt"The symbol %s is not a constructor of the type %a"lblTy.printtyleterrorel=raise(Error(e,l))letwarningel=ifOptions.unsat_mode()thenFormat.fprintferr_formatter"; ";Loc.reporterr_formatterl;reporterr_formattere;Format.eprintf"@."