Forlan Manual


The SymSet Module


Synopsis

signature SYM_SET
structure SymSet :> SYM_SET

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


Interface

val memb : Sym.sym * Sym.sym Set.set -> bool
val fromList : Sym.sym list -> Sym.sym Set.set
val compare : Sym.sym Set.set Sort.total_ordering
val subset : Sym.sym Set.set * Sym.sym Set.set -> bool
val equal : Sym.sym Set.set * Sym.sym Set.set -> bool
val map : ('a -> Sym.sym) -> 'a Set.set -> Sym.sym Set.set
val mapFromList : ('a -> Sym.sym) -> 'a list -> Sym.sym Set.set
val union : Sym.sym Set.set * Sym.sym Set.set -> Sym.sym Set.set
val genUnion : Sym.sym Set.set list -> Sym.sym Set.set
val inter : Sym.sym Set.set * Sym.sym Set.set -> Sym.sym Set.set
val genInter : Sym.sym Set.set list -> Sym.sym Set.set
val minus : Sym.sym Set.set * Sym.sym Set.set -> Sym.sym Set.set
val inputFromLabToks : (int * Lex.tok) list -> Sym.sym Set.set * (int * Lex.tok) list
val fromString : string -> Sym.sym Set.set
val input : string -> Sym.sym Set.set
val toPP : Sym.sym Set.set -> PP.pp
val toString : Sym.sym Set.set -> string
val output : string * Sym.sym Set.set -> unit

Description

memb(a, bs)
tests whether a is a member of bs.

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

compare
is Set.compare Sym.compare.

subset(bs, cs)
tests whether bs is a subset of cs.

equal(bs, cs)
tests whether bs is equal to cs.

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

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

union(bs, cs)
returns the union of bs and cs.

genUnion bss
returns the generalized union of bss.

inter(bs, cs)
returns the intersection of bs and cs.

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

minus(bs, cs)
returns the difference of bs and cs.

inputFromLabToks lts
tries to input a set of symbols from lts, consuming as much of lts as possible, and returning the pair of the set of symbols 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. If, after reading a symbol, the next element of the labeled token list is "," (Lex.Comma), then inputFromLabToks insists on reading another symbol, even if this results in failure.

fromString s
inputs a set of symbols from s.

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

toPP bs
returns a pretty-printing expression for bs.

toString bs
pretty-prints bs to a string.

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


[ Top | Parent | Root | Contents | Index ]

Forlan Version 4.15
Copyright © 2022 Alley Stoughton