regex_dotpdf/2 : regex to minimum automaton in PDF

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

regex_dotpdf/2 : regex to minimum automaton in PDF

Kuniaki Mukai


I have added a demo program "regex_dotpdf"/2 to  "pac" package 0.5.8.
The progoram translates a regex  to an automaton in PDF file.

         regex_dotpdf(+Regex, +Path)

 regex_dotpdf produces two files   <Path>.dot and <Path>.pdf
 for a regex <Regex>.

The regex_dotpdf/2 assumes  the graphviz command line "dot"  installed.

This small demo codes was extracted from a large and messy codes
in  my private library using  the swi-prolog package


Useful package !  Without the package, this demo program has never come to
my mind. Thanks for the author.

regex_dotpdf/2 program has not been fully verified, it may has bugs,
even serious ones.  But as far as various small examples,
it produces the minimum states automaton as I designed.

I will appreciate any feedbacks.


% swipl
Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 7.1.23-28-g70f014a)

?- use_module(library(pac)).

?- use_module(library(pac/'pac-demo')).

?- module(pac_demo).

pac_demo:  ?- regex_dotpdf("[ab]*", '~/Desktop/demo').
true .

pac_demo:  ?-

Kuaniki Mukai

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <>
SWI-Prolog mailing list
[hidden email]