Special properties for testing

Author(s): Edison Mera, Pedro López, Manuel Hermenegildo.

This module defines special properties and commands to be used in test declarations. They are called in general “test commands”. that are random generators.

Documentation on exports

PROPERTY

(True) Usage:try_sols(G,N)

This test of G will be executed to get at most N solutions.

  • The following properties hold globally:
    (test_command/1)try_sols(G,N) is a test command.
Meta-predicate with arguments: try_sols(goal,?).

PROPERTY

(True) Usage:times(G,N)

This test of G should be repeated N times.

  • The following properties hold globally:
    (test_command/1)times(G,N) is a test command.
Meta-predicate with arguments: times(goal,?).

PROPERTY

Usage:near(A,B,Eps)

Verifies that abs(B - A)/(abs(B) + abs(A)) =< Eps.

    PROPERTY
    Not implemented yet.

    Usage:

    The predicate should write to the current error stream the specified string.

      PROPERTY
      Not implemented yet.

      Usage:

      The test should finish in less than the specified time. The time is given in milliseconds.

        PROPERTY

        (True) Usage:test_command(X)

        X is a test command.

        • The following properties hold globally:
          (sideff/2)test_command(X) is side-effect free.
        Meta-predicate with arguments: test_command(goal).

        PROPERTY

        Usage:

        Similar to the predicate random:random/3

          PROPERTY

          Usage:

          Similar to the predicate random:random/1

            PROPERTY

            Usage:

            Generates any floating point random number.

              PROPERTY

              Usage:

              Generates any floating point random number including special cases like infinite, nan or zero whith sign.