Forlan Manual


The StrSet Module


Synopsis

signature STR_SET
structure StrSet :> STR_SET

This module provides operations on finite sets of Forlan strings, i.e., values of type Str.str Set.set that are standard in the sense that they are compatible with Str.compare. All values of type Str.str Set.set will implicitly be assumed/required to be standard.


Interface

val memb : Str.str * Str.str Set.set -> bool
val fromList : Str.str list -> Str.str Set.set
val compare : Str.str Set.set Sort.total_ordering
val subset : Str.str Set.set * Str.str Set.set -> bool
val equal : Str.str Set.set * Str.str Set.set -> bool
val map : ('a -> Str.str) -> 'a Set.set -> Str.str Set.set
val mapFromList : ('a -> Str.str) -> 'a list -> Str.str Set.set
val union : Str.str Set.set * Str.str Set.set -> Str.str Set.set
val genUnion : Str.str Set.set list -> Str.str Set.set
val inter : Str.str Set.set * Str.str Set.set -> Str.str Set.set
val genInter : Str.str Set.set list -> Str.str Set.set
val minus : Str.str Set.set * Str.str Set.set -> Str.str Set.set
val inputFromLabToks : (int * Lex.tok) list -> Str.str Set.set * (int * Lex.tok) list
val fromString : string -> Str.str Set.set
val input : string -> Str.str Set.set
val toPP : Str.str Set.set -> PP.pp
val toString : Str.str Set.set -> string
val output : string * Str.str Set.set -> unit
val concat : Str.str Set.set * Str.str Set.set -> Str.str Set.set
val power : Str.str Set.set * int -> Str.str Set.set
val rev : Str.str Set.set -> Str.str Set.set
val prefixes : Str.str -> Str.str Set.set
val suffixes : Str.str -> Str.str Set.set
val substrings : Str.str -> Str.str Set.set
val prefix : Str.str Set.set -> Str.str Set.set
val suffix : Str.str Set.set -> Str.str Set.set
val substring : Str.str Set.set -> Str.str Set.set
val alphabet : Str.str Set.set -> Sym.sym Set.set
val renameAlphabet : Str.str Set.set * SymRel.sym_rel -> Str.str Set.set

Description

memb(x, ys)
tests whether x is a member of ys.

fromList xs
returns the set whose elements are the elements of xs.

compare
is Set.compare Str.compare.

subset(xs, ys)
tests whether xs is a subset of ys.

equal(xs, ys)
tests whether xs is equal to ys.

map f xs
If xs is compatible with a value cmp of type 'a Sort.total_ordering, then map returns the set of all Forlan strings f x such that x is a member of xs.

mapFromList f xs
returns the set of all Forlan strings f x such that x is a member of xs.

union(xs, ys)
returns the union of xs and ys.

genUnion xss
returns the generalized union of xss.

inter(xs, ys)
returns the intersection of xs and ys.

genInter xss
returns the generalized intersection of xss. Issues an error message if xss is empty.

minus(xs, ys)
returns the difference of xs and ys.

inputFromLabToks lts
tries to input a set of Forlan strings from lts, consuming as much of lts as possible, and returning the pair of the set of strings and the rest of lts. Issues an error message if it fails. Will only return the empty set if lts doesn't begin with a symbol or "%" (Lex.Perc).If, after reading a string, the next element of the labeled token list is "," (Lex.Comma), then inputFromLabToks insists on reading another string, even if this results in failure.

fromString s
inputs a set of string from s.

input fil
inputs a set of strings from the file fil.

toPP xs
returns a pretty-printing expression for xs.

toString xs
pretty-prints xs to a string.

output(fil, xs)
pretty-prints xs to file fil.

concat(xs, ys)
returns the concatentation of xs and ys.

power(xs, n)
raises xs to the power n. Issues an error message if n is negative.

rev xs
returns the reversal of xs.

prefixes x
returns the set of all prefixes of x.

suffixes x
returns the set of all suffixes of x.

substrings x
returns the set of all substrings of x.

prefix xs
returns the prefix closure of xs.

suffix xs
returns the suffix closure of xs. It is defined by
  fun suffix xs = rev(prefix(rev xs))


substring xs
returns the substring closure of xs. It is defined by
  fun substring xs = suffix(prefix xs)


alphabet xs
returns the alphabet of xs.

renameAlphabet xs
renames the alphabet of xs using the bijection rel. Issues an error message if rel is not a bijection from a superset of the alphabet of xs to some set.


[ Top | Parent | Root | Contents | Index ]

Forlan Version 4.15
Copyright © 2022 Alley Stoughton