ATSLIB/libats/linset_listord

This package implements linear sets based on ordered lists. Note that this implementation should only be used for handling sets that are relatively small (e.g., containing less than 100 elements).


  • set
  • set_vtype
  • compare_elt_elt
  • linset_nil
  • linset_make_nil
  • linset_sing
  • linset_make_sing
  • linset_make_list
  • linset_insert
  • linset_takeout
  • linset_takeout_opt
  • linset_remove
  • linset_getmax
  • linset_getmax_opt
  • linset_getmin
  • linset_getmin_opt
  • linset_takeoutmax
  • linset_takeoutmax_opt
  • linset_takeoutmin
  • linset_takeoutmin_opt
  • linset_foreach
  • linset_foreach_env
  • linset_foreach$fwork
  • linset_listize
  • linset_listize1
  • linset_node_vtype
  • mynode
  • mynode0
  • mynode1
  • linset_insert_ngc
  • linset_takeout_ngc
  • linset_takeoutmax_ngc
  • linset_takeoutmin_ngc

  • set

    Synopsis

    vtypedef set (a:t0p) = set_vtype (a)

    Description

    The type constructor set is a shorthand for set_vtype.

    set_vtype

    Synopsis

    absvtype set_vtype (a:t@ype+) = ptr

    Description

    Given a type T, the abstract viewtype set_vtype(T) is for a set storing elements of the type T. Note that set_vtype is co-variant in its type argument.

    compare_elt_elt

    Synopsis

    fun{a:t0p}
    compare_elt_elt (x1: a, x2: a):<> int

    Description

    This function is for comparing set elements.

    linset_nil

    Synopsis

    fun{} linset_nil{a:t0p} ():<> set(a)

    linset_make_nil

    Synopsis

    fun{} linset_make_nil{a:t0p} ():<> set(a)

    linset_sing

    Synopsis

    fun{a:t0p} linset_sing (x: a):<!wrt> set(a)

    linset_make_sing

    Synopsis

    fun{a:t0p} linset_make_sing (x: a):<!wrt> set(a)

    linset_make_list

    Synopsis

    fun{a:t0p}
    linset_make_list (xs: List(INV(a))):<!wrt> set(a)

    linset_insert

    Synopsis

    fun{a:t0p}
    linset_insert
      (xs: &set(INV(a)) >> _, x0: a):<!wrt> bool

    linset_takeout

    Synopsis

    fun{a:t0p}
    linset_takeout
    (
      &set(INV(a)) >> _, a, res: &(a?) >> opt(a, b)
    ) :<!wrt> #[b:bool] bool(b) // endfun

    linset_takeout_opt

    Synopsis

    fun{a:t0p}
    linset_takeout_opt (&set(INV(a)) >> _, a):<!wrt> Option_vt(a)

    linset_remove

    Synopsis

    fun{a:t0p}
    linset_remove
      (xs: &set(INV(a)) >> _, x0: a):<!wrt> bool

    linset_getmax

    Synopsis

    Synopsis for [linset_getmax] is unavailable.

    linset_getmax_opt

    Synopsis

    Synopsis for [linset_getmax_opt] is unavailable.

    linset_getmin

    Synopsis

    Synopsis for [linset_getmin] is unavailable.

    linset_getmin_opt

    Synopsis

    Synopsis for [linset_getmin_opt] is unavailable.

    linset_takeoutmax

    Synopsis

    fun{a:t0p}
    linset_takeoutmax
    (
      xs: &set(INV(a)) >> _, res: &a? >> opt(a, b)
    ) :<!wrt> #[b:bool] bool (b)

    linset_takeoutmax_opt

    Synopsis

    fun{a:t0p}
    linset_takeoutmax_opt (xs: &set(INV(a)) >> _):<!wrt> Option_vt(a)

    linset_takeoutmin

    Synopsis

    fun{a:t0p}
    linset_takeoutmin
    (
      xs: &set(INV(a)) >> _, res: &a? >> opt(a, b)
    ) :<!wrt> #[b:bool] bool (b)

    linset_takeoutmin_opt

    Synopsis

    fun{a:t0p}
    linset_takeoutmin_opt (xs: &set(INV(a)) >> _):<!wrt> Option_vt(a)

    linset_foreach

    Synopsis

    fun{a:t0p}
    linset_foreach (set: !set(INV(a))): void

    linset_foreach_env

    Synopsis

    fun{
    a:t0p}{env:vt0p
    } linset_foreach_env
      (set: !set(INV(a)), env: &(env) >> _): void

    linset_foreach$fwork

    Synopsis

    fun{
    a:t0p}{env:vt0p
    } linset_foreach$fwork
      (x: a, env: &(env) >> _): void

    linset_listize

    Synopsis

    fun{a:t0p}
    linset_listize (xs: set(INV(a))): List0_vt (a)

    linset_listize1

    Synopsis

    fun{a:t0p}
    linset_listize1 (xs: !set(INV(a))): List0_vt (a)

    linset_node_vtype

    Synopsis

    absvtype
    linset_node_vtype (a:t@ype+, l:addr) = ptr

    mynode

    Synopsis

    stadef mynode = linset_node_vtype
    vtypedef
    mynode (a:t0p) = [l:addr] mynode (a, l)

    mynode0

    Synopsis

    vtypedef
    mynode0 (a:t0p) = [l:addr | l >= null] mynode (a, l)

    mynode1

    Synopsis

    vtypedef
    mynode1 (a:t0p) = [l:addr | l >  null] mynode (a, l)

    linset_insert_ngc

    Synopsis

    fun{a:t0p}
    linset_insert_ngc
    (
      set: &set(INV(a)) >> _, nx0: mynode1 (a)
    ) :<!wrt> mynode0 (a) // endfun

    linset_takeout_ngc

    Synopsis

    fun{a:t0p}
    linset_takeout_ngc
      (set: &set(INV(a)) >> _, x0: a):<!wrt> mynode0 (a)

    linset_takeoutmax_ngc

    Synopsis

    fun{a:t0p}
    linset_takeoutmax_ngc
      (set: &set(INV(a)) >> _):<!wrt> mynode0 (a)

    linset_takeoutmin_ngc

    Synopsis

    fun{a:t0p}
    linset_takeoutmin_ngc
      (set: &set(INV(a)) >> _):<!wrt> mynode0 (a)

    This page is created with ATS by Hongwei Xi and also maintained by Hongwei Xi. SourceForge.net Logo