protocol

# numberlistp

> List of numbers protocol.

author:
  `Paulo Moura`
version:
  `1.3`
date:
  `2011/12/15`

compilation flags:
  `static`

(no dependencies on other files)

## Public interface

### product/2

> Calculates the product of all list numbers. Fails if the list is empty.

compilation flags:
  `static`
template:
  `product(List,Product)`
mode – number of proofs:
  `product(+list(number),-number) – zero_or_one`

### sum/2

> Calculates the sum of all list numbers. Returns the integer zero if the list is empty.

compilation flags:
  `static`
template:
  `sum(List,Sum)`
mode – number of proofs:
  `sum(+list(number),-number) – one`

### average/2

> Calculates the average (i.e. arithmetic mean) of a list of numbers. Fails if the list is empty.

compilation flags:
  `static`
template:
  `average(List,Average)`
mode – number of proofs:
  `average(+list(number),-float) – zero_or_one`

### euclidean_norm/2

> Calculates the Euclidean norm of a list of numbers. Fails if the list is empty.

compilation flags:
  `static`
template:
  `euclidean_norm(List,Norm)`
mode – number of proofs:
  `euclidean_norm(+list(number),-float) – zero_or_one`

### chebyshev_norm/2

> Calculates the Chebyshev norm of a list of numbers. Fails if the list is empty.

compilation flags:
  `static`
template:
  `chebyshev_norm(List,Norm)`
mode – number of proofs:
  `chebyshev_norm(+list(integer),-integer) – zero_or_one`
  `chebyshev_norm(+list(float),-float) – zero_or_one`

### manhattan_norm/2

> Calculates the Manhattan norm of a list of numbers. Fails if the list is empty.

compilation flags:
  `static`
template:
  `manhattan_norm(List,Norm)`
mode – number of proofs:
  `manhattan_norm(+list(integer),-integer) – zero_or_one`
  `manhattan_norm(+list(float),-float) – zero_or_one`

### euclidean_distance/3

> Calculates the Euclidean distance between two lists of numbers. Fails if the two lists are empty or not of the same length.

compilation flags:
  `static`
template:
  `euclidean_distance(List1,List2,Distance)`
mode – number of proofs:
  `euclidean_distance(+list(number),+list(number),-float) – zero_or_one`

### chebyshev_distance/3

> Calculates the Chebyshev distance between two lists of numbers. Fails if the two lists are empty or not of the same length.

compilation flags:
  `static`
template:
  `chebyshev_distance(List1,List2,Distance)`
mode – number of proofs:
  `chebyshev_distance(+list(integer),+list(integer),-integer) – zero_or_one`
  `chebyshev_distance(+list(float),+list(float),-float) – zero_or_one`

### manhattan_distance/3

> Calculates the Manhattan distance between two lists of numbers. Fails if the two lists are empty or not of the same length.

compilation flags:
  `static`
template:
  `manhattan_distance(List1,List2,Distance)`
mode – number of proofs:
  `manhattan_distance(+list(integer),+list(integer),-integer) – zero_or_one`
  `manhattan_distance(+list(float),+list(float),-float) – zero_or_one`

### scalar_product/3

> Calculates the scalar product of two lists of numbers. Fails if the two lists are empty or not of the same length.

compilation flags:
  `static`
template:
  `scalar_product(List1,List2,Product)`
mode – number of proofs:
  `scalar_product(+list(integer),+list(integer),-integer) – zero_or_one`
  `scalar_product(+list(float),+list(float),-float) – zero_or_one`

## Protected interface

(none)

## Private predicates

(none)

## Operators

### (none)

## Remarks

### (none)