viperproject / silver

Definition of the Viper intermediate verification language.
Mozilla Public License 2.0
78 stars 40 forks source link

Allow domain axioms to use functions that have decreases clauses #802

Closed marcoeilers closed 2 months ago

marcoeilers commented 2 months ago

As discussed in https://github.com/viperproject/silicon/issues/847, we now allow domain axioms to refer to non-domain functions that don't have any preconditions. However, currently, decreases clauses may be parsed as preconditions, and thus Viper rejects axioms that refer to functions that have no real preconditions but do have a decreases clause.

This PR changes this behavior by ensuring that only preconditions with a requires-keyword are counted when checking if a function application inside an axiom is allowed. The reason we're checking for the presence of the requires-keyword and not the absence of a decreases-keyword or the presence of a decreases clause in the actual precondition expression is to avoid a dependency from Viper's type checker to the termination plugin.