Forlan Manual


The ProdSet Module


Synopsis

signature PROD_SET
structure ProdSet :> PROD_SET

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


Interface

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

Description

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

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

compare
is Set.compare Prod.compare.

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.15
Copyright © 2022 Alley Stoughton