-
Notifications
You must be signed in to change notification settings - Fork 0
/
reused_graphs.ts
109 lines (103 loc) · 4.7 KB
/
reused_graphs.ts
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
import { AutomatonGraph } from 'state-diagram-renderer';
export const COMPLICATED_TRIANGLE: AutomatonGraph = {
vertices: [
{ id: "1", center: { x: 0, y: 0 } },
{ id: "2", center: { x: 1, y: 0 }, is_final: true },
{ id: "3", center: { x: 0.5, y: Math.sqrt(3) / 2 }, is_final: true },
], initial_vertex: "1", straight_edges: [
{ label: "ニ", from: "1", to: "2", config: { bring_edge_label_closer: true, arrow_is_offset: true } },
{ label: "ニ", from: "2", to: "1", config: { bring_edge_label_closer: true, arrow_is_offset: true } },
{ label: "コ", from: "1", to: "3", config: { bring_edge_label_closer: true, arrow_is_offset: true } },
{ label: "コ", from: "3", to: "1", config: { bring_edge_label_closer: true, arrow_is_offset: true } },
{ label: "ニ", from: "3", to: "2", config: { bring_edge_label_closer: true } },
], self_loops: [
{ label: "コ", from_eq_to: "2", config: { self_loop_rotation: -30 } }
]
};
export const NICONICO_SANDWICHED_BY_NI: AutomatonGraph = {
vertices: [
{ id: "q1", center: { x: 0, y: 0 } },
{ id: "q2", center: { x: 1, y: 0 } },
{ id: "q4", center: { x: 2, y: 0 }, is_final: true },
{ id: "q3", center: { x: 1, y: 1 } }
],
straight_edges: [
{ label: "ε", from: "q1", to: "q2" },
{ label: "ニ", from: "q2", to: "q3", config: { arrow_is_offset: true } },
{ label: "コ", from: "q3", to: "q2", config: { arrow_is_offset: true } },
{ label: "ε", from: "q2", to: "q4" },
], self_loops: [
{ label: "ニ", from_eq_to: "q1", config: { self_loop_rotation: -90 } },
{ label: "ニ", from_eq_to: "q4", config: { self_loop_rotation: -90 } }
],
initial_vertex: "q1"
};
export const ENDS_WITH_NICO: AutomatonGraph = {
vertices: [
{ id: "q1", center: { x: 0, y: Math.sqrt(3) / 2 } },
{ id: "q2", center: { x: 0.5, y: 0 } },
{ id: "q3", center: { x: 1, y: Math.sqrt(3) / 2 }, is_final: true },
], initial_vertex: "q1", straight_edges: [
{ label: "ニ", from: "q1", to: "q2" },
{ label: "コ", from: "q3", to: "q1" },
{ label: "コ", from: "q2", to: "q3", config: { arrow_is_offset: true } },
{ label: "ニ", from: "q3", to: "q2", config: { arrow_is_offset: true } },
], self_loops: [
{ label: "コ", from_eq_to: "q1", config: { self_loop_rotation: 90 } },
{ label: "ニ", from_eq_to: "q2", config: { self_loop_rotation: -90 } },
]
}
export const NINICOCO_FORMAL: AutomatonGraph = {
vertices: [
{ id: "q1", center: { x: 0, y: 0 } },
{ id: "q2", center: { x: 1, y: 0 } },
{ id: "q3", center: { x: 2, y: 0 }, is_final: true },
], initial_vertex: "q1", self_loops: [
{ label: "ニ, 床→皿床", from_eq_to: "q1", config: { self_loop_rotation: -90 } },
{ label: "ニ, 皿→皿皿", from_eq_to: "q1", config: { self_loop_rotation: 90 } },
{ label: "コ, 皿→ε", from_eq_to: "q2", config: { self_loop_rotation: -90 } },
], straight_edges: [
{ label: "コ, 皿→ε", from: "q1", to: "q2" },
{ label: "ε, 床→床", from: "q2", to: "q3" },
]
};
export const CO_NI_STAR_CO_STAR: AutomatonGraph = {
vertices: [
{ id: "q1", center: { x: 0, y: 0 } },
{ id: "q2", center: { x: 1, y: 0 } },
{ id: "q3", center: { x: 2, y: 0 }, is_final: true },
], initial_vertex: "q1", self_loops: [
{ label: "ニ", from_eq_to: "q2", config: { self_loop_rotation: 90 } },
{ label: "コ", from_eq_to: "q3", config: { self_loop_rotation: 90 } },
], straight_edges: [
{ label: "コ", from: "q1", to: "q2" },
{ label: "ε", from: "q2", to: "q3" },
]
};
export const NI_N_CO_N: AutomatonGraph = {
vertices: [
{ id: "q1", center: { x: 0, y: 0 } },
{ id: "q2", center: { x: 1, y: 0 } },
{ id: "q3", center: { x: 2, y: 0 }, is_final: true },
], initial_vertex: "q1", self_loops: [
{ label: "ニ, 皿を追加", from_eq_to: "q1", config: { self_loop_rotation: -90 } },
{ label: "コ, 皿を除去", from_eq_to: "q2", config: { self_loop_rotation: -90 } },
], straight_edges: [
{ label: "コ, 皿を除去", from: "q1", to: "q2" },
{ label: "ε, 床を観測", from: "q2", to: "q3" },
]
};
export const ARRAY_AND_8: AutomatonGraph = {
vertices: [
{ id: "q1", center: { x: 0, y: 0 } },
{ id: "q2", center: { x: 1, y: 0 } },
{ id: "q3", center: { x: 2, y: 0 }, is_final: true },
], initial_vertex: "q1", self_loops: [
{ label: "[, 皿を追加", from_eq_to: "q1", config: { self_loop_rotation: -90 } },
{ label: "], 皿を除去", from_eq_to: "q2", config: { self_loop_rotation: -90 } },
], straight_edges: [
{ label: "8, そのまま", from: "q1", to: "q2", config: { label_ad_hoc_offset: { local_x: 0, local_y: -10 } } },
{ label: "], 皿を除去", from: "q1", to: "q2" },
{ label: "ε, 床を観測", from: "q2", to: "q3" },
]
};