Forlan Manual


The VarSet Module


Synopsis

signature VAR_SET
structure VarSet :> VAR_SET

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


Interface

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

Description

memb(var, vars)
tests whether var is a member of vars.

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

compare
is Set.compare Var.compare.

subset(var1s, var2s)
tests whether var1s is a subset of var2s.

equal(var1s, var2s)
tests whether var1s is equal to var2s.

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

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

union(var1s, var2s)
returns the union of var1s and var2s.

genUnion varss
returns the generalized union of varss.

inter(var1s, var2s)
returns the intersection of var1s and var2s.

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

minus(var1s, var2s)
returns the difference of var1s and var2s.

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

fromString s
inputs a set of variables from s.

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

toPP vars
returns a pretty-printing expression for vars.

toString vars
pretty-prints vars to a string.

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


[ Top | Parent | Root | Contents | Index ]

Forlan Version 4.15
Copyright © 2022 Alley Stoughton