WatForm / fortress

Fortress: Finite Model Finder for Many-Sorted First-Order Logic
MIT License
5 stars 0 forks source link

Miniscoping requires NNF #111

Closed nancyday closed 4 months ago

nancyday commented 4 months ago

fortress -i --compiler MaxUnboundedScopes -t 3600 expert-models/3zltn65gds66b6f4q3lvbtgdkb6snmuu-alloy/fullsub2_SameFinalStates.smttc

Gets error message:

Exception in thread "main" fortress.util.Errors$Internal$PreconditionError: Miniscoping requires NNF (implications, iff, distinct eliminated) at fortress.util.Errors$Internal$.preconditionFailed(Errors.scala:65) at fortress.operations.NormalForms$Miniscoping$$anonfun$1.applyOrElse(NormalForms.scala:150) at fortress.operations.NormalForms$Miniscoping$$anonfun$1.applyOrElse(NormalForms.scala:84) at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:35) This does not happen with the StandardCompiler (which I expect timesout), but I’m not sure why an unbound scope would trigger this?

From Ryan: Is it possible that the unbound scope resulted in an implication/iff/distinct not being eliminated?

ryandancy commented 4 months ago

This bug is caused by a combination of several factors:

As a quick fix you can replace line 19 in MaxUnboundedScopesTransformer with the following to preserve the scopes of builtin sorts like IntSort:

val new_scopes = scopes.filter { case (sort, scope) =>
    scope.isFixed() || sort.isBuiltin
}

(Note that even with this fix, the issue from #104 prevents fullsub2.als from working with -compiler MaxUnboundedScopes.)

I will figure out a better fix for the bug.