automaton 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README +11 -0
- data/bin/tex2pdf +9 -0
- data/lib/automaton.rb +243 -0
- data/lib/generate.rb +43 -0
- data/lib/latex.rb +61 -0
- data/lib/layout.rb +116 -0
- data/lib/ruby_extensions.rb +35 -0
- data/lib/tex/FinalStateVar.tex +14 -0
- data/lib/tex/VCPref-main.tex +109 -0
- data/lib/tex/Vaucanson-G.tex +946 -0
- data/lib/tex/multido.sty +27 -0
- data/lib/tex/template.tex +24 -0
- data/lib/tex/vaucanson-g.sty +14 -0
- data/spec/automaton_spec.rb +180 -0
- data/spec/layout_spec.rb +48 -0
- data/spec/spec.opts +0 -0
- data/spec/spec_helper.rb +45 -0
- metadata +78 -0
@@ -0,0 +1,35 @@
|
|
1
|
+
# Various monkeypatching
|
2
|
+
|
3
|
+
class Array #:nodoc:
|
4
|
+
# Turns an array of the form [[key, value], ...] into a hash of the form {key => value }
|
5
|
+
# [[:a, 1], [:b, 2]].to_h #=> {a => 1, :b => 2}
|
6
|
+
def to_h
|
7
|
+
inject({}) { |m, e| m[e[0]] = e[1]; m }
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
class Symbol #:nodoc:
|
12
|
+
# Create a new symbol with _name added
|
13
|
+
def tag(name)
|
14
|
+
"#{self}_#{name}".to_sym
|
15
|
+
end
|
16
|
+
|
17
|
+
# Create a new symbol a_b from the symbol a and b
|
18
|
+
def +(other)
|
19
|
+
"#{self}_#{other}".to_sym
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
class Hash #:nodoc:
|
24
|
+
# Invokes block once for each pair of self, each time yielding a new key, value pair.
|
25
|
+
# Returns a new hash with the values of the original hash replaced by those returned from the block.
|
26
|
+
#
|
27
|
+
# {:a => 1, :b => 2}.key_value_map{|key, value| value * 2}
|
28
|
+
# #=> {:a => 2, :a => 4}
|
29
|
+
def value_map
|
30
|
+
self.inject(self.class.new) do |hash, (key,value)|
|
31
|
+
hash[key] = yield(key, value)
|
32
|
+
hash
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
%%%%% macro FinalStateVar %%%%%%%%%%%%%%%%%%%
|
2
|
+
\newcommand{\StateLineDblTemp}{0}
|
3
|
+
\newcommand{\FinalStateVar}[3][]%
|
4
|
+
{\ifStateLineDbl
|
5
|
+
\renewcommand{\StateLineDblTemp}{1}
|
6
|
+
\else
|
7
|
+
\renewcommand{\StateLineDblTemp}{0}
|
8
|
+
\fi
|
9
|
+
\StateLineDouble
|
10
|
+
\StateVar[#1]{#2}{#3}
|
11
|
+
\ifthenelse{\equal{\StateLineDblTemp}{0}}%
|
12
|
+
{\StateLineSimple}{}%
|
13
|
+
}
|
14
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
@@ -0,0 +1,109 @@
|
|
1
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2
|
+
%
|
3
|
+
% This files contains initial values
|
4
|
+
% of Vaucanson's parameter
|
5
|
+
% Modify it to create your own style
|
6
|
+
%
|
7
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
8
|
+
%%%%%%%%%%%%%%
|
9
|
+
% State aspect
|
10
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
11
|
+
\SetStateLabelColor{black} %% color
|
12
|
+
\SetStateLabelScale{1.7} %% float
|
13
|
+
\SetStateLineStyle{solid} %% aspect (other values: none, dashed, dotted)
|
14
|
+
\SetStateLineWidth{1.8pt} %% length
|
15
|
+
\SetStateLineColor{black} %% color
|
16
|
+
\SetStateFillStatus{solid} %% aspect
|
17
|
+
\SetStateFillColor{white} %% color
|
18
|
+
\FixDimState{solid}{gray}{1}{gray}{white} %% LineStyle,LineColor,LineCoef (*\StateLineWidth),LabelColor,FillColor
|
19
|
+
\FixStateLineDouble{0.6}{0.4} %% Double style: \StateLineDblCoef, \StateLineDblSep, coeffs applied to \StateLineWidth
|
20
|
+
%%%%%%%%%%%%%%
|
21
|
+
% Edge aspect
|
22
|
+
%%%%%%%%%%%%%%
|
23
|
+
\SetEdgeLabelColor{black} %% color
|
24
|
+
\SetEdgeLabelScale{1.7} %% float
|
25
|
+
\SetEdgeLineStyle{solid} %% aspect
|
26
|
+
\SetEdgeLineWidth{1pt} %% length
|
27
|
+
\SetEdgeLineColor{black} %% color
|
28
|
+
\SetArcAngle{15} %% int (degree)
|
29
|
+
\SetLArcAngle{30} %% int (degree)
|
30
|
+
\SetArcCurvature{0.8} %% float
|
31
|
+
\SetEdgeOffset{0pt} %% length
|
32
|
+
\SetArcOffset{1pt} %% length
|
33
|
+
\SetLoopOffset{0pt} %% length
|
34
|
+
\renewcommand{\ForthBackEdgeOffset}{5} %% float : coef*\EdgeLineWidth -> offset
|
35
|
+
\FixDimEdge{solid}{1.2}{gray}{gray} %% LineStyle,LineCoef,LineColor,LabelColor
|
36
|
+
\FixEdgeBorder{2}{white} %% int,color : coef*\EdgeLineWidth -> width of border
|
37
|
+
\FixEdgeLineDouble{0.5}{0.6} %% float : coefs*\EdgeLineWidth -> (width of lines, distance)
|
38
|
+
%%%%%%%%%%%%%%
|
39
|
+
% ZZ aspect
|
40
|
+
%%%%%%%%%%%%%%
|
41
|
+
\setlength{\ZZSize}{.9cm} % length : apparent diameter
|
42
|
+
\renewcommand{\ZZShape}{0.5} % coef: opening of the ZZ
|
43
|
+
\SetZZLineWidth{1.7} % float
|
44
|
+
\renewcommand{\TransLabelZZCoef}{0.6} % float : coef*\ZZSize -> distance added for labels
|
45
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
46
|
+
%%% Scales --- Default settings
|
47
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
48
|
+
\renewcommand{\LargeScale}{0.85} %float : argument of a \scalebox
|
49
|
+
\renewcommand{\MediumScale}{0.6} %float
|
50
|
+
\renewcommand{\SmallScale}{0.5} %float
|
51
|
+
\renewcommand{\TinyScale}{0.42} %float
|
52
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
53
|
+
%%% State parameters --- Default settings
|
54
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
55
|
+
\setlength{\MediumStateDiameter}{.9cm} %length
|
56
|
+
\setlength{\SmallStateDiameter}{.6cm} %length
|
57
|
+
\setlength{\LargeStateDiameter}{1.2cm} %length
|
58
|
+
\setlength{\VerySmallStateDiameter}{.3cm} %length
|
59
|
+
\renewcommand{\VSStateLineCoef}{.6} %float : coef *\StateLineWidth
|
60
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
61
|
+
\renewcommand{\ArrowOnMediumState}{1.5} %float : coef *\StateDiameter for size of initial and final arrows
|
62
|
+
\renewcommand{\ArrowOnSmallState}{1.7} %float
|
63
|
+
\renewcommand{\ArrowOnLargeState}{1.3} %float
|
64
|
+
\renewcommand{\ArrowOnVerySmallState}{5} %float
|
65
|
+
\renewcommand{\LoopOnMediumState}{7} %float : curvature
|
66
|
+
\renewcommand{\LoopOnSmallState}{9.6} %float
|
67
|
+
\renewcommand{\LoopOnLargeState}{5.8} %float
|
68
|
+
\renewcommand{\LoopOnVariableState}{5.1} %float
|
69
|
+
\renewcommand{\CLoopOnMediumState}{8} %float
|
70
|
+
\renewcommand{\CLoopOnSmallState}{12} %float
|
71
|
+
\renewcommand{\CLoopOnLargeState}{6} %float
|
72
|
+
\renewcommand{\CLoopOnVariableState}{5.2} %float
|
73
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
74
|
+
%%% Edge parameters --- Default settings
|
75
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
76
|
+
\renewcommand{\EdgeLabelPosit}{.45} %per cent (use \Fix..LabelPosit with values in [10;90])
|
77
|
+
\renewcommand{\EdgeLabelRevPosit}{.55}
|
78
|
+
\renewcommand{\ArcLabelPosit}{.40}
|
79
|
+
\renewcommand{\ArcLabelRevPosit}{.60}
|
80
|
+
\renewcommand{\LArcLabelPosit}{.40}
|
81
|
+
\renewcommand{\LArcLabelRevPosit}{.60}
|
82
|
+
\renewcommand{\LoopLabelPosit}{.25}
|
83
|
+
\renewcommand{\LoopLabelRevPosit}{.75}
|
84
|
+
\renewcommand{\CLoopLabelPosit}{.25}
|
85
|
+
\renewcommand{\CLoopLabelRevPosit}{.75}
|
86
|
+
\renewcommand{\InitStateLabelPosit}{.10}
|
87
|
+
\renewcommand{\InitStateLabelRevPosit}{.90}
|
88
|
+
\renewcommand{\FinalStateLabelPosit}{.90}
|
89
|
+
\renewcommand{\FinalStateLabelRevPosit}{.10}
|
90
|
+
\SetEdgeArrowWidth{5pt} %length of the edge arrow
|
91
|
+
\SetEdgeArrowLengthCoef{1.4} %float : coef*\EdgeArrowSizeDim width of EA
|
92
|
+
\setlength{\EdgeDblArrowWidth}{5.5pt} %length : size of EA for double transitions
|
93
|
+
\renewcommand{\EdgeDblArrowLengthCoef}{1.7} %int
|
94
|
+
\SetEdgeArrowInsetCoef{0.1} %float : coef*\EdgeArrowSizeDim
|
95
|
+
\SetEdgeArrowStyle{->} %style (other styles : <-, |-|, -|,...)
|
96
|
+
\renewcommand{\EdgeRevArrowStyle}{<-} %style for reverse transitions
|
97
|
+
\renewcommand{\StateDimen}{outer} %side of the boundary of states that corresponds to the diameter
|
98
|
+
\renewcommand{\StateDblDimen}{middle} %idem for states with double line (values: outer, middle or inner)
|
99
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
100
|
+
%%% Initialization
|
101
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
102
|
+
\SetVCDirectory{} %default dir=current dir
|
103
|
+
\HideFrame
|
104
|
+
\HideGrid
|
105
|
+
\MediumPicture
|
106
|
+
\HideName
|
107
|
+
\RigidLabel
|
108
|
+
\FullState %% PlainState
|
109
|
+
\MediumState
|
@@ -0,0 +1,946 @@
|
|
1
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2
|
+
%
|
3
|
+
% Vaucanson_v4.tex
|
4
|
+
%
|
5
|
+
% Automata drawer based on Pstricks
|
6
|
+
%
|
7
|
+
% V 0.2 - 03/05/09
|
8
|
+
% modification of StateVar
|
9
|
+
% Chg*LabelScale is relative w.r.t Set*LabelScale
|
10
|
+
% Chg Vaucanson to Vaucanson-G
|
11
|
+
% V 0.3 - 03/09/10
|
12
|
+
% VCPref-main is no more required to initialize VC-G
|
13
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
14
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
15
|
+
%%% Commands for geometric constructions
|
16
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
17
|
+
%%% constants
|
18
|
+
\newcommand{\SQRTwo}{0.717}
|
19
|
+
\newcommand{\SQRThree}{1.732}
|
20
|
+
\newcommand{\GoldMean}{0.618}
|
21
|
+
\newcommand{\GoldMeanI}{1.618}
|
22
|
+
\newcommand{\SQRGoldMeanI}{1.272}
|
23
|
+
\newcommand{\Vaucanson}{\textsc{V$\overline{\text{au}}$C%
|
24
|
+
\raisebox{.3ex}{$\underline{\text{an}}$}S$\overline{\text{on}}$-G}\xspace}
|
25
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
26
|
+
%%%%% Edge label drawing macros
|
27
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
28
|
+
%%% Separator in compound labels (eg \IOL{input}{output})
|
29
|
+
\newcommand{\IOL}[2]{#1\!\mid\! #2}
|
30
|
+
%%% Stacked labels
|
31
|
+
\newcommand{\StackTwoLabels}[2]{%
|
32
|
+
\renewcommand{\arraystretch}{0.75}%
|
33
|
+
\begin{array}{c}#1\\ #2 \end{array}%
|
34
|
+
\renewcommand{\arraystretch}{1.333}}
|
35
|
+
\newcommand{\StackThreeLabels}[3]{%
|
36
|
+
\renewcommand{\arraystretch}{0.75}%
|
37
|
+
\begin{array}{c}#1\\ #2 \\ #3 \end{array}%
|
38
|
+
\renewcommand{\arraystretch}{1.333}}
|
39
|
+
%%% Stacked labels with +
|
40
|
+
\newcommand{\StackTwoLabelsP}[2]{%
|
41
|
+
\renewcommand{\arraystretch}{0.75}%
|
42
|
+
\begin{array}{c}#1\\ + \\ #2 \end{array}%
|
43
|
+
\renewcommand{\arraystretch}{1.333}}
|
44
|
+
\newcommand{\StackThreeLabelsP}[3]{%
|
45
|
+
\renewcommand{\arraystretch}{0.75}%
|
46
|
+
\begin{array}{c}#1\\ + \\ #2 \\ + \\ #3 \end{array}%
|
47
|
+
\renewcommand{\arraystretch}{1.333}}
|
48
|
+
%%% Lined up labels (with +)
|
49
|
+
\newcommand{\LineTwoLabelsP}[2]{#1 + #2}
|
50
|
+
\newcommand{\LineThreeLabelsP}[3]{#1 + #2 + #3}
|
51
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
52
|
+
%%% Scales --- Default settings
|
53
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
54
|
+
\newcommand{\LargeScale}{0.85}
|
55
|
+
\newcommand{\MediumScale}{0.6}
|
56
|
+
\newcommand{\SmallScale}{0.5}
|
57
|
+
\newcommand{\TinyScale}{0.42}
|
58
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
59
|
+
%%% State parameters --- Default settings
|
60
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
61
|
+
%%% Size = StateDiameter
|
62
|
+
%%% The preset sizes are given in cm, and not in "psunits".
|
63
|
+
%%% This allows to use different scales for the whole figure
|
64
|
+
%%% and for the "drawing grid".
|
65
|
+
\newlength{\MediumStateDiameter}
|
66
|
+
\newlength{\SmallStateDiameter}
|
67
|
+
\newlength{\LargeStateDiameter}
|
68
|
+
\newlength{\VerySmallStateDiameter}
|
69
|
+
\setlength{\MediumStateDiameter}{.9cm}
|
70
|
+
\setlength{\SmallStateDiameter}{.6cm}
|
71
|
+
\setlength{\LargeStateDiameter}{1.2cm}
|
72
|
+
\setlength{\VerySmallStateDiameter}{.3cm}
|
73
|
+
%%% Border line = StateLine
|
74
|
+
\newlength{\StateLineWidth} % width
|
75
|
+
\setlength{\StateLineWidth}{1.8pt}
|
76
|
+
\newcommand{\StateLineStyle}{solid} % style
|
77
|
+
\newcommand{\StateLineColor}{black}
|
78
|
+
\newif\ifStateLineDbl \StateLineDblfalse
|
79
|
+
\newcommand{\StateLineDblCoef}{0.6}
|
80
|
+
\newcommand{\StateLineDblSep}{0.4}
|
81
|
+
\newcommand{\VSStateLineCoef}{.6} % coef. for very small state
|
82
|
+
%%% State background and label
|
83
|
+
\newcommand{\StateFillStatus}{solid}
|
84
|
+
\newcommand{\StateFillColor}{white}
|
85
|
+
\newcommand{\StateLabelColor}{black}
|
86
|
+
\newcommand{\StateLabelScale}{1.2}
|
87
|
+
\newcommand{\SmallStateFillStatus}{solid} %
|
88
|
+
\newcommand{\SmallStateFillColor}{white} %
|
89
|
+
% As they have usually no labels it useful
|
90
|
+
% to have a coloring facility for the "SmallState"
|
91
|
+
%%% Dimmed states (e.g. for non accessible states)
|
92
|
+
\newcommand{\DimStateLineStyle}{solid}
|
93
|
+
\newcommand{\DimStateLineCoef}{1} %
|
94
|
+
\newcommand{\DimStateLineColor}{gray}
|
95
|
+
\newcommand{\DimStateLabelColor}{gray}
|
96
|
+
\newcommand{\DimStateFillColor}{white}
|
97
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
98
|
+
%%% Edge drawing parameters --- Default settings
|
99
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
100
|
+
% line
|
101
|
+
\newlength{\EdgeLineWidth}
|
102
|
+
\setlength{\EdgeLineWidth}{1pt}
|
103
|
+
\newcommand{\EdgeLineStyle}{solid}
|
104
|
+
\newif\ifEdgeLineDbl \EdgeLineDblfalse
|
105
|
+
%\newcommand{\EdgeLineDblStatus}{false}
|
106
|
+
\newcommand{\EdgeLineDblCoef}{0.5}
|
107
|
+
\newcommand{\EdgeLineDblSep}{0.6}
|
108
|
+
\newcommand{\EdgeLineColor}{black}
|
109
|
+
% arrow
|
110
|
+
\newlength{\EdgeArrowWidth}\setlength{\EdgeArrowWidth}{5pt}
|
111
|
+
\newlength{\EdgeDblArrowWidth}\setlength{\EdgeDblArrowWidth}{5.5pt}
|
112
|
+
\newcommand{\EdgeArrowLengthCoef}{1.4}
|
113
|
+
\newcommand{\EdgeDblArrowLengthCoef}{1.7}
|
114
|
+
\newcommand{\EdgeArrowInset}{0.1}
|
115
|
+
\newcommand{\EdgeArrowStyle}{->}
|
116
|
+
\newcommand{\EdgeRevArrowStyle}{<-}
|
117
|
+
% border
|
118
|
+
\newcommand{\EdgeLineBorderCoef}{2}
|
119
|
+
\newcommand{\EdgeLineBorderColor}{white}
|
120
|
+
% label
|
121
|
+
\newcommand{\EdgeLabelColor}{black}
|
122
|
+
\newcommand{\EdgeLabelScale}{0.8}
|
123
|
+
%%% Dimmed edges
|
124
|
+
\newcommand{\DimEdgeLineCoef}{1.2}
|
125
|
+
\newcommand{\DimEdgeLineStyle}{solid}
|
126
|
+
\newcommand{\DimEdgeLineColor}{gray}
|
127
|
+
\newcommand{\DimEdgeLabelColor}{gray}
|
128
|
+
%%% Zigzag edges parameter
|
129
|
+
\newlength{\ZZSize}
|
130
|
+
\setlength{\ZZSize}{.9cm}%\MediumStateDiameter
|
131
|
+
\newcommand{\ZZShape}{0.5}
|
132
|
+
\newcommand{\ZZLineWidth}{1.7}% coefficient multiplicateur
|
133
|
+
\newcommand{\TransLabelZZCoef}{0.6}% coefficient multiplicateur
|
134
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
135
|
+
%%% Edge geometric parameters --- Default settings
|
136
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
137
|
+
% Edge
|
138
|
+
\newlength{\EdgeOffset}
|
139
|
+
\setlength{\EdgeOffset}{0pt}
|
140
|
+
\newcommand{\ForthBackEdgeOffset}{5}% coef
|
141
|
+
% Arc parameters
|
142
|
+
\newcommand{\VaucArcAngle}{15}
|
143
|
+
\newcommand{\VaucArcCurvature}{0.8}
|
144
|
+
\newlength{\VaucArcOffset}
|
145
|
+
\setlength{\VaucArcOffset}{1pt}
|
146
|
+
% Large Arc parameters
|
147
|
+
\newcommand{\VaucLArcAngle}{30}
|
148
|
+
\newcommand{\VaucLArcCurvature}{0.8}
|
149
|
+
\newlength{\LoopOffset}\setlength{\LoopOffset}{0pt}
|
150
|
+
\newlength{\LoopVarOffset}\setlength{\LoopVarOffset}{.7pt}
|
151
|
+
\newcommand{\LoopAngle}{30}
|
152
|
+
\newcommand{\CLoopAngle}{22}
|
153
|
+
\newcommand{\LoopVarAngle}{28}
|
154
|
+
% Size of loops (depending on the size of the state)
|
155
|
+
\newcommand{\LoopOnMediumState}{7}
|
156
|
+
\newcommand{\LoopOnSmallState}{9.6}
|
157
|
+
\newcommand{\LoopOnLargeState}{5.8}
|
158
|
+
\newcommand{\LoopOnVariableState}{5.1}
|
159
|
+
\newcommand{\LoopOnVerySmallState}{15}
|
160
|
+
\newcommand{\CLoopOnMediumState}{8}
|
161
|
+
\newcommand{\CLoopOnSmallState}{12}
|
162
|
+
\newcommand{\CLoopOnLargeState}{6}
|
163
|
+
\newcommand{\CLoopOnVariableState}{5.2}
|
164
|
+
%\newcommand{\CLoopOnVerySmallState}{14}
|
165
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
166
|
+
%%%%% Edge label parameters --- Default settings
|
167
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
168
|
+
% label distance from transition
|
169
|
+
\newlength{\TransLabelSep}\setlength{\TransLabelSep}{3.5pt}
|
170
|
+
% label position on transitions
|
171
|
+
\newcommand{\EdgeLabelPosit}{.45}\newcommand{\EdgeLabelRevPosit}{.55}
|
172
|
+
\newcommand{\ArcLabelPosit}{.4}\newcommand{\ArcLabelRevPosit}{.6}
|
173
|
+
\newcommand{\LArcLabelPosit}{.4}\newcommand{\LArcLabelRevPosit}{.6}
|
174
|
+
\newcommand{\LoopLabelPosit}{.25}\newcommand{\LoopLabelRevPosit}{.75}
|
175
|
+
\newcommand{\CLoopLabelPosit}{.25}\newcommand{\CLoopLabelRevPosit}{.75}
|
176
|
+
% label position on initial-final arrow
|
177
|
+
\newcommand{\InitStateLabelPosit}{.1}\newcommand{\InitStateLabelRevPosit}{.9}
|
178
|
+
\newcommand{\FinalStateLabelPosit}{.9}\newcommand{\FinalStateLabelRevPosit}{.1}
|
179
|
+
%%% Size of initial and final arrow
|
180
|
+
% the size is relative to the diameter
|
181
|
+
% and the coefficient varies with the diameter
|
182
|
+
\newcommand{\ArrowOnStateCoef}{}
|
183
|
+
\newcommand{\ArrowOnMediumState}{1.5}
|
184
|
+
\newcommand{\ArrowOnSmallState}{1.7}
|
185
|
+
\newcommand{\ArrowOnLargeState}{1.3}
|
186
|
+
\newcommand{\ArrowOnVerySmallState}{5}
|
187
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
188
|
+
%%%%% Shift for aligned labels
|
189
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
190
|
+
\newlength{\VertShiftH} \settoheight{\VertShiftH}{$\{$}
|
191
|
+
\newlength{\VertShiftD} \settodepth{\VertShiftD}{$\{$}
|
192
|
+
\newlength{\VertShift}
|
193
|
+
\setlength{\VertShift}{.5\VertShiftD-.5\VertShiftH}
|
194
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
195
|
+
%%%%% flags
|
196
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
197
|
+
\newif\ifVCFrame
|
198
|
+
\newcommand{\HideFrame}{\VCFramefalse}
|
199
|
+
\newcommand{\ShowFrame}{\VCFrametrue}
|
200
|
+
\newif\ifVCGrid
|
201
|
+
\newcommand{\HideGrid}{\VCGridfalse}
|
202
|
+
\newcommand{\ShowGrid}{\VCGridtrue}
|
203
|
+
\newif\ifVCRigidLabel
|
204
|
+
\newcommand{\RigidLabel}{\VCRigidLabeltrue}
|
205
|
+
\newcommand{\SwivelLabel}{\VCRigidLabelfalse}
|
206
|
+
\newif\ifVCStateLabelBaseLine
|
207
|
+
\newcommand{\AlignedLabel}{\VCStateLabelBaseLinetrue}
|
208
|
+
\newcommand{\FloatingLabel}{\VCStateLabelBaseLinefalse}
|
209
|
+
\HideFrame
|
210
|
+
\HideGrid
|
211
|
+
\RigidLabel
|
212
|
+
\FloatingLabel
|
213
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
214
|
+
%%% style for the frame around the picture
|
215
|
+
\psset{unit=1cm}
|
216
|
+
\newpsstyle{VaucFrameStyle}{arrows=-,framesep=0pt,%
|
217
|
+
linewidth=0.6pt,linecolor=black,%
|
218
|
+
linestyle=solid,%
|
219
|
+
doubleline=false,%
|
220
|
+
fillcolor=white,fillstyle=none,%
|
221
|
+
cornersize=relative,framearc=0}
|
222
|
+
\newcommand{\FrameStyle}{\psset{style=VaucFrameStyle}}
|
223
|
+
\newpsstyle{VaucGridStyle}{%
|
224
|
+
gridwidth=0.6pt,griddots=10,subgriddiv=1,%
|
225
|
+
gridlabels=7pt}
|
226
|
+
\newcommand{\GridStyle}{\psset{style=VaucGridStyle}}
|
227
|
+
% figure, vertically centered by default
|
228
|
+
% draw frame according to VCFrame flag
|
229
|
+
% Set the shift for aligned label w.r.t the current size of characters
|
230
|
+
\newenvironment{VCPicture}[2][.5]%
|
231
|
+
{\settoheight{\VertShiftH}{$\{$}%
|
232
|
+
\settodepth{\VertShiftD}{$\{$}%
|
233
|
+
\setlength{\VertShift}{.5\VertShiftD-.5\VertShiftH}%
|
234
|
+
\begin{pspicture}[#1]#2%
|
235
|
+
\ifVCFrame \FrameStyle \psframe#2\fi%
|
236
|
+
\ifVCGrid \FrameStyle\GridStyle \psgrid#2\fi}%
|
237
|
+
{\RstState\RstEdge%
|
238
|
+
\end{pspicture}}
|
239
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
240
|
+
%%% Scaling matters
|
241
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
242
|
+
%%% The "sizes" (for states) and the "line widths" are given
|
243
|
+
%%% as "lengthes" in a fixed unit (cm or pt), whereas the positions
|
244
|
+
%%% are supposed to be given in "psunits".
|
245
|
+
%%% This allows to use different scaling parameters
|
246
|
+
%%% for the whole figure and for the "drawing grid".
|
247
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
248
|
+
%%% Scaling commands
|
249
|
+
\newcommand{\VCScale}{0.6}% Global scale parameter
|
250
|
+
\newcommand{\VCGridScale}{1}% Global scale parameter
|
251
|
+
%
|
252
|
+
\newcommand{\FixVCScale}[1]{\renewcommand{\VCScale}{#1}}% v4 pour
|
253
|
+
% % cause de syntaxe
|
254
|
+
\newcommand{\LargePicture}{\FixVCScale{\LargeScale}}
|
255
|
+
\newcommand{\MediumPicture}{\FixVCScale{\MediumScale}}
|
256
|
+
\newcommand{\SmallPicture}{\FixVCScale{\SmallScale}}
|
257
|
+
\newcommand{\TinyPicture}{\FixVCScale{\TinyScale}}
|
258
|
+
%%% Grid scale commands
|
259
|
+
% \newcommand{\VCGridScale}{}% Grid scale parameter
|
260
|
+
%
|
261
|
+
\newcommand{\FixVCGridScale}[1]{\renewcommand{\VCGridScale}{#1}}% v4 pour
|
262
|
+
% "grid unit"
|
263
|
+
%%%%% Typical figure would look like
|
264
|
+
% \scalebox{\VCScale}{%
|
265
|
+
% \begin{VCPicture}{(x0,y0)(x1,y1)}
|
266
|
+
% % figure description
|
267
|
+
% \end{VCPicture}%
|
268
|
+
% }
|
269
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
270
|
+
%%%%% Using a special directory for the figure
|
271
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
272
|
+
\newcommand{\VCDirectory}{}
|
273
|
+
\newcommand{\SetVCDirectory}[1]{\renewcommand{\VCDirectory}{#1}}
|
274
|
+
% flag for printing the name of the figure file
|
275
|
+
\newif\ifVCName
|
276
|
+
\newcommand{\HideName}{\VCNamefalse}
|
277
|
+
\newcommand{\ShowName}{\VCNametrue}
|
278
|
+
\newcommand{\VCDraw}[2][\VCGridScale]{%
|
279
|
+
\psset{unit=#1cm}%
|
280
|
+
\ifVCName\makebox[0pt][r]{\fbox{{\scriptsize #2}}}\fi%
|
281
|
+
\scalebox{\VCScale}{#2}%
|
282
|
+
\psset{unit=1cm}}
|
283
|
+
\newcommand{\VCCall}[2][\VCGridScale]{%
|
284
|
+
\psset{unit=#1cm}%
|
285
|
+
\ifVCName\makebox[0pt][r]{\fbox{{\scriptsize #2}}}\fi%
|
286
|
+
\scalebox{\VCScale}{\input{\VCDirectory #2}}%
|
287
|
+
\psset{unit=1cm}}
|
288
|
+
%%% commands
|
289
|
+
\newcommand{\VCPut}[3][0]{\rput{#1}#2{#3}}%
|
290
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
291
|
+
%%% State internal parameters --- Initial settings
|
292
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
293
|
+
\newlength{\StateLineWid}
|
294
|
+
\setlength{\StateLineWid}{\StateLineWidth}
|
295
|
+
\newcommand{\StateLineSty}{\StateLineStyle}
|
296
|
+
\newcommand{\StateLineCol}{\StateLineColor}
|
297
|
+
%\newcommand{\StateLineDblSta}{\StateLineDblStatus}
|
298
|
+
\newcommand{\StateLineDblWid}{\StateLineDblWidth}
|
299
|
+
\newcommand{\StateLineDblSp}{\StateLineDblSep}
|
300
|
+
\newcommand{\StateFillCol}{\StateFillColor}
|
301
|
+
\newcommand{\StateFillSta}{\StateFillStatus}
|
302
|
+
\newcommand{\StateLabelSca}{1}
|
303
|
+
\newcommand{\StateLabelCol}{\StateLabelColor}
|
304
|
+
\newcommand{\StateDimen}{outer}
|
305
|
+
\newcommand{\StateDblDimen}{middle}
|
306
|
+
%%% Initial-final quality
|
307
|
+
\newcommand{\VCIFflag}{2}\newcommand{\VCIFflagtemp}{2}
|
308
|
+
\newcommand{\PlainState}%
|
309
|
+
{\renewcommand{\VCIFflag}{0}\renewcommand{\VCIFflagtemp}{0}}
|
310
|
+
\newcommand{\FullState}%
|
311
|
+
{\renewcommand{\VCIFflag}{2}\renewcommand{\VCIFflagtemp}{2}}
|
312
|
+
\newcommand{\IFState}{\renewcommand{\VCIFflag}{1}}
|
313
|
+
\newcommand{\IFXState}{\renewcommand{\VCIFflag}{2}}
|
314
|
+
\newcommand{\RstVCIF}{\renewcommand{\VCIFflag}{\VCIFflagtemp}}
|
315
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
316
|
+
%%%%% State drawing style
|
317
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
318
|
+
%%% flag for hiding -- showing states (used for overlays in slides)
|
319
|
+
% the trick is to have two different styles and instead of
|
320
|
+
% saving\restoring parameters
|
321
|
+
\newif\ifVCShowState
|
322
|
+
\newcommand{\HideState}{\VCShowStatefalse}
|
323
|
+
\newcommand{\ShowState}{\VCShowStatetrue}
|
324
|
+
\ShowState % initialisation
|
325
|
+
% the only difference between the two styles is the linestyle
|
326
|
+
\newpsstyle{VaucStateStyle}{framesep=0pt,%
|
327
|
+
linewidth=\StateLineWid,linecolor=\StateLineCol,%
|
328
|
+
linestyle=\StateLineSty,doubleline=false,%
|
329
|
+
fillcolor=\StateFillCol,fillstyle=\StateFillSta,%
|
330
|
+
border=0pt,dimen=\StateDimen,%
|
331
|
+
cornersize=relative,framearc=1,framesep=0pt}
|
332
|
+
\newpsstyle{VaucStateDblStyle}{framesep=0pt,%
|
333
|
+
linewidth=\StateLineDblCoef\StateLineWid,linecolor=\StateLineCol,%
|
334
|
+
linestyle=\StateLineSty,doubleline=true,doublesep=\StateLineDblSep\StateLineWid,%
|
335
|
+
fillcolor=\StateFillCol,fillstyle=\StateFillSta,%
|
336
|
+
border=0pt,dimen=\StateDblDimen,%
|
337
|
+
cornersize=relative,framearc=1,framesep=0pt}
|
338
|
+
\newpsstyle{VaucHiddenStateStyle}{framesep=0pt,%
|
339
|
+
linewidth=\StateLineWid,linecolor=\StateLineCol,%
|
340
|
+
linestyle=none,%
|
341
|
+
fillcolor=\StateFillCol,fillstyle=none,%
|
342
|
+
border=0pt,dimen=outer,%
|
343
|
+
cornersize=relative,framearc=1,framesep=0pt}
|
344
|
+
\newcommand{\StateStyle}{%
|
345
|
+
\ifVCShowState%
|
346
|
+
\ifStateLineDbl\psset{style=VaucStateDblStyle}\else\psset{style=VaucStateStyle}\fi%
|
347
|
+
\else\psset{style=VaucHiddenStateStyle}\fi}
|
348
|
+
\newcommand{\VaucStateRBLabel}[1]{%
|
349
|
+
\textcolor{\StateLabelCol}{\scalebox{\StateLabelSca}{\scalebox{\StateLabelScale}{\rput[B]{0}(0,\VertShift){$ #1 $}}}}}%
|
350
|
+
\newcommand{\VaucStateLabel}[1]%
|
351
|
+
{\ifVCShowState%
|
352
|
+
\ifVCRigidLabel%
|
353
|
+
\ifVCStateLabelBaseLine%
|
354
|
+
\textcolor{\StateLabelCol}{\scalebox{\StateLabelSca}{\scalebox{\StateLabelScale}{\rput[B]{*0}(0,\VertShift){$ #1 $}}}}%
|
355
|
+
\else
|
356
|
+
\textcolor{\StateLabelCol}{\scalebox{\StateLabelSca}{\scalebox{\StateLabelScale}{\rput{*0}(0,0){$ #1 $}}}}%
|
357
|
+
\fi
|
358
|
+
\else
|
359
|
+
\textcolor{\StateLabelCol}{\scalebox{\StateLabelSca}{\scalebox{\StateLabelScale}{$ #1 $}}}%
|
360
|
+
\fi
|
361
|
+
\else%
|
362
|
+
\textcolor{white}{\scalebox{\StateLabelSca}{\scalebox{\StateLabelScale}{$ #1 $}}}%
|
363
|
+
\fi}
|
364
|
+
\newcommand{\VCPutStateLabel}[2]%
|
365
|
+
{\rput#1{\scalebox{\StateLabelSca}{$ #2 $}}}%
|
366
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
367
|
+
%%%%% State parameter changing and setting macros
|
368
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
369
|
+
%%% line style
|
370
|
+
\newcommand{\ChgStateLineStyle}[1]{\renewcommand{\StateLineSty}{#1}}
|
371
|
+
\newcommand{\RstStateLineStyle}{\ChgStateLineStyle{\StateLineStyle}}
|
372
|
+
\newcommand{\SetStateLineStyle}[1]%
|
373
|
+
{\renewcommand{\StateLineStyle}{#1}\RstStateLineStyle}%
|
374
|
+
%%% doubleline status
|
375
|
+
\newcommand{\StateLineDouble}{\StateLineDbltrue}
|
376
|
+
\newcommand{\StateLineSimple}{\StateLineDblfalse}
|
377
|
+
%%% line width
|
378
|
+
\newcommand{\ChgStateLineWidth}[1]{\setlength{\StateLineWid}{#1\StateLineWidth}}%
|
379
|
+
\newcommand{\RstStateLineWidth}{\ChgStateLineWidth{1}}%
|
380
|
+
\newcommand{\SetStateLineWidth}[1]% ATTN the parameter is a length
|
381
|
+
{\setlength{\StateLineWidth}{#1}\RstStateLineWidth}
|
382
|
+
%%% line color
|
383
|
+
\newcommand{\ChgStateLineColor}[1]{\renewcommand{\StateLineCol}{#1}}
|
384
|
+
\newcommand{\RstStateLineColor}{\ChgStateLineColor{\StateLineColor}}
|
385
|
+
\newcommand{\SetStateLineColor}[1]%
|
386
|
+
{\renewcommand{\StateLineColor}{#1}\RstStateLineColor}
|
387
|
+
%%% background fill status
|
388
|
+
\newcommand{\ChgStateFillStatus}[1]{\renewcommand{\StateFillSta}{#1}}
|
389
|
+
\newcommand{\RstStateFillStatus}{\ChgStateFillStatus{\StateFillStatus}}
|
390
|
+
\newcommand{\SetStateFillStatus}[1]%
|
391
|
+
{\renewcommand{\StateFillStatus}{#1}\RstStateFillStatus}
|
392
|
+
%%% backgroud color
|
393
|
+
\newcommand{\ChgStateFillColor}[1]{\renewcommand{\StateFillCol}{#1}}
|
394
|
+
\newcommand{\RstStateFillColor}{\ChgStateFillColor{\StateFillColor}}
|
395
|
+
\newcommand{\SetStateFillColor}[1]%
|
396
|
+
{\renewcommand{\StateFillColor}{#1}\RstStateFillColor}%
|
397
|
+
%%% label color
|
398
|
+
\newcommand{\ChgStateLabelColor}[1]{\renewcommand{\StateLabelCol}{#1}}
|
399
|
+
\newcommand{\RstStateLabelColor}{\ChgStateLabelColor{\StateLabelColor}}
|
400
|
+
\newcommand{\SetStateLabelColor}[1]%
|
401
|
+
{\renewcommand{\StateLabelCol}{#1}\RstStateLabelColor}
|
402
|
+
%%% label scale
|
403
|
+
\newcommand{\ChgStateLabelScale}[1]{\renewcommand{\StateLabelSca}{#1}}
|
404
|
+
\newcommand{\RstStateLabelScale}{\ChgStateLabelScale{1}}
|
405
|
+
\newcommand{\SetStateLabelScale}[1]%
|
406
|
+
{\renewcommand{\StateLabelScale}{#1}\RstStateLabelScale}
|
407
|
+
\newcommand{\FixStateLineDouble}[2]{%
|
408
|
+
\renewcommand{\StateLineDblCoef}{#1}%
|
409
|
+
\renewcommand{\StateLineDblSep}{#2}}
|
410
|
+
\newcommand{\FixDimState}[5]{%
|
411
|
+
\renewcommand{\DimStateLineStyle}{#1}%
|
412
|
+
\renewcommand{\DimStateLineCoef}{#3}%
|
413
|
+
\renewcommand{\DimStateLineColor}{#2}%
|
414
|
+
\renewcommand{\DimStateLabelColor}{#4}%
|
415
|
+
\renewcommand{\DimStateFillColor}{#5}}%
|
416
|
+
%%% restoring state parameters
|
417
|
+
\newcommand{\RstState}{%
|
418
|
+
\RstStateLineStyle\RstStateLineWidth%
|
419
|
+
\RstStateLineColor%
|
420
|
+
\RstStateFillStatus\RstStateFillColor%
|
421
|
+
\RstStateLabelColor\RstStateLabelScale}%
|
422
|
+
%%% establishing the dimmed style
|
423
|
+
\newcommand{\DimState}{%
|
424
|
+
\ChgStateLineStyle{\DimStateLineStyle}%
|
425
|
+
\ChgStateLineWidth{\DimStateLineCoef}%
|
426
|
+
\ChgStateLineColor{\DimStateLineColor}%
|
427
|
+
\ChgStateFillColor{\DimStateFillColor}%
|
428
|
+
\ChgStateLabelColor{\DimStateLabelColor}}%
|
429
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
430
|
+
%%%%% State drawing
|
431
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
432
|
+
% preparation
|
433
|
+
\newlength{\StateDiam}
|
434
|
+
\newlength{\VaucAOS}\newlength{\VaucAOSdiag}
|
435
|
+
%%% A flag to remember the current size of state
|
436
|
+
\newcommand{\StateSizeFlag}{}
|
437
|
+
%
|
438
|
+
\newcommand{\SetAOS}{%
|
439
|
+
\setlength{\VaucAOS}{\ArrowOnStateCoef\StateDiam}%
|
440
|
+
\setlength{\VaucAOSdiag}{\SQRTwo\VaucAOS}}
|
441
|
+
%% parameter for variable width states
|
442
|
+
\newlength{\VariableStateIntDiam}
|
443
|
+
\newlength{\VariableStateWidth}
|
444
|
+
\newlength{\VariableStateITPos}
|
445
|
+
\newcommand{\SetStateIntDiam}{%
|
446
|
+
\setlength{\VariableStateIntDiam}{\StateDiam}%
|
447
|
+
\addtolength{\VariableStateIntDiam}{-2\StateLineWid}%
|
448
|
+
}%
|
449
|
+
% Loop parameters
|
450
|
+
\newcommand{\LoopSize}{}\newcommand{\LoopSi}{}
|
451
|
+
\newcommand{\LoopVarSize}{}\newcommand{\LoopVarSi}{}
|
452
|
+
\newcommand{\CLoopSize}{}\newcommand{\CLoopSi}{}
|
453
|
+
%
|
454
|
+
\newcommand{\ChgLoopSize}[1]{\renewcommand{\LoopSi}{#1}}
|
455
|
+
\newcommand{\RstLoopSize}{\ChgLoopSize{\LoopSize}}
|
456
|
+
\newcommand{\SetLoopSize}[1]%
|
457
|
+
{\renewcommand{\LoopSize}{#1}\RstLoopSize}
|
458
|
+
%
|
459
|
+
\newcommand{\ChgCLoopSize}[1]{\renewcommand{\CLoopSi}{#1}}
|
460
|
+
\newcommand{\RstCLoopSize}{\ChgCLoopSize{\CLoopSize}}
|
461
|
+
\newcommand{\SetCLoopSize}[1]%
|
462
|
+
{\renewcommand{\CLoopSize}{#1}\RstCLoopSize}
|
463
|
+
%
|
464
|
+
\newcommand{\ChgLoopVarSize}[1]{\renewcommand{\LoopVarSi}{#1}}
|
465
|
+
\newcommand{\RstLoopVarSize}{\ChgLoopVarSize{\LoopVarSize}}
|
466
|
+
\newcommand{\SetLoopVarSize}[1]%
|
467
|
+
{\renewcommand{\LoopVarSize}{#1}\RstLoopVarSize}
|
468
|
+
%
|
469
|
+
%%% setting state diameter -- internal command
|
470
|
+
\newcommand{\SetStateDiam}[4]{%
|
471
|
+
\setlength{\StateDiam}{#1}%
|
472
|
+
\renewcommand{\ArrowOnStateCoef}{#2}%
|
473
|
+
\SetLoopSize{#3}%
|
474
|
+
\SetLoopVarSize{#3}%
|
475
|
+
\SetCLoopSize{#4}%
|
476
|
+
\SetAOS\SetStateIntDiam}
|
477
|
+
%%% setting state diameter -- external command
|
478
|
+
\newcommand{\FixStateDiameter}[1]% v4 pour cause de syntaxe
|
479
|
+
{\setlength{\StateDiam}{#1}\SetStateIntDiam \SetAOS}
|
480
|
+
%%%
|
481
|
+
\newcommand{\MediumState}%
|
482
|
+
{\SetStateDiam{\MediumStateDiameter}{\ArrowOnMediumState}%
|
483
|
+
{\LoopOnMediumState}{\CLoopOnMediumState}%
|
484
|
+
\renewcommand{\StateSizeFlag}{0}}
|
485
|
+
\newcommand{\SmallState}%
|
486
|
+
{\SetStateDiam{\SmallStateDiameter}{\ArrowOnSmallState}%
|
487
|
+
{\LoopOnSmallState}{\CLoopOnSmallState}%
|
488
|
+
\renewcommand{\StateSizeFlag}{1}}
|
489
|
+
\newcommand{\LargeState}%
|
490
|
+
{\SetStateDiam{\LargeStateDiameter}{\ArrowOnLargeState}%
|
491
|
+
{\LoopOnLargeState}{\CLoopOnLargeState}%
|
492
|
+
\renewcommand{\StateSizeFlag}{2}}
|
493
|
+
%
|
494
|
+
\newcommand{\RstStateSize}%
|
495
|
+
{\ifthenelse{\equal{\StateSizeFlag}{0}}%
|
496
|
+
{\MediumState}%
|
497
|
+
{\ifthenelse{\equal{\StateSizeFlag}{1}}%
|
498
|
+
{\SmallState}{\LargeState}}}%
|
499
|
+
%%% Initialization
|
500
|
+
\MediumState
|
501
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
502
|
+
\newcommand{\VaucState}[3][{}]%
|
503
|
+
{\rput#2{%
|
504
|
+
\Cnode[radius=.5\StateDiam](0,0){#3}%
|
505
|
+
\ifVCShowState%
|
506
|
+
\nput[labelsep=-.5\StateDiam]{0}{#3}%
|
507
|
+
{\makebox[0pt]{\VaucStateLabel{#1}}}%
|
508
|
+
\fi
|
509
|
+
\ifthenelse{\equal{\VCIFflag}{0}}{}{%
|
510
|
+
\pnode(-\VaucAOS,0){#3w}\pnode(\VaucAOS,0){#3e}%
|
511
|
+
\pnode(0,\VaucAOS){#3n}\pnode(0,-\VaucAOS){#3s}%
|
512
|
+
\ifthenelse{\equal{\VCIFflag}{1}}{}{%
|
513
|
+
\pnode(-\VaucAOSdiag,\VaucAOSdiag){#3nw}%
|
514
|
+
\pnode(\VaucAOSdiag,\VaucAOSdiag){#3ne}%
|
515
|
+
\pnode(-\VaucAOSdiag,-\VaucAOSdiag){#3sw}%
|
516
|
+
\pnode(\VaucAOSdiag,-\VaucAOSdiag){#3se}%
|
517
|
+
}%
|
518
|
+
}%
|
519
|
+
}%
|
520
|
+
}
|
521
|
+
%
|
522
|
+
\newcommand{\State}[3][{}]{\StateStyle\VaucState[#1]{#2}{#3}}
|
523
|
+
%
|
524
|
+
\newcommand{\FinalState}[3][{}]%
|
525
|
+
{\psset{style=VaucStateDblStyle}\VaucState[#1]{#2}{#3}}
|
526
|
+
%%% ecological commands
|
527
|
+
\newcommand{\StateIF}[3][{}]{\IFState\State[#1]{#2}{#3}\RstVCIF}%
|
528
|
+
\newcommand{\StateIFX}[3][{}]{\IFXState\State[#1]{#2}{#3}\RstVCIF}%
|
529
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
530
|
+
%%% Very Small State
|
531
|
+
\newcommand{\VSState}[2]%
|
532
|
+
{\renewcommand{\ArrowOnStateCoef}{\ArrowOnVerySmallState}%
|
533
|
+
\FixStateDiameter{\VerySmallStateDiameter}%
|
534
|
+
\ChgStateLineWidth{\VSStateLineCoef}%
|
535
|
+
\State{#1}{#2}%
|
536
|
+
\RstStateLineWidth\RstStateSize}% mod 020201
|
537
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
538
|
+
% white brace, of no width, used to place the label vertically
|
539
|
+
%\newlength{\BraceLength}
|
540
|
+
\newcommand{\WB}{%
|
541
|
+
\textcolor{white}{\{\!\!\!}}%
|
542
|
+
\newcommand{\HS}{}
|
543
|
+
\newlength{\ExtraSpace}
|
544
|
+
\setlength{\ExtraSpace}{1em}
|
545
|
+
%
|
546
|
+
\newcommand{\StateVar}[3][]%
|
547
|
+
{\StateStyle %
|
548
|
+
\settowidth{\VariableStateWidth}{\scalebox{\StateLabelSca}{\scalebox{\StateLabelScale}{$#1$}}}%
|
549
|
+
\addtolength{\VariableStateWidth}{\ExtraSpace}
|
550
|
+
\ifthenelse{\lengthtest{\VariableStateWidth < \VariableStateIntDiam}}%
|
551
|
+
{\setlength{\VariableStateWidth}{\VariableStateIntDiam}}{}%
|
552
|
+
\setlength{\VariableStateITPos}{\ArrowOnStateCoef\StateDiam}%
|
553
|
+
\addtolength{\VariableStateITPos}{0.5\VariableStateWidth}%
|
554
|
+
\addtolength{\VariableStateITPos}{-0.5\StateDiam}%
|
555
|
+
\rput#2{\pnode(\VariableStateITPos,0){#3e}%
|
556
|
+
\pnode(-\VariableStateITPos,0){#3w}%
|
557
|
+
\pnode(0,\ArrowOnStateCoef\StateDiam){#3n}%
|
558
|
+
\pnode(0,-\ArrowOnStateCoef\StateDiam){#3s}}%
|
559
|
+
\rput#2{\rnode{#3}{\psframebox{\protect\rule[-.5\VariableStateIntDiam]{0pt}{\VariableStateIntDiam}\protect\rule{\VariableStateWidth}{0pt}}}}
|
560
|
+
\rput#2{\VaucStateRBLabel{#1}}%
|
561
|
+
}%
|
562
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
563
|
+
\newcommand{\VarLoopOn}{\ChgLoopOffset{\LoopVarOff}%
|
564
|
+
\ChgLoopSize{\LoopVarSi}%
|
565
|
+
\ChgLoopAngle{\LoopVarAng}}
|
566
|
+
\newcommand{\VarLoopOff}{\RstLoopOffset \RstLoopSize \RstLoopAngle}
|
567
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
568
|
+
%%% Edge drawing parameters --- Initial settings
|
569
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
570
|
+
\newlength{\EdgeLineWid}
|
571
|
+
\setlength{\EdgeLineWid}{\EdgeLineWidth}
|
572
|
+
\newcommand{\EdgeLineSty}{\EdgeLineStyle}
|
573
|
+
\newcommand{\EdgeLineCol}{\EdgeLineColor}
|
574
|
+
% label
|
575
|
+
\newcommand{\EdgeLabelSca}{1}
|
576
|
+
\newcommand{\EdgeLabelCol}{\EdgeLabelColor}
|
577
|
+
% arrow
|
578
|
+
\newlength{\EdgeArrowSZDim}
|
579
|
+
\setlength{\EdgeArrowSZDim}{\EdgeArrowWidth}
|
580
|
+
\newcommand{\EdgeArrowSZNum}{\EdgeArrowLengthCoef}
|
581
|
+
\newcommand{\EdgeArrowSty}{\EdgeArrowStyle}
|
582
|
+
\newcommand{\EdgeArrowIns}{\EdgeArrowInset}
|
583
|
+
% border
|
584
|
+
\newlength{\EdgeLineBord}\setlength{\EdgeLineBord}{0pt}
|
585
|
+
%%% Zigzag edge parameter
|
586
|
+
\newlength{\ZZSiZ}
|
587
|
+
\setlength{\ZZSiZ}{\ZZSize}%
|
588
|
+
\newcommand{\ZZLineWid}{\ZZLineWidth}% coefficient multiplicateur
|
589
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
590
|
+
%%% Edge geometric parameters --- Initial settings
|
591
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
592
|
+
% Edge
|
593
|
+
\newlength{\EdgeOff}
|
594
|
+
\setlength{\EdgeOff}{\EdgeOffset}
|
595
|
+
% Arc
|
596
|
+
\newcommand{\VaucArcAng}{\VaucArcAngle}
|
597
|
+
\newcommand{\VaucLArcAng}{\VaucLArcAngle}
|
598
|
+
\newlength{\VaucArcOff}\setlength{\VaucArcOff}{\VaucArcOffset}
|
599
|
+
% Loop
|
600
|
+
\newcommand{\VaucArcCurv}{\VaucArcCurvature}
|
601
|
+
\newcommand{\VaucLArcCurv}{\VaucLArcCurvature}
|
602
|
+
\newcommand{\LoopAng}{\LoopAngle}
|
603
|
+
\newcommand{\CLoopAng}{\CLoopAngle}
|
604
|
+
\newcommand{\LoopVarAng}{\LoopVarAngle}
|
605
|
+
\newlength{\LoopOff}\setlength{\LoopOff}{\LoopOffset}
|
606
|
+
\newlength{\LoopVarOff}\setlength{\LoopVarOff}{\LoopVarOffset}
|
607
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
608
|
+
%%%%% Edge label parameters --- Initial settings
|
609
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
610
|
+
% label distance from transition
|
611
|
+
\newlength{\TransLabelSP}\setlength{\TransLabelSP}{\TransLabelSep}
|
612
|
+
% label position on transitions
|
613
|
+
\newcommand{\EdgeLabelPos}{\EdgeLabelPosit}
|
614
|
+
\newcommand{\ArcLabelPos}{\ArcLabelPosit}
|
615
|
+
\newcommand{\LArcLabelPos}{\LArcLabelPosit}
|
616
|
+
\newcommand{\LoopLabelPos}{\LoopLabelPosit}
|
617
|
+
\newcommand{\CLoopLabelPos}{\CLoopLabelPosit}
|
618
|
+
% label position on initial-final arrow
|
619
|
+
\newcommand{\InitStateLabelPos}{\InitStateLabelPosit}
|
620
|
+
\newcommand{\FinalStateLabelPos}{\FinalStateLabelPosit}
|
621
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
622
|
+
%%%%% Transition styles
|
623
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
624
|
+
\newpsstyle{VaucEdgeStyle}%
|
625
|
+
{arrows=\EdgeArrowSty,arrowsize=\EdgeArrowSZDim,arrowlength=\EdgeArrowSZNum,%
|
626
|
+
arrowinset=\EdgeArrowIns,%
|
627
|
+
linewidth=\EdgeLineWid,linecolor=\EdgeLineCol,linestyle=\EdgeLineSty,%
|
628
|
+
doubleline=false,%
|
629
|
+
bordercolor=\EdgeLineBorderColor,border=\EdgeLineBord,%
|
630
|
+
fillstyle=none,offset=\EdgeOff,%
|
631
|
+
labelsep=\TransLabelSP,nodesep=0pt}
|
632
|
+
\newpsstyle{VaucEdgeDblStyle}%
|
633
|
+
{arrows=\EdgeArrowSty,arrowsize=\EdgeArrowSZDim,arrowlength=\EdgeArrowSZNum,%
|
634
|
+
arrowinset=\EdgeArrowIns,%
|
635
|
+
linewidth=\EdgeLineDblCoef\EdgeLineWid,linecolor=\EdgeLineCol,linestyle=\EdgeLineSty,%
|
636
|
+
doubleline=true,doublesep=\EdgeLineDblSep\EdgeLineWid,%
|
637
|
+
bordercolor=\EdgeLineBorderColor,border=\EdgeLineBord,%
|
638
|
+
fillstyle=none,offset=\EdgeOff,%
|
639
|
+
labelsep=\TransLabelSP,nodesep=0pt}
|
640
|
+
%%% Arc
|
641
|
+
\newpsstyle{VaucArcR}{ncurv=\VaucArcCurv,arcangle=-\VaucArcAng,%
|
642
|
+
labelsep=\TransLabelSP,offset=-\VaucArcOff}
|
643
|
+
\newpsstyle{VaucArcL}{ncurv=\VaucArcCurv,arcangle=\VaucArcAng,%
|
644
|
+
labelsep=\TransLabelSP,offset=\VaucArcOff}
|
645
|
+
\newpsstyle{VaucLArcR}{ncurv=\VaucLArcCurv,arcangle=-\VaucLArcAng,%
|
646
|
+
labelsep=\TransLabelSP,offset=-\VaucArcOff}
|
647
|
+
\newpsstyle{VaucLArcL}{ncurv=\VaucLArcCurv,arcangle=\VaucLArcAng,%
|
648
|
+
labelsep=\TransLabelSP,offset=\VaucArcOff}
|
649
|
+
%%% zig-zag
|
650
|
+
\newpsstyle{VaucZigzagStyle}%
|
651
|
+
{linewidth=\ZZLineWid\EdgeLineWid,%
|
652
|
+
labelsep=\TransLabelSP,nodesep=0pt,%
|
653
|
+
coilwidth=1.2\ZZSiZ,coilarmA=0.1\ZZSiZ,%
|
654
|
+
coilarmB=0.3\ZZSiZ,coilheight=\ZZShape,linearc=1.6pt}
|
655
|
+
%%%
|
656
|
+
\newcommand{\EdgeStyle}{\ifEdgeLineDbl\psset{style=VaucEdgeDblStyle}%
|
657
|
+
\else\psset{style=VaucEdgeStyle}\fi}
|
658
|
+
\newcommand{\ZigzagStyle}%
|
659
|
+
{\addtolength{\TransLabelSP}{\TransLabelZZCoef\ZZSiZ}%
|
660
|
+
\psset{style=VaucZigzagStyle}%
|
661
|
+
\addtolength{\TransLabelSP}{-\TransLabelZZCoef\ZZSiZ}%
|
662
|
+
}
|
663
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
664
|
+
%%%%% Transition parameter changing and setting macros
|
665
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
666
|
+
%%% geometric parameters
|
667
|
+
\newcommand{\ChgEdgeOffset}[1]{\setlength{\EdgeOff}{#1}}
|
668
|
+
\newcommand{\RstEdgeOffset}{\ChgEdgeOffset{\EdgeOffset}}
|
669
|
+
\newcommand{\SetEdgeOffset}[1]%
|
670
|
+
{\setlength{\EdgeOffset}{#1}\RstEdgeOffset}
|
671
|
+
\newcommand{\ForthBackOffset}{%
|
672
|
+
\setlength{\EdgeOff}{\ForthBackEdgeOffset\EdgeLineWid}}
|
673
|
+
%
|
674
|
+
\newcommand{\ChgArcAngle}[1]{\renewcommand{\VaucArcAng}{#1}}
|
675
|
+
\newcommand{\RstArcAngle}{\ChgArcAngle{\VaucArcAngle}}
|
676
|
+
\newcommand{\SetArcAngle}[1]%
|
677
|
+
{\renewcommand{\VaucArcAngle}{#1}\RstArcAngle}
|
678
|
+
%
|
679
|
+
\newcommand{\ChgLArcAngle}[1]{\renewcommand{\VaucLArcAng}{#1}}
|
680
|
+
\newcommand{\RstLArcAngle}{\ChgLArcAngle{\VaucLArcAngle}}
|
681
|
+
\newcommand{\SetLArcAngle}[1]%
|
682
|
+
{\renewcommand{\VaucLArcAngle}{#1}\RstLArcAngle}
|
683
|
+
%
|
684
|
+
\newcommand{\ChgArcCurvature}[1]{\renewcommand{\VaucArcCurv}{#1}}
|
685
|
+
\newcommand{\RstArcCurvature}{\ChgArcCurvature{\VaucArcCurvature}}
|
686
|
+
\newcommand{\SetArcCurvature}[1]%
|
687
|
+
{\renewcommand{\VaucArcCurvature}{#1}\RstArcCurvature}
|
688
|
+
%
|
689
|
+
\newcommand{\ChgLArcCurvature}[1]{\renewcommand{\VaucLArcCurv}{#1}}
|
690
|
+
\newcommand{\RstLArcCurvature}{\ChgLArcCurvature{\VaucLArcCurvature}}
|
691
|
+
\newcommand{\SetLArcCurvature}[1]%
|
692
|
+
{\renewcommand{\VaucLArcCurvature}{#1}\RstLArcCurvature}
|
693
|
+
%
|
694
|
+
\newcommand{\ChgArcOffset}[1]{\setlength{\VaucArcOff}{#1}}
|
695
|
+
\newcommand{\RstArcOffset}{\setlength{\VaucArcOff}{\VaucArcOffset}}
|
696
|
+
\newcommand{\SetArcOffset}[1]%
|
697
|
+
{\renewcommand{\VaucArcOffset}{#1}\RstArcOffset}
|
698
|
+
%
|
699
|
+
\newcommand{\ChgLoopOffset}[1]{\setlength{\LoopOff}{#1}}
|
700
|
+
\newcommand{\RstLoopOffset}{\setlength{\LoopOff}{\LoopOffset}}
|
701
|
+
\newcommand{\SetLoopOffset}[1]%
|
702
|
+
{\renewcommand{\LoopOffset}{#1}\RstLoopOffset}
|
703
|
+
%
|
704
|
+
\newcommand{\ChgLoopAngle}[1]{\renewcommand{\LoopAng}{#1}}
|
705
|
+
\newcommand{\RstLoopAngle}{\ChgLoopAngle{\LoopAngle}}
|
706
|
+
\newcommand{\SetLoopAngle}[1]%
|
707
|
+
{\renewcommand{\LoopAngle}{#1}\RstLoopAngle}
|
708
|
+
%
|
709
|
+
\newcommand{\ChgCLoopAngle}[1]{\renewcommand{\CLoopAng}{#1}}
|
710
|
+
\newcommand{\RstCLoopAngle}{\ChgCLoopAngle{\CLoopAngle}}
|
711
|
+
\newcommand{\SetCLoopAngle}[1]%
|
712
|
+
{\renewcommand{\CLoopAngle}{#1}\RstCLoopAngle}
|
713
|
+
%
|
714
|
+
%%% drawing parameters
|
715
|
+
\newcommand{\ChgEdgeLineColor}[1]{\renewcommand{\EdgeLineCol}{#1}}
|
716
|
+
\newcommand{\RstEdgeLineColor}{\ChgEdgeLineColor{\EdgeLineColor}}
|
717
|
+
\newcommand{\SetEdgeLineColor}[1]%
|
718
|
+
{\renewcommand{\EdgeLineColor}{#1}\RstEdgeLineColor}
|
719
|
+
%
|
720
|
+
\newcommand{\ChgEdgeLineStyle}[1]{\renewcommand{\EdgeLineSty}{#1}}
|
721
|
+
\newcommand{\RstEdgeLineStyle}{\ChgEdgeLineStyle{\EdgeLineStyle}}
|
722
|
+
\newcommand{\SetEdgeLineStyle}[1]%
|
723
|
+
{\renewcommand{\EdgeLineStyle}{#1}\RstEdgeLineStyle}
|
724
|
+
%
|
725
|
+
\newcommand{\ChgEdgeLineWidth}[1]% coefficient !
|
726
|
+
{\setlength{\EdgeLineWid}{#1\EdgeLineWidth}}
|
727
|
+
\newcommand{\RstEdgeLineWidth}{\ChgEdgeLineWidth{1}}
|
728
|
+
\newcommand{\SetEdgeLineWidth}[1]% length !
|
729
|
+
{\setlength{\EdgeLineWidth}{#1}\RstEdgeLineWidth}
|
730
|
+
%
|
731
|
+
\newcommand{\EdgeLineDouble}%
|
732
|
+
{\EdgeLineDbltrue%
|
733
|
+
\ChgEdgeArrowWidth{\EdgeDblArrowWidth}
|
734
|
+
\ChgEdgeArrowLengthCoef{\EdgeDblArrowLengthCoef}}
|
735
|
+
\newcommand{\EdgeLineSimple}%
|
736
|
+
{\EdgeLineDblfalse \RstEdgeArrowWidth \RstEdgeArrowLengthCoef}
|
737
|
+
%
|
738
|
+
\newcommand{\ChgEdgeLabelColor}[1]{\renewcommand{\EdgeLabelCol}{#1}}
|
739
|
+
\newcommand{\RstEdgeLabelColor}{\ChgEdgeLabelColor{\EdgeLabelColor}}
|
740
|
+
\newcommand{\SetEdgeLabelColor}[1]%
|
741
|
+
{\renewcommand{\EdgeLabelColor}{#1}\RstEdgeLabelColor}
|
742
|
+
%
|
743
|
+
\newcommand{\ChgEdgeLabelScale}[1]{\renewcommand{\EdgeLabelSca}{#1}}
|
744
|
+
\newcommand{\RstEdgeLabelScale}{\ChgEdgeLabelScale{1}}
|
745
|
+
\newcommand{\SetEdgeLabelScale}[1]%
|
746
|
+
{\renewcommand{\EdgeLabelScale}{#1}\RstEdgeLabelScale}
|
747
|
+
\newcommand{\FixDimEdge}[4]{%
|
748
|
+
\renewcommand{\DimEdgeLineStyle}{#1}%
|
749
|
+
\renewcommand{\DimEdgeLineCoef}{#2}%
|
750
|
+
\renewcommand{\DimEdgeLineColor}{#3}%
|
751
|
+
\renewcommand{\DimEdgeLabelColor}{#4}}%
|
752
|
+
%
|
753
|
+
\newcommand{\ChgEdgeArrowStyle}[1]{\renewcommand{\EdgeArrowSty}{#1}}
|
754
|
+
\newcommand{\RstEdgeArrowStyle}{\ChgEdgeArrowStyle{\EdgeArrowStyle}}
|
755
|
+
\newcommand{\SetEdgeArrowStyle}[1]%
|
756
|
+
{\renewcommand{\EdgeArrowStyle}{#1}\RstEdgeArrowStyle}
|
757
|
+
%
|
758
|
+
\newcommand{\ChgEdgeArrowWidth}[1]%
|
759
|
+
{\setlength{\EdgeArrowSZDim}{#1}} % !! length !!
|
760
|
+
\newcommand{\RstEdgeArrowWidth}{\ChgEdgeArrowWidth{\EdgeArrowWidth}}
|
761
|
+
\newcommand{\SetEdgeArrowWidth}[1]%
|
762
|
+
{\setlength{\EdgeArrowWidth}{#1} \RstEdgeArrowWidth}
|
763
|
+
%
|
764
|
+
\newcommand{\ChgEdgeArrowLengthCoef}[1]{\renewcommand{\EdgeArrowSZNum}{#1}}
|
765
|
+
\newcommand{\RstEdgeArrowLengthCoef}{\ChgEdgeArrowLengthCoef{\EdgeArrowLengthCoef}}
|
766
|
+
\newcommand{\SetEdgeArrowLengthCoef}[1]%
|
767
|
+
{\renewcommand{\EdgeArrowLengthCoef}{#1}\RstEdgeArrowLengthCoef}
|
768
|
+
%
|
769
|
+
\newcommand{\ChgEdgeArrowInsetCoef}[1]{\renewcommand{\EdgeArrowIns}{#1}}
|
770
|
+
\newcommand{\RstEdgeArrowInsetCoef}{\ChgEdgeArrowInsetCoef{\EdgeArrowInset}}
|
771
|
+
\newcommand{\SetEdgeArrowInsetCoef}[1]%
|
772
|
+
{\renewcommand{\EdgeArrowInset}{#1}\RstEdgeArrowInsetCoef}
|
773
|
+
%
|
774
|
+
\newcommand{\ReverseArrow}%
|
775
|
+
{\ChgEdgeArrowStyle{\EdgeRevArrowStyle}%
|
776
|
+
\renewcommand{\EdgeLabelPos}{\EdgeLabelRevPosit}%
|
777
|
+
\renewcommand{\ArcLabelPos}{\ArcLabelRevPosit}%
|
778
|
+
\renewcommand{\LArcLabelPos}{\LArcLabelRevPosit}%
|
779
|
+
\renewcommand{\LoopLabelPos}{\LoopLabelRevPosit}%
|
780
|
+
\renewcommand{\CLoopLabelPos}{\CLoopLabelRevPosit}%
|
781
|
+
\renewcommand{\InitStateLabelPos}{\InitStateLabelRevPosit}%
|
782
|
+
\renewcommand{\FinalStateLabelPos}{\FinalStateLabelRevPosit}}
|
783
|
+
\newcommand{\StraightArrow}%
|
784
|
+
{\ChgEdgeArrowStyle{\EdgeArrowStyle}%
|
785
|
+
\renewcommand{\EdgeLabelPos}{\EdgeLabelPosit}%
|
786
|
+
\renewcommand{\ArcLabelPos}{\ArcLabelPosit}%
|
787
|
+
\renewcommand{\LArcLabelPos}{\LArcLabelPosit}%
|
788
|
+
\renewcommand{\LoopLabelPos}{\LoopLabelPosit}%
|
789
|
+
\renewcommand{\CLoopLabelPos}{\CLoopLabelPosit}%
|
790
|
+
\renewcommand{\InitStateLabelPos}{\InitStateLabelPosit}%
|
791
|
+
\renewcommand{\FinalStateLabelPos}{\FinalStateLabelPosit}}
|
792
|
+
% Double
|
793
|
+
\newcommand{\FixEdgeLineDouble}[2]{%
|
794
|
+
\renewcommand{\EdgeLineDblCoef}{#1}%
|
795
|
+
\renewcommand{\EdgeLineDblSep}{#2}}
|
796
|
+
% border
|
797
|
+
\newcommand{\FixEdgeBorder}[2]{%
|
798
|
+
\renewcommand{\EdgeLineBorderCoef}{#1}%
|
799
|
+
\renewcommand{\EdgeLineBorderColor}{#2}}
|
800
|
+
\newcommand{\EdgeBorder}%
|
801
|
+
{\setlength{\EdgeLineBord}{\EdgeLineBorderCoef\EdgeLineWid}}
|
802
|
+
\newcommand{\EdgeBorderOff}{\setlength{\EdgeLineBord}{0pt}}
|
803
|
+
%%%
|
804
|
+
\newcommand{\DimEdge}{%
|
805
|
+
\ChgEdgeLineStyle{\DimEdgeLineStyle}%
|
806
|
+
\ChgEdgeLineWidth{\DimEdgeLineCoef}%
|
807
|
+
\ChgEdgeLineColor{\DimEdgeLineColor}%
|
808
|
+
\ChgEdgeLabelColor{\DimEdgeLabelColor}}
|
809
|
+
%%%
|
810
|
+
\newcommand{\ChgZZSize}[1]{\setlength{\ZZSiZ}{#1}}
|
811
|
+
\newcommand{\RstZZSize}{\setlength{\ZZSiZ}{\ZZSize}}
|
812
|
+
\newcommand{\SetZZSize}[1]{\setlength{\ZZSiZe}{#1}\RstZZSize}
|
813
|
+
%%%\ZZLineWidth
|
814
|
+
\newcommand{\ChgZZLineWidth}[1]{\renewcommand{\ZZLineWid}{#1}}
|
815
|
+
\newcommand{\RstZZLineWidth}{\ChgZZLineWidth{\ZZLineWidth}}
|
816
|
+
\newcommand{\SetZZLineWidth}[1]%
|
817
|
+
{\renewcommand{\ZZLineWidth}{#1}\RstZZLineWidth}
|
818
|
+
%
|
819
|
+
%%% label of transitions
|
820
|
+
\newcommand{\VaucEdgeLabel}[1]{%
|
821
|
+
\textcolor{\EdgeLabelCol}{\scalebox{\EdgeLabelSca}{\scalebox{\EdgeLabelScale}{$ #1 $}}}}
|
822
|
+
%%%
|
823
|
+
\newcommand{\RstEdge}{%
|
824
|
+
\RstEdgeOffset\RstArcAngle\RstLArcAngle%
|
825
|
+
\RstArcCurvature\RstLArcCurvature%
|
826
|
+
\RstArcOffset\RstLoopOffset\RstLoopSize%
|
827
|
+
\RstEdgeLineColor\RstEdgeLineStyle\RstEdgeLineWidth\EdgeLineSimple%
|
828
|
+
\StraightArrow%\EdgeBorderOff%
|
829
|
+
\RstEdgeLabelScale\RstEdgeLabelColor}
|
830
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
831
|
+
%%%%% Initial-final arrow drawing
|
832
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
833
|
+
% implicit parameter
|
834
|
+
\newcommand{\InitialDir}{w}\newcommand{\FinalDir}{e}
|
835
|
+
% without label
|
836
|
+
\newcommand{\Initial}[2][\InitialDir]{\EdgeStyle\ncline{#2#1}{#2}}
|
837
|
+
\newcommand{\Final}[2][\FinalDir]{\EdgeStyle\ncline{#2}{#2#1}}
|
838
|
+
% with label
|
839
|
+
% NB modified syntax eg \InitialL[pos]{dir}{statename}{label}
|
840
|
+
\newcommand{\InitialL}[4][{\InitStateLabelPos}]%
|
841
|
+
{\EdgeStyle\ncline{#3#2}{#3}\naput[npos=#1]{\VaucEdgeLabel{#4}}}
|
842
|
+
\newcommand{\InitialR}[4][{\InitStateLabelPos}]%
|
843
|
+
{\EdgeStyle\ncline{#3#2}{#3}\nbput[npos=#1]{\VaucEdgeLabel{#4}}}
|
844
|
+
\newcommand{\FinalL}[4][{\FinalStateLabelPos}]%
|
845
|
+
{\EdgeStyle\ncline{#3}{#3#2}\naput[npos=#1]{\VaucEdgeLabel{#4}}}
|
846
|
+
\newcommand{\FinalR}[4][{\FinalStateLabelPos}]%
|
847
|
+
{\EdgeStyle\ncline{#3}{#3#2}\nbput[npos=#1]{\VaucEdgeLabel{#4}}}
|
848
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
849
|
+
%%%%% Transition drawing
|
850
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
851
|
+
\newcommand{\EdgeL}[4][{\EdgeLabelPos}]%
|
852
|
+
{\EdgeStyle \ncline{#2}{#3} \naput[npos=#1]{\VaucEdgeLabel{#4}}}
|
853
|
+
\newcommand{\EdgeR}[4][{\EdgeLabelPos}]%
|
854
|
+
{\EdgeStyle \ncline{#2}{#3} \nbput[npos=#1]{\VaucEdgeLabel{#4}}}
|
855
|
+
%
|
856
|
+
\newcommand{\ArcL}[4][{\ArcLabelPos}]%
|
857
|
+
{\EdgeStyle \psset{style=VaucArcL}%
|
858
|
+
\ncarc{#2}{#3} \naput[npos=#1]{\VaucEdgeLabel{#4}}}
|
859
|
+
\newcommand{\ArcR}[4][{\ArcLabelPos}]%
|
860
|
+
{\EdgeStyle \psset{style=VaucArcR}%
|
861
|
+
\ncarc{#2}{#3} \nbput[npos=#1]{\VaucEdgeLabel{#4}}}
|
862
|
+
\newcommand{\LArcL}[4][{\LArcLabelPos}]%
|
863
|
+
{\EdgeStyle \psset{style=VaucLArcL}%
|
864
|
+
\ncarc{#2}{#3} \naput[npos=#1]{\VaucEdgeLabel{#4}}}
|
865
|
+
\newcommand{\LArcR}[4][{\LArcLabelPos}]%
|
866
|
+
{\EdgeStyle \psset{style=VaucLArcR}%
|
867
|
+
\ncarc{#2}{#3} \nbput[npos=#1]{\VaucEdgeLabel{#4}}}
|
868
|
+
%
|
869
|
+
\newcounter{anglea}\newcounter{angleb}
|
870
|
+
\newcommand{\LoopXR}[7]%
|
871
|
+
{{\setcounter{anglea}{#2-#4}}%
|
872
|
+
{\setcounter{angleb}{#2+#4}}%
|
873
|
+
{\EdgeStyle \psset{angleA=\theanglea,angleB=\theangleb,offset=#5,ncurv=#6}%
|
874
|
+
\nccurve{#3}{#3} \nbput[npos=#1]{\VaucEdgeLabel{#7}}}}
|
875
|
+
\newcommand{\LoopXL}[7]%
|
876
|
+
{{\setcounter{anglea}{#2+#4}}%
|
877
|
+
{\setcounter{angleb}{#2-#4}}%
|
878
|
+
{\EdgeStyle \psset{angleA=\theanglea,angleB=\theangleb,offset=-#5,ncurv=#6}%
|
879
|
+
\nccurve{#3}{#3} \naput[npos=#1]{\VaucEdgeLabel{#7}}}}
|
880
|
+
\newcommand{\LoopR}[4][{\LoopLabelPos}]%
|
881
|
+
{\LoopXR{#1}{#2}{#3}{\LoopAng}{\LoopOff}{\LoopSi}{#4}}
|
882
|
+
\newcommand{\LoopL}[4][{\LoopLabelPos}]%
|
883
|
+
{\LoopXL{#1}{#2}{#3}{\LoopAng}{\LoopOff}{\LoopSi}{#4}}
|
884
|
+
\newcommand{\CLoopR}[4][{\CLoopLabelPos}]%
|
885
|
+
{\LoopXR{#1}{#2}{#3}{\CLoopAng}{\LoopOff}{\LoopSi}{#4}}
|
886
|
+
\newcommand{\CLoopL}[4][{\CLoopLabelPos}]%
|
887
|
+
{\LoopXL{#1}{#2}{#3}{\CLoopAng}{\LoopOff}{\LoopSi}{#4}}
|
888
|
+
\newcommand{\LoopVarR}[4][{\LoopLabelPos}]%
|
889
|
+
{\LoopXR{#1}{#2}{#3}{\LoopVarAng}{\LoopVarOff}{\LoopVarSi}{#4}}
|
890
|
+
\newcommand{\LoopVarL}[4][{\LoopLabelPos}]%
|
891
|
+
{\LoopXL{#1}{#2}{#3}{\LoopVarAng}{\LoopVarOff}{\LoopVarSi}{#4}}
|
892
|
+
\newcommand{\LoopW}[3][{\LoopLabelPos}]{\LoopR[#1]{180}{#2}{#3}}
|
893
|
+
\newcommand{\LoopE}[3][{\LoopLabelPos}]{\LoopL[#1]{0}{#2}{#3}}
|
894
|
+
\newcommand{\LoopN}[3][{\LoopLabelPos}]{\LoopL[#1]{90}{#2}{#3}}
|
895
|
+
\newcommand{\LoopS}[3][{\LoopLabelPos}]{\LoopR[#1]{-90}{#2}{#3}}
|
896
|
+
\newcommand{\LoopNW}[3][{\LoopLabelPos}]{\LoopR[#1]{135}{#2}{#3}}
|
897
|
+
\newcommand{\LoopNE}[3][{\LoopLabelPos}]{\LoopL[#1]{45}{#2}{#3}}
|
898
|
+
\newcommand{\LoopSW}[3][{\LoopLabelPos}]{\LoopL[#1]{-135}{#2}{#3}}
|
899
|
+
\newcommand{\LoopSE}[3][{\LoopLabelPos}]{\LoopR[#1]{-45}{#2}{#3}}
|
900
|
+
\newcommand{\CLoopW}[3][{\CLoopLabelPos}]{\CLoopR[#1]{180}{#2}{#3}}
|
901
|
+
\newcommand{\CLoopE}[3][{\CLoopLabelPos}]{\CLoopL[#1]{0}{#2}{#3}}
|
902
|
+
\newcommand{\CLoopN}[3][{\CLoopLabelPos}]{\CLoopL[#1]{90}{#2}{#3}}
|
903
|
+
\newcommand{\CLoopS}[3][{\CLoopLabelPos}]{\CLoopR[#1]{-90}{#2}{#3}}
|
904
|
+
\newcommand{\CLoopNW}[3][{\CLoopLabelPos}]{\CLoopR[#1]{135}{#2}{#3}}
|
905
|
+
\newcommand{\CLoopNE}[3][{\CLoopLabelPos}]{\CLoopL[#1]{45}{#2}{#3}}
|
906
|
+
\newcommand{\CLoopSW}[3][{\CLoopLabelPos}]{\CLoopL[#1]{-135}{#2}{#3}}
|
907
|
+
\newcommand{\CLoopSE}[3][{\CLoopLabelPos}]{\CLoopR[#1]{-45}{#2}{#3}}
|
908
|
+
\newcommand{\LoopVarN}[3][{\CLoopLabelPos}]{\LoopVarL[#1]{90}{#2}{#3}}
|
909
|
+
\newcommand{\LoopVarS}[3][{\CLoopLabelPos}]{\LoopVarR[#1]{-90}{#2}{#3}}
|
910
|
+
%
|
911
|
+
\newcommand{\ZZEdge}[2]%
|
912
|
+
{\EdgeStyle\ZigzagStyle\nczigzag{#1}{#2}}%
|
913
|
+
\newcommand{\ZZEdgeL}[4][{\EdgeLabelRevPosit}]%
|
914
|
+
{\EdgeStyle\ZigzagStyle\nczigzag{#2}{#3}%
|
915
|
+
\naput[npos=#1]{\VaucEdgeLabel{#4}}}
|
916
|
+
\newcommand{\ZZEdgeR}[4][{\EdgeLabelRevPosit}]%
|
917
|
+
{\EdgeStyle\ZigzagStyle\nczigzag{#2}{#3}%
|
918
|
+
\nbput[npos=#1]{\VaucEdgeLabel{#4}}}
|
919
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
920
|
+
%%%%% Reprise des macros pstricks
|
921
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
922
|
+
\newcommand{\Point}[2]{\pnode#1{#2}}
|
923
|
+
\newcommand{\Edge}[2]{\EdgeStyle\ncline{#1}{#2}}
|
924
|
+
%
|
925
|
+
\newcommand{\VArcL}[5][{\ArcLabelPos}]%
|
926
|
+
{\EdgeStyle \psset{style=VaucLArcL}%
|
927
|
+
\ncarc[#2]{#3}{#4} \naput[npos=#1]{\VaucEdgeLabel{#5}}}
|
928
|
+
\newcommand{\VArcR}[5][{\ArcLabelPos}]%
|
929
|
+
{\EdgeStyle \psset{style=VaucLArcR}%
|
930
|
+
\ncarc[#2]{#3}{#4} \nbput[npos=#1]{\VaucEdgeLabel{#5}}}
|
931
|
+
%
|
932
|
+
\newcommand{\VCurveL}[5][{\ArcLabelPos}]%
|
933
|
+
{\EdgeStyle \psset{angleA=0,angleB=180,ncurv=1}%
|
934
|
+
\nccurve[#2]{#3}{#4} \naput[npos=#1]{\VaucEdgeLabel{#5}}}
|
935
|
+
\newcommand{\VCurveR}[5][{\ArcLabelPos}]%
|
936
|
+
{\EdgeStyle \psset{angleA=0,angleB=0,ncurv=1}%
|
937
|
+
\nccurve[#2]{#3}{#4} \nbput[npos=#1]{\VaucEdgeLabel{#5}}}
|
938
|
+
%
|
939
|
+
\newcommand{\LabelL}[2][{\EdgeLabelPos}]%
|
940
|
+
{\naput[npos=#1]{\VaucEdgeLabel{#2}}}
|
941
|
+
\newcommand{\LabelR}[2][{\EdgeLabelPos}]%
|
942
|
+
{\nbput[npos=#1]{\VaucEdgeLabel{#2}}}
|
943
|
+
%
|
944
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
945
|
+
\endinput
|
946
|
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|