An open API service indexing awesome lists of open source software.

https://github.com/aggstam/number-pairs

Simple Prolog procedure to detect number pairs in a list.
https://github.com/aggstam/number-pairs

prolog

Last synced: 7 months ago
JSON representation

Simple Prolog procedure to detect number pairs in a list.

Awesome Lists containing this project

README

          

# number-pairs

Detect all number pairs in a list based on a predefined relation between them.


In this example we assume we look for number pair where A = 3 * B.


Implementation requires *prolog* to be installed.

## Execution example
```
❯ swipl -s number_pairs.pl

?- find_pairs([5, 15, 20, 45], Pairs, Waste).
Pairs = [[5, 15], [15, 45]],
Waste = [20] .
```