ATSLIB/libats/fundeque_fngtree

This package implements a functional deque (double-ended queue) based on the so-called finger-tree structure.
  • deque
  • deque_type
  • Deque
  • lemma_deque_param
  • fundeque_nil
  • fundeque_cons
  • fundeque_uncons
  • fundeque_snoc
  • fundeque_unsnoc
  • fundeque_is_nil
  • fundeque_is_cons
  • fundeque_size
  • fundeque_get_atbeg
  • fundeque_get_atend
  • fundeque_append
  • fprint_fundeque
  • fprint_fundeque$sep
  • fundeque_foreach$fwork
  • fundeque_foreach
  • fundeque_foreach_env
  • fundeque_rforeach$fwork
  • fundeque_rforeach
  • fundeque_rforeach_env

  • deque

    Synopsis

    stadef deque = deque_type
    typedef deque(a:t0p) = [n:int] deque(a, n)

    deque_type

    Synopsis

    abstype
    deque_type
    (elt:t@ype+, n:int) = ptr

    Deque

    Synopsis

    typedef Deque(a:t0p) = [n:int] deque(a, n)

    lemma_deque_param

    Synopsis

    prfun
    lemma_deque_param
      {a:t0p}{n:int} (xs: deque(INV(a), n)): [n >= 0] void

    fundeque_nil

    Synopsis

    fun{}
    fundeque_nil{a:t0p} ():<> deque(a, 0)

    Description

    This function creates an empty deque.

    fundeque_cons

    Synopsis

    fun
    {a:t0p}
    fundeque_cons{n:int}
      (x: a, xs: deque(INV(a), n)):<> deque(a, n+1)

    Description

    This function adds an element to the front-end of a given deque.

    fundeque_uncons

    Synopsis

    fun
    {a:t0p}
    fundeque_uncons{n:pos}
      (xs: &deque(INV(a), n) >> deque(a, n-1)):<!wrt> (a)

    Description

    This function does the opposite of what fundeque_cons does.

    fundeque_snoc

    Synopsis

    fun
    {a:t0p}
    fundeque_snoc{n:int}
      (xs: deque(INV(a), n), x: a):<> deque(a, n+1)

    Description

    This function adds an element to the rear-end of a given deque.

    fundeque_unsnoc

    Synopsis

    fun
    {a:t0p}
    fundeque_unsnoc{n:pos}
      (xs: &deque(INV(a), n) >> deque(a, n-1)):<!wrt> (a)

    Description

    This function does the opposite of what fundeque_unsnoc does.

    fundeque_is_nil

    Synopsis

    fun{}
    fundeque_is_nil
      {a:t0p}{n:int}(xs: deque(INV(a), n)):<> bool(n==0)

    Description

    This function test whether a given dequen is empty.

    fundeque_is_cons

    Synopsis

    fun{}
    fundeque_is_cons
      {a:t0p}{n:int}(xs: deque(INV(a), n)):<> bool(n > 0)

    Description

    This function test whether a given dequen is non-empty.

    fundeque_size

    Synopsis

    fun
    {a:t0p}
    fundeque_size
      {n:int}(xs: deque(INV(a), n)):<> size_t(n)

    Description

    This function returns the number of elements contained in a given deque.

    fundeque_get_atbeg

    Synopsis

    fun
    {a:t0p}
    fundeque_get_atbeg{n:pos}(xs: deque(INV(a), n)):<> (a)

    Description

    This function returns the first element of a given non-empty deque.

    fundeque_get_atend

    Synopsis

    fun
    {a:t0p}
    fundeque_get_atend{n:pos}(xs: deque(INV(a), n)):<> (a)

    Description

    This function returns the last element of a given non-empty deque.

    fundeque_append

    Synopsis

    fun
    {a:t0p}
    fundeque_append
      {n1,n2:int}
      (deque(INV(a), n1), deque(a, n2)):<> deque(a, n1+n2)

    fprint_fundeque

    Synopsis

    fun{a:t0p}
    fprint_fundeque
      (out: FILEref, xs: Deque(INV(a))): void

    fprint_fundeque$sep

    Synopsis

    fun{}
    fprint_fundeque$sep(out: FILEref): void

    fundeque_foreach$fwork

    Synopsis

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

    fundeque_foreach

    Synopsis

    fun
    {a:t0p}
    fundeque_foreach(xs: Deque(INV(a))): void

    fundeque_foreach_env

    Synopsis

    fun
    {a:t0p}
    {env:vt0p}
    fundeque_foreach_env(xs: Deque(INV(a)), env: &(env)>>_): void

    fundeque_rforeach$fwork

    Synopsis

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

    fundeque_rforeach

    Synopsis

    fun
    {a:t0p}
    fundeque_rforeach(xs: Deque(INV(a))): void

    fundeque_rforeach_env

    Synopsis

    fun
    {a:t0p}
    {env:vt0p}
    fundeque_rforeach_env(xs: Deque(INV(a)), env: &(env)>>_): void

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