@@ -396,7 +396,7 @@ case class DomainFuncApp(funcname: String, args: Seq[Exp], typVarMap: Map[TypeVa
396396 // Strangely, the copy method is not a member of the DomainFuncApp case class,
397397 // therefore, We need this method that does the copying manually
398398 def copy (funcname : String = this .funcname, args : Seq [Exp ] = this .args, typVarMap : Map [TypeVar , Type ] = this .typVarMap): (Position , Info , Type , String , ErrorTrafo ) => DomainFuncApp = {
399- DomainFuncApp (this . funcname,args,typVarMap)
399+ DomainFuncApp (funcname,args,typVarMap)
400400 }
401401}
402402object DomainFuncApp {
@@ -410,7 +410,7 @@ case class BackendFuncApp(backendFunc: BackendFunc, args: Seq[Exp])
410410 (val pos : Position = NoPosition , val info : Info = NoInfo , val errT : ErrorTrafo = NoTrafos )
411411 extends AbstractDomainFuncApp {
412412 override lazy val check : Seq [ConsistencyError ] = args.flatMap(Consistency .checkPure)
413- override def func = (p : Program ) => backendFunc
413+ override def func = (_ : Program ) => backendFunc
414414 def funcname = backendFunc.name
415415 override def typ = backendFunc.typ
416416}
@@ -565,6 +565,7 @@ case class Forall(variables: Seq[LocalVarDecl], triggers: Seq[Trigger], exp: Exp
565565 // require(isValid, s"Invalid quantifier: { $this } .")
566566 override lazy val check : Seq [ConsistencyError ] =
567567 (if (! (exp isSubtype Bool )) Seq (ConsistencyError (s " Body of universal quantifier must be of Bool type, but found ${exp.typ}" , exp.pos)) else Seq ()) ++
568+ (if (variables.isEmpty) Seq (ConsistencyError (" Quantifier must have at least one quantified variable." , pos)) else Seq ()) ++
568569 Consistency .checkAllVarsMentionedInTriggers(variables, triggers) ++
569570 checkNoNestedQuantsForQuantPermissions ++
570571 checkQuantifiedPermission
@@ -631,7 +632,8 @@ case class Forall(variables: Seq[LocalVarDecl], triggers: Seq[Trigger], exp: Exp
631632/** Existential quantification. */
632633case class Exists (variables : Seq [LocalVarDecl ], triggers : Seq [Trigger ], exp : Exp )(val pos : Position = NoPosition , val info : Info = NoInfo , val errT : ErrorTrafo = NoTrafos ) extends QuantifiedExp {
633634 override lazy val check : Seq [ConsistencyError ] = Consistency .checkPure(exp) ++
634- (if (! (exp isSubtype Bool )) Seq (ConsistencyError (s " Body of existential quantifier must be of Bool type, but found ${exp.typ}" , exp.pos)) else Seq ())
635+ (if (! (exp isSubtype Bool )) Seq (ConsistencyError (s " Body of existential quantifier must be of Bool type, but found ${exp.typ}" , exp.pos)) else Seq ()) ++
636+ (if (variables.isEmpty) Seq (ConsistencyError (" Quantifier must have at least one quantified variable." , pos)) else Seq ())
635637
636638 /** Returns an identical forall quantification that has some automatically generated triggers
637639 * if necessary and possible.
0 commit comments