|
|
1.1 root 1: .so tmac.ilib
2: .TH CSGEN 1 "The University of Arizona \- 6/28/83"
3: .SH NAME
4: csgen \- context-sensitive sentences
5: .SH SYNOPSIS
6: \f3csgen\fP [\f3\-t\fR]
7: .SH DESCRIPTION
8: \fICsgen\fR accepts a context sensitive production grammar from standard
9: input and generates randomly selected sentences from the corresponding
10: language.
11: .PP
12: Uppercase letters stand for nonterminal symbols, \*M\->\fR indicates the
13: lefthand side can be rewritten by the righthand side. Other characters
14: are considered to be terminal symbols. Lines beginning with \*M#\fR
15: are considered to be comments and are ignored.
16: A line consisting of a nonterminal symbol followed by a colon and
17: a nonnegative integer \*Mi\fR is a generation specification for \fIi\fR
18: instances of sentences for the language defined by the nonterminal
19: (goal) symbol.
20: An example is:
21: .DS
22: # a(n)b(n)c(n)
23: # Salomaa, p. 11. Attributed to M. Soittola.
24: #
25: X
26: X\->abc
27: X\->aYbc
28: Yb\->bY
29: Yc\->Zbcc
30: bZ\->Zb
31: aZ\->aaY
32: aZ\->aa
33: X:10
34: .DE
35: A positive integer followed by a colon can be prefixed to a production
36: to replicate that production, making its selection more likely. For
37: example,
38: .DS
39: 3:X\->abc
40: .DE
41: is equivalent to
42: .DS
43: X\->abc
44: X\->abc
45: X\->abc
46: .DE
47: .PP
48: The \f3\-t\fR option writes a trace of the derivations to standard
49: error output.
50: .SH LIMITATIONS
51: Nonterminal symbols can only be represented by single uppercase letters
52: and there is no way to represent uppercase terminal symbols.
53: .PP
54: There can be only one generation specification and it must appear as
55: the last line of input.
56: .PP
57: Generation of context-sensitive strings is a slow process. It may not
58: terminate, either because of a loop in the rewriting rules of the
59: grammar or because of the progressive accumulation of nonterminal symbols. \fICsgen\fR,
60: however, avoids deadlock, in which there are no possible rewrites for
61: a string in the derivation.
62: .bp
63: .SH SEE ALSO
64: Salomaa, Arto. \fIFormal Languages\fR, Academic Press, New York, 1973.
65: .SH AUTHOR
66: Ralph E. Griswold
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.