☰

*ON THIS PAGE*# Properties related to cardinality and exact solutions

These properties are part of the `native_props` library.

## Usage and interface

## Documentation on exports

*Meta-predicate* with arguments: `cardinality(goal,?,?)`.

`relations(X,N)`
*Meta-predicate* with arguments: `relations(goal,?)`.

`finite_solutions(X)`
*Meta-predicate* with arguments: `finite_solutions(goal)`.

## Documentation on imports

This module has the following direct dependencies:

- The Ciao System »

- PART III - Assertions and auto-documentation »

- Properties which are native to analyzers »

**Properties related to cardinality and exact solutions**

**Library usage:**`:- use_module(library(assertions/native_props))`or also as a package

`:- use_package(nativeprops)`.Note the slightly different names of the library and the package.

**Exports:***Properties:*`cardinality/3`,`num_solutions/2`,`relations/2`,`finite_solutions/1`,`solutions/2`.

PROPERTYcardinality/3

Usage:`cardinality(Goal,Lower,Upper)`

Goal has a number of solutions between Lower and Upper.

*The following properties should hold globally:*

(`basic_props:no_rtcheck/1`)cardinality(Goal,Lower,Upper) is not checked during run-time checking.

PROPERTYnum_solutions/2

Usage 1:`num_solutions(X,N)`

Calls of the form X have N solutions, i.e., N is the cardinality of the solution set of X.

*If the following properties should hold at call time:*

(`basic_props:cgoal/1`)X is a term which represents a goal, i.e., an atom or a structure.

(`basic_props:int/1`)N is an integer.

Usage 2:`num_solutions(Goal,Check)`

For a call to Goal, `Check(X)` succeeds, where X is the number of solutions.

*If the following properties should hold at call time:*

(`basic_props:cgoal/1`)Goal is a term which represents a goal, i.e., an atom or a structure.

(`basic_props:cgoal/1`)Check is a term which represents a goal, i.e., an atom or a structure.

PROPERTYrelations/2

Calls of the form X produce N solutions, i.e., N is the cardinality of the solution set of X.

Usage:`relations(X,N)`

Goal X produces N solutions.

*If the following properties should hold at call time:*

(`basic_props:cgoal/1`)X is a term which represents a goal, i.e., an atom or a structure.

(`basic_props:int/1`)N is an integer.*then the following properties should hold globally:*

(`basic_props:rtcheck/2`)The runtime check of this property is unimplemented.

PROPERTYfinite_solutions/1

Calls of the form X produce a finite number of solutions [DLGH97].

Usage:`finite_solutions(X)`

All the calls of the form X have a finite number of solutions.

*The following properties should hold globally:*

(`basic_props:no_rtcheck/1`)finite_solutions(X) is not checked during run-time checking.

PROPERTYsolutions/2

Usage:`solutions(Goal,Sols)`

Goal Goal produces the solutions listed in Sols.

*If the following properties should hold at call time:*

(`basic_props:cgoal/1`)Goal is a term which represents a goal, i.e., an atom or a structure.

(`basic_props:list/1`)Sols is a list.

*Packages:*`prelude`,`initial`,`condcomp`,`assertions`,`assertions/assertions_basic`,`regtypes`.

Generated with LPdoc using Ciao