aboutsummaryrefslogtreecommitdiff
path: root/gfsm/gfsm/src/programs/gfsmarith.gog
blob: b2f14b93dfeeb63571ac41de3df7bc540d3c8c23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# -*- Mode: Shell-Script -*-
#
# Getopt::Gen specification
#-----------------------------------------------------------------------------
program "gfsmarith"
#program_version "0.01"

purpose	"Perform an elementary arithmetic operation on automaton weights"
author  "Bryan Jurish <moocow@ling.uni-potsdam.de>"
on_reparse "warn"

#-----------------------------------------------------------------------------
# Details
#-----------------------------------------------------------------------------
details ""

#-----------------------------------------------------------------------------
# Files
#-----------------------------------------------------------------------------
#rcfile "/etc/gfsmrc"
#rcfile "~/.gfsmrc"

#-----------------------------------------------------------------------------
# Arguments
#-----------------------------------------------------------------------------
argument "FSMFILE" "Stored binary gfsm file" \
    details="
If unspecified, standard input will be read
"

#-----------------------------------------------------------------------------
# Options
#-----------------------------------------------------------------------------

#-------------------------------------------------------
# Basic Options

int "compress" z "Specify compression level of output file." \
    arg="LEVEL" \
    default="-1" \
    details="
Specify zlib compression level of output file. -1 (default) indicates
the default compression level, 0 (zero) indicates no zlib compression at all,
and 9 indicates the best possible compression.
"

string "output" F "Specifiy output file (default=stdout)." \
    arg="FILE" \
    default="-"

#-------------------------------------------------------
# Operator Selection
group "Operator Selection"

flag "exp" E "Real exponentiation"

flag "log" L "Real logarithm"

float "multiply" m "Real multiplication by WEIGHT" \
  arg="WEIGHT"

float "add"      a "Real addition of WEIGHT" \
  arg="WEIGHT"

flag "positive" p "Set real negative weights to zero"


float "times"    - "Semiring multiplication by WEIGHT" \
  arg="WEIGHT"

float "plus"     - "Semiring addition of WEIGHT" \
  arg="WEIGHT"

flag "sr-positive" - "Set semiring-negative weights to semiring-zero"

#-------------------------------------------------------
# Weight Selection
group "Weight Selection"

flag "no-arcs" A "Exclude arc weights (default: include)"

flag "no-finals" f "Exclude final weights (default: include)"

#flag "potentials" P "Include potentials (default: include)" ##-- what the heck are 'potentials'?

flag "zero" Z "Include semiring-zero weights (default: exclude)"

#-------------------------------------------------------
# State & Label Selection
group "State & Label Selection"

flag "initial" i "Select only initial state and its arcs/finality"

int  "state"   s "Select only state ID and its arcs/finality (default=all)" \
  arg="ID" \
  default="-1"

int "lower"   l "Select only arcs with lower-label LO (default=any)" \
  arg="LO" \
  default="-1"

int "upper"   u "Select only arcs with upper-label HI (defualt=any)" \
  arg="HI" \
  default="-1"



#-----------------------------------------------------------------------------
# Addenda
#-----------------------------------------------------------------------------
#addenda ""

#-----------------------------------------------------------------------------
# Bugs
#-----------------------------------------------------------------------------
bugs "

Note that the --plus and --times operations are
sensitive to the semiring associated with the stored FSM file, while
the --add and --multiply operations have the usual real-number interpretations,
regardless of the automaton semiring.

"

#-----------------------------------------------------------------------------
# Footer
#-----------------------------------------------------------------------------
#acknowledge `cat acknowledge.pod`

seealso "
L<gfsmutils>
"