Module FiniteSets

Finiteness of sets and maps, applied when a counterexample needs it

Sets and maps are finite, but they are encoded as arrays, which may be infinite. The difference only shows in a counterexample to a property whose cone of influence has a quantifier observing a container of an infinite element type (see LustreTypeChecker.finite_risk_types). The containers of those types are compiled with constraints that make them finite (see LustreNode.t.finite_constraints), which cost the solvers, and that a proof does not need: the encoding without them has more behaviors than the model, so what holds of the one holds of the other.

A system is therefore first built without them. A counterexample found on it, to a property whose cone of influence they would constrain, may rely on an infinite container: it is held back, and checked on the system with the constraints, sliced to the property, for one with the same inputs, which is reported instead if found in time. Otherwise the engines run again on the system built with the constraints, with what they had established carried over (see InvarManager and Kind2Flow); this is not an analysis of its own. From then on, every system built for the same top system has them.

This module keeps the top systems whose systems have the constraints, the systems that were built without some, and the request made by a counterexample in the analysis under way.

val enabled : Scope.t -> bool

Whether the systems built for the top system top have the finiteness constraints of their containers

val enable : Scope.t -> unit

Give the finiteness constraints of their containers to the systems built from now on for the top system top

val with_enabled : (unit -> 'a) -> 'a

with_enabled f is f (), where the systems built in the calling domain have the finiteness constraints whatever their top system: for the check of a counterexample found without them

val start_round : unit -> unit

Forget the request, and the time spent checking counterexamples: the engines are about to run on a system

val within_check_budget : unit -> bool

Whether the counterexamples of the round may still be checked on the system with the finiteness constraints, rather than the engines running again on it

val spent_checking : float -> unit

Count the time spent checking a counterexample on the system with the finiteness constraints

val check_timeout : int

The time limit of the solver checking a counterexample, in seconds

val request : unit -> unit

Request that the engines run again on the system built with the finiteness constraints, for the counterexample to a property that may rely on an infinite container

val requested : unit -> bool

Whether a counterexample requested the finiteness constraints in the round under way