gfsmAlgebra.h
Go to the documentation of this file.
1 
2 /*=============================================================================*\
3  * File: gfsmAlgebra.h
4  * Author: Bryan Jurish <moocow.bovine@gmail.com>
5  * Description: finite state machine library
6  *
7  * Copyright (c) 2004-2007 Bryan Jurish.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 3 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22  *=============================================================================*/
23 
28 #ifndef _GFSM_ALGEBRA_H
29 #define _GFSM_ALGEBRA_H
30 
31 #include <gfsmCompound.h>
32 #include <gfsmArcIndex.h>
33 
34 /*======================================================================
35  * Methods: algebra
36  */
37 
38 //------------------------------
40 
41 
51 gfsmAutomaton *gfsm_automaton_closure(gfsmAutomaton *fsm, gboolean is_plus);
52 
53 /* Final-state pre-traversal utility for \c closure(fsm). */
54 //gboolean gfsm_automaton_closure_final_func_(gfsmStateId id, gpointer pw, gfsmAutomaton *fsm);
55 
64 
73 
74 //------------------------------
76 
77 
84 
94 
105  gfsmAlphabet *alph,
106  gfsmStateId *sinkp);
108 
109 //------------------------------
111 
112 
129 
130 
147  gfsmAutomaton *fsm2,
148  gfsmAutomaton *composition,
149  gfsmComposeStateEnum *spenum);
150 
151 typedef guint32 gfsmComposeFlags;
154 typedef enum {
158 
161  gfsmAutomaton *fsm1,
162  gfsmAutomaton *fsm2,
163  gfsmAutomaton *fsm,
164  gfsmComposeStateEnum *spenum,
165  GArray *spenumr, //-- GArray of gfsmComposeState
166  GQueue *queue, //-- queue of gfsmStateId
167  gfsmComposeFlags flags);
169 
170 //------------------------------
172 
173 
182 
191 
192 /* Final-state pre-traversal utility for \a concat(fsm,fsm2).
193  *
194  * \note Assumes \a fsm->root_id has been temporarily set to the translated gfsmStateId
195  * of \a fsm2->root_id.
196  *
197  * \param pw final ::gfsmWeight encoded as a gpointer (e.g. with gfsm_weight2ptr())
198  * \param fsm concatenation first argument / return value
199  * \returns FALSE
200  */
201 //gboolean gfsm_automaton_concat_final_func_(gfsmStateId id, gpointer pw, gfsmAutomaton *fsm);
202 
204 
205 //------------------------------
207 
208 
217 
230 
246  gfsmReverseArcIndex *rarcs,
247  gfsmBitVector *finalizable);
248 
259 
261 
262 //------------------------------
264 
265 
280 
292 
294 #define gfsm_automaton_determinise(fsm) gfsm_automaton_determinize(fsm)
295 
297 #define gfsm_automaton_determinise_full(nfa,dfa) gfsm_automaton_determinize_full((nfa),(dfa))
298 
300 
301 //------------------------------
303 
304 
316 
329  gfsmAutomaton *fsm2,
330  gfsmAutomaton *diff);
331 
333 
334 //------------------------------
336 
337 
346 
358  gfsmAutomaton *fsm2,
359  gfsmAutomaton *intersect,
360  gfsmStatePairEnum *spenum);
361 
366  gfsmAutomaton *fsm1,
367  gfsmAutomaton *fsm2,
368  gfsmAutomaton *fsm,
369  gfsmStatePairEnum *spenum,
370  gfsmComposeFlags flags);
372 
373 //------------------------------
375 
376 
386 
400 
410 
419 
421 
422 
423 //------------------------------
425 
426 
434 
445 
447 
448 //------------------------------
450 
451 
461 
470 
471 /* Backwards-compatible alias for gfsm_automaton_product2() [DISABLED] */
472 //#define _gfsm_automaton_product gfsm_automaton_product2
473 
475 
476 
477 //------------------------------
479 
480 
489 
501  gfsmStateId q1from,
502  gfsmStateId q1to,
503  gfsmAutomaton *fsm2,
504  gfsmWeight w);
505 
507 
508 
509 //------------------------------
511 
512 
519 
521 
522 //------------------------------
524 
525 
542 
544 
545 //------------------------------
547 
548 
557 
558 //------------------------------
560 
561 
570 
579 #endif /* _GFSM_ALGEBRA_H */