The new update implements Prova guards on literals. Let's start with an example. Imagine that during unification, the target rule matches the source literal but we do not want to proceed with further evaluation unless a "guard" condition evaluates to true. The guards are specified in a syntax that is similar to the one used in Erlang (using brackets instead of the 'when' keyword) but the semantics are more appropriate for a rule language like Prova. See rules/reloaded/guard.prova and ProvaMetadataTest.java.
@author(dev1) r1(X):-q(X). @author(dev22) r2(X):-q(X).
The old Prova version had an interesting but somewhat patchy approach to run-time processing of the rule metadata. The new rewrite is aiming to improve on this. The first question is what to annotate with metadata? It is clear that all Prova clauses (rules and facts) should be allowed to carry metadata. As you'll see below, I also annotate body literals so that whenever unification occurs, it uses metadata matching if metadata is present on the body literal.
The examples below are taken from a new test rules/reloaded/label.prova. This is the way metadata is added to rules: