Download reusable_components_..

Transcript
DESCRIPTION OF LIBRARY MACHINES
65
CUT SEQ RGE
syntax
CUT SEQ RGE (range, nn)
preconditions range must belong to the LSR minrge..LSR maxrge range, nn must be
in NAT.
Clears the sequence of its first nn elements. For nn = size(seq rge(range)), this operation
is equivalent to CLR SEQ RGE.
PART SEQ RGE
syntax
PART SEQ RGE (range, ii, jj)
preconditions range must belong to the LSR minrge..LSR maxrge range, ii and jj must
be NATs that are not null, with ii ≤ jj.
In a sequence, only retains the indexes between two limits. ii..jj may not be in the sequence
domain.
REV SEQ RGE
syntax
REV SEQ RGE (range)
preconditions range must belong to the LSR minrge..LSR maxrge range.
Reverses the order of the elements in a sequence.
FIND FIRST SEQ RGE
syntax
bb, ii ← FIND FIRST SEQ RGE (range, vv)
preconditions range must belong t the LSR minrge..LSR maxrge range, vv must be in
LSR VALUE.
outputs
bb is TRUE if vv is in the range position sequence, FALSE if not. ii is a
NAT, if bb = TRUE, it indicates the first position that equals vv in the
sequence.
Searches for a value in a sequence starting from the beginning.
FIND LAST SEQ RGE
syntax
bb, ii ← FIND LAST SEQ RGE (range, vv)
preconditions range must belong to the LSR minrge..LSR maxrge range, vv must be
in LSR VALUE.
outputs
bb is TRUE if vv is in the range position sequence, FALSE if not. ii is
a NAT; if bb = TRUE, this indicates the last position that equals vv in
the sequence.
Searches for a value in a sequence, starting from the end.
COP SEQ RGE
syntax
COP SEQ RGE (dst, src)
preconditions dst and src must belong to the LSR minrge..LSR maxrge range.
Copy the seq rge(src) sequence to the seq rge(dst) sequence.