Prolog Language Monotonicity Reasoning about monotonic predicates

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

Monotonic predicates can be debugged by applying declarative reasoning.

In pure Prolog, a programming mistake can lead to one or all of the following phenomena:

  1. the predicate incorrectly succeeds in a case where it should fail
  2. the predicate incorrectly fails in a case where it should succeed
  3. the predicate unexpectedly loops where it should only produce a finite set of answers.

As an example, consider how we can debug case (2) by declarative reasoning: We can systematically remove goals of the predicate's clauses and see if the query still fails. In monotonic code, removing goals can at most make the resulting program more general. Hence, we can pinpoint errors by seeing which of the goals leads to the unexpected failure.



Got any Prolog Language Question?