Lists of numbers

Author(s): The Ciao Development Team.

This module implements some kinds of lists of numbers.

Usage and interface

Documentation on exports

PREDICATEget_primes/2

Usage:get_primes(N,Primes)

Computes the Nth first prime numbers in ascending order.

  • The following properties should hold at call time:
    (basic_props:int/1)N is an integer.
  • The following properties should hold upon exit:
    (numlists:intlist/1)Primes is a list of integers.

REGTYPEintlist/1

Usage:intlist(X)

X is a list of integers.

    REGTYPEnumlist/1

    Usage:numlist(X)

    X is a list of numbers.

      PREDICATEsum_list/2

      Usage:sum_list(List,N)

      N is the total sum of the elements of List.

      • The following properties should hold at call time:
        (numlists:numlist/1)List is a list of numbers.
      • The following properties should hold upon exit:
        (basic_props:num/1)N is a number.

      PREDICATEsum_list/3

      Usage:sum_list(List,N0,N)

      N is the total sum of the elements of List plus N0.

      Usage:sum_list_of_lists(Lists,N)

      N is the total sum of the elements of the lists of Lists.

      • The following properties should hold at call time:
        (basic_props:list/2)List is a list of numlists.
      • The following properties should hold upon exit:
        (basic_props:num/1)N is a number.

      Usage:sum_list_of_lists(Lists,N0,N)

      N is the total sum of the elements of the lists of Lists plus N0.

      Documentation on imports

      This module has the following direct dependencies: