Lists of numbers

Author(s): The CLIP Group.

This module implements some kinds of lists of numbers.

Usage and interface

Documentation on exports

PREDICATE

Usage: get_primes(N,Primes)

  • Description: 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.

REGTYPE

Usage: intlist(X)

  • Description: X is a list of integers.

REGTYPE

Usage: numlist(X)

  • Description: X is a list of numbers.

PREDICATE

Usage: sum_list(List,N)

  • Description: 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.

PREDICATE

Usage: sum_list(List,N0,N)

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

PREDICATE

Usage: sum_list_of_lists(Lists,N)

  • Description: 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.

PREDICATE

Usage: sum_list_of_lists(Lists,N0,N)

  • Description: N is the total sum of the elements of the lists of Lists plus N0.
  • The following properties should hold at call time:
    (basic_props:list/2)List is a list of numlists.
    (basic_props:num/1)N0 is a number.
  • The following properties should hold upon exit:
    (basic_props:num/1)N is a number.