YAP 7.1.0
Exo Intervals

This package assumes you use exo-compilation, that is, that you loaded the pedicate using the exo option to load_files/2 , In this case, YAP includes a package for improved search on intervals of integers. More...

Detailed Description

This package assumes you use exo-compilation, that is, that you loaded the pedicate using the exo option to load_files/2 , In this case, YAP includes a package for improved search on intervals of integers.

The package is activated by udi declarations that state what is the argument of interest:

:- udi(diagnoses(exo_interval,?,?)).
:- load_files(db, [consult(exo)]).
load_files(+_Files_, +_Options_)

It is designed to optimise the following type of queries:

?- max(X, diagnoses(X, 9, Y), X).
?- min(X, diagnoses(X, 9, 36211117), X).
?- X min Y, min(X, diagnoses(X, 9, 36211117), X ), diagnoses(Y, 9, _).

The first argument gives the time, the second the patient, and the third the condition code The first query should find the last time the patient 9 had any code reported, the second looks for the first report of code 36211117, and the last searches for reports after this one All queries run in constant or log(n) time


Class Documentation

◆ max/2

class max/2

max( X, Vs)

First Argument is the greatest element of a list

  • lex_order( Vs) All elements must be ordered

The following predicates control search:

◆ max/1

class max/1

max(+ Expression)

Maximizes Expression within the current constraint store This is the same as computing the supremum and equating the expression to that supremum

◆ min/2

class min/2

min( X, Vs)

First Argument is the least element of a list

◆ min/1

class min/1

min(+ Expression)

Minimizes Expression within the current constraint store This is the same as computing the infimum and equation the expression to that infimum