Forlan Manual

The ProdSet Module


signature PROD_SET
structure ProdSet :> PROD_SET

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


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


memb(prod, prods)
tests whether prod is a member of prods.

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


subset(prod1s, prod2s)
tests whether prod1s is a subset of prod2s.

equal(prod1s, prod2s)
tests whether prod1s is equal to prod2s.

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

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

union(prod1s, prod2s)
returns the union of prod1s and prod2s.

genUnion prodss
returns the generalized union of prodss.

inter(prod1s, prod2s)
returns the intersection of prod1s and prod2s.

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

minus(prod1s, prod2s)
returns the difference of prod1s and prod2s.

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

fromString s
inputs a set of productions from s.

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

toPP prods
returns a pretty-printing expression for prods.

toString prods
pretty-prints prods to a string.

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

[ Top | Parent | Root | Contents | Index ]

Forlan Version 4.12
Copyright © 2019 Alley Stoughton