☰

*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 lpdoc Documentation Generator »

- The Ciao assertion language »

- 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:*

(`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:*

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

(`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.

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:*

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

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

(`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:*

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

PROPERTYsolutions/2

*Internal (engine) modules:*`term_basic`,`arithmetic`,`atomic_basic`,`basiccontrol`,`exceptions`,`term_compare`,`term_typing`,`debugger_support`,`basic_props`.*Packages:*`prelude`,`initial`,`condcomp`,`assertions`,`assertions/assertions_basic`,`regtypes`.

Generated with LPdoc using Ciao