From: notifies s. of c. c. <per...@li...> - 2007-02-09 17:25:14
|
Revision: 85 http://svn.sourceforge.net/perl-flat/?rev=85&view=rev Author: estrabd Date: 2007-02-09 09:17:25 -0800 (Fri, 09 Feb 2007) Log Message: ----------- cleaned up Removed Paths: ------------- trunk/perl-flat/dev-scripts/dfa.gdl trunk/perl-flat/dev-scripts/dfa.png trunk/perl-flat/dev-scripts/mindfa.gdl trunk/perl-flat/dev-scripts/mindfa.png trunk/perl-flat/dev-scripts/nfa.gdl trunk/perl-flat/dev-scripts/nfa.png trunk/perl-flat/dev-scripts/output.png trunk/perl-flat/dev-scripts/pfa.gdl trunk/perl-flat/dev-scripts/pfa.png Deleted: trunk/perl-flat/dev-scripts/dfa.gdl =================================================================== --- trunk/perl-flat/dev-scripts/dfa.gdl 2007-02-09 17:16:21 UTC (rev 84) +++ trunk/perl-flat/dev-scripts/dfa.gdl 2007-02-09 17:17:25 UTC (rev 85) @@ -1,72 +0,0 @@ -graph: { -display_edge_labels: yes - -node: { title:"0" shape:circle borderstyle: solid} -node: { title:"1" shape:circle borderstyle: solid} -node: { title:"2" shape:circle borderstyle: solid} -node: { title:"3" shape:circle borderstyle: solid} -node: { title:"4" shape:circle borderstyle: solid} -node: { title:"5" shape:circle borderstyle: solid} -node: { title:"6" shape:circle borderstyle: solid} -node: { title:"7" shape:circle borderstyle: solid} -node: { title:"8" shape:circle borderstyle: solid} -node: { title:"9" shape:circle borderstyle: solid} -node: { title:"10" shape:circle borderstyle: solid} -node: { title:"11" shape:circle borderstyle: solid} -node: { title:"12" shape:circle borderstyle: solid} -node: { title:"13" shape:circle borderstyle: solid} -node: { title:"14" shape:circle borderstyle: solid} -node: { title:"15" shape:circle borderstyle: solid} -node: { title:"16" shape:circle borderstyle: double bordercolor: red} - -edge: { source: "0" target: "1" label: "c" arrowstyle: line } -edge: { source: "0" target: "2" label: "a" arrowstyle: line } -edge: { source: "0" target: "3" label: "b" arrowstyle: line } -edge: { source: "0" target: "4" label: "d" arrowstyle: line } -edge: { source: "1" target: "5" label: "c" arrowstyle: line } -edge: { source: "1" target: "6" label: "a" arrowstyle: line } -edge: { source: "1" target: "7" label: "b" arrowstyle: line } -edge: { source: "1" target: "8" label: "d" arrowstyle: line } -edge: { source: "2" target: "5" label: "a" arrowstyle: line } -edge: { source: "2" target: "6" label: "c" arrowstyle: line } -edge: { source: "2" target: "9" label: "b" arrowstyle: line } -edge: { source: "2" target: "10" label: "d" arrowstyle: line } -edge: { source: "3" target: "5" label: "b" arrowstyle: line } -edge: { source: "3" target: "7" label: "c" arrowstyle: line } -edge: { source: "3" target: "9" label: "a" arrowstyle: line } -edge: { source: "3" target: "11" label: "d" arrowstyle: line } -edge: { source: "4" target: "5" label: "d" arrowstyle: line } -edge: { source: "4" target: "8" label: "c" arrowstyle: line } -edge: { source: "4" target: "10" label: "a" arrowstyle: line } -edge: { source: "4" target: "11" label: "b" arrowstyle: line } -edge: { source: "5" target: "5" label: "a,b,c,d" arrowstyle: line } -edge: { source: "6" target: "5" label: "a,c" arrowstyle: line } -edge: { source: "6" target: "12" label: "b" arrowstyle: line } -edge: { source: "6" target: "13" label: "d" arrowstyle: line } -edge: { source: "7" target: "5" label: "b,c" arrowstyle: line } -edge: { source: "7" target: "12" label: "a" arrowstyle: line } -edge: { source: "7" target: "14" label: "d" arrowstyle: line } -edge: { source: "8" target: "5" label: "c,d" arrowstyle: line } -edge: { source: "8" target: "13" label: "a" arrowstyle: line } -edge: { source: "8" target: "14" label: "b" arrowstyle: line } -edge: { source: "9" target: "5" label: "a,b" arrowstyle: line } -edge: { source: "9" target: "12" label: "c" arrowstyle: line } -edge: { source: "9" target: "15" label: "d" arrowstyle: line } -edge: { source: "10" target: "5" label: "a,d" arrowstyle: line } -edge: { source: "10" target: "13" label: "c" arrowstyle: line } -edge: { source: "10" target: "15" label: "b" arrowstyle: line } -edge: { source: "11" target: "5" label: "b,d" arrowstyle: line } -edge: { source: "11" target: "14" label: "c" arrowstyle: line } -edge: { source: "11" target: "15" label: "a" arrowstyle: line } -edge: { source: "12" target: "5" label: "a,b,c" arrowstyle: line } -edge: { source: "12" target: "16" label: "d" arrowstyle: line } -edge: { source: "13" target: "5" label: "a,c,d" arrowstyle: line } -edge: { source: "13" target: "16" label: "b" arrowstyle: line } -edge: { source: "14" target: "5" label: "b,c,d" arrowstyle: line } -edge: { source: "14" target: "16" label: "a" arrowstyle: line } -edge: { source: "15" target: "5" label: "a,b,d" arrowstyle: line } -edge: { source: "15" target: "16" label: "c" arrowstyle: line } -edge: { source: "16" target: "5" label: "a,b,c,d" arrowstyle: line } -} - - Deleted: trunk/perl-flat/dev-scripts/dfa.png =================================================================== (Binary files differ) Deleted: trunk/perl-flat/dev-scripts/mindfa.gdl =================================================================== --- trunk/perl-flat/dev-scripts/mindfa.gdl 2007-02-09 17:16:21 UTC (rev 84) +++ trunk/perl-flat/dev-scripts/mindfa.gdl 2007-02-09 17:17:25 UTC (rev 85) @@ -1,55 +0,0 @@ -graph: { -display_edge_labels: yes - -node: { title:"0" shape:circle borderstyle: solid} -node: { title:"1" shape:circle borderstyle: solid} -node: { title:"2" shape:circle borderstyle: solid} -node: { title:"3" shape:circle borderstyle: solid} -node: { title:"4" shape:circle borderstyle: solid} -node: { title:"5" shape:circle borderstyle: solid} -node: { title:"6" shape:circle borderstyle: solid} -node: { title:"7" shape:circle borderstyle: solid} -node: { title:"8" shape:circle borderstyle: solid} -node: { title:"9" shape:circle borderstyle: solid} -node: { title:"10" shape:circle borderstyle: solid} -node: { title:"11" shape:circle borderstyle: solid} -node: { title:"12" shape:circle borderstyle: solid} -node: { title:"13" shape:circle borderstyle: solid} -node: { title:"14" shape:circle borderstyle: solid} -node: { title:"15" shape:circle borderstyle: double bordercolor: red} - -edge: { source: "0" target: "1" label: "c" arrowstyle: line } -edge: { source: "0" target: "2" label: "a" arrowstyle: line } -edge: { source: "0" target: "3" label: "b" arrowstyle: line } -edge: { source: "0" target: "4" label: "d" arrowstyle: line } -edge: { source: "1" target: "5" label: "a" arrowstyle: line } -edge: { source: "1" target: "6" label: "b" arrowstyle: line } -edge: { source: "1" target: "7" label: "d" arrowstyle: line } -edge: { source: "2" target: "5" label: "c" arrowstyle: line } -edge: { source: "2" target: "8" label: "b" arrowstyle: line } -edge: { source: "2" target: "9" label: "d" arrowstyle: line } -edge: { source: "3" target: "6" label: "c" arrowstyle: line } -edge: { source: "3" target: "8" label: "a" arrowstyle: line } -edge: { source: "3" target: "10" label: "d" arrowstyle: line } -edge: { source: "4" target: "7" label: "c" arrowstyle: line } -edge: { source: "4" target: "9" label: "a" arrowstyle: line } -edge: { source: "4" target: "10" label: "b" arrowstyle: line } -edge: { source: "5" target: "11" label: "b" arrowstyle: line } -edge: { source: "5" target: "12" label: "d" arrowstyle: line } -edge: { source: "6" target: "11" label: "a" arrowstyle: line } -edge: { source: "6" target: "13" label: "d" arrowstyle: line } -edge: { source: "7" target: "12" label: "a" arrowstyle: line } -edge: { source: "7" target: "13" label: "b" arrowstyle: line } -edge: { source: "8" target: "11" label: "c" arrowstyle: line } -edge: { source: "8" target: "14" label: "d" arrowstyle: line } -edge: { source: "9" target: "12" label: "c" arrowstyle: line } -edge: { source: "9" target: "14" label: "b" arrowstyle: line } -edge: { source: "10" target: "13" label: "c" arrowstyle: line } -edge: { source: "10" target: "14" label: "a" arrowstyle: line } -edge: { source: "11" target: "15" label: "d" arrowstyle: line } -edge: { source: "12" target: "15" label: "b" arrowstyle: line } -edge: { source: "13" target: "15" label: "a" arrowstyle: line } -edge: { source: "14" target: "15" label: "c" arrowstyle: line } -} - - Deleted: trunk/perl-flat/dev-scripts/mindfa.png =================================================================== (Binary files differ) Deleted: trunk/perl-flat/dev-scripts/nfa.gdl =================================================================== --- trunk/perl-flat/dev-scripts/nfa.gdl 2007-02-09 17:16:21 UTC (rev 84) +++ trunk/perl-flat/dev-scripts/nfa.gdl 2007-02-09 17:17:25 UTC (rev 85) @@ -1,59 +0,0 @@ -graph: { -display_edge_labels: yes - -node: { title:"0" shape:circle borderstyle: solid} -node: { title:"1" shape:circle borderstyle: solid} -node: { title:"2" shape:circle borderstyle: solid} -node: { title:"3" shape:circle borderstyle: solid} -node: { title:"4" shape:circle borderstyle: solid} -node: { title:"5" shape:circle borderstyle: solid} -node: { title:"6" shape:circle borderstyle: solid} -node: { title:"7" shape:circle borderstyle: solid} -node: { title:"8" shape:circle borderstyle: solid} -node: { title:"9" shape:circle borderstyle: solid} -node: { title:"10" shape:circle borderstyle: solid} -node: { title:"11" shape:circle borderstyle: solid} -node: { title:"12" shape:circle borderstyle: double bordercolor: red} -node: { title:"13" shape:circle borderstyle: solid} -node: { title:"14" shape:circle borderstyle: solid} -node: { title:"15" shape:circle borderstyle: solid} -node: { title:"16" shape:circle borderstyle: solid} -node: { title:"17" shape:circle borderstyle: solid} - -edge: { source: "0" target: "1" label: "epsilon" arrowstyle: line } -edge: { source: "1" target: "2" label: "c" arrowstyle: line } -edge: { source: "1" target: "3" label: "a" arrowstyle: line } -edge: { source: "1" target: "4" label: "b" arrowstyle: line } -edge: { source: "1" target: "5" label: "d" arrowstyle: line } -edge: { source: "2" target: "6" label: "d" arrowstyle: line } -edge: { source: "2" target: "14" label: "b" arrowstyle: line } -edge: { source: "2" target: "17" label: "a" arrowstyle: line } -edge: { source: "3" target: "7" label: "d" arrowstyle: line } -edge: { source: "3" target: "15" label: "b" arrowstyle: line } -edge: { source: "3" target: "17" label: "c" arrowstyle: line } -edge: { source: "4" target: "8" label: "d" arrowstyle: line } -edge: { source: "4" target: "14" label: "c" arrowstyle: line } -edge: { source: "4" target: "15" label: "a" arrowstyle: line } -edge: { source: "5" target: "6" label: "c" arrowstyle: line } -edge: { source: "5" target: "7" label: "a" arrowstyle: line } -edge: { source: "5" target: "8" label: "b" arrowstyle: line } -edge: { source: "6" target: "9" label: "b" arrowstyle: line } -edge: { source: "6" target: "13" label: "a" arrowstyle: line } -edge: { source: "7" target: "10" label: "b" arrowstyle: line } -edge: { source: "7" target: "13" label: "c" arrowstyle: line } -edge: { source: "8" target: "9" label: "c" arrowstyle: line } -edge: { source: "8" target: "10" label: "a" arrowstyle: line } -edge: { source: "9" target: "11" label: "a" arrowstyle: line } -edge: { source: "10" target: "11" label: "c" arrowstyle: line } -edge: { source: "11" target: "12" label: "epsilon" arrowstyle: line } -edge: { source: "13" target: "11" label: "b" arrowstyle: line } -edge: { source: "14" target: "9" label: "d" arrowstyle: line } -edge: { source: "14" target: "16" label: "a" arrowstyle: line } -edge: { source: "15" target: "10" label: "d" arrowstyle: line } -edge: { source: "15" target: "16" label: "c" arrowstyle: line } -edge: { source: "16" target: "11" label: "d" arrowstyle: line } -edge: { source: "17" target: "13" label: "d" arrowstyle: line } -edge: { source: "17" target: "16" label: "b" arrowstyle: line } -} - - Deleted: trunk/perl-flat/dev-scripts/nfa.png =================================================================== (Binary files differ) Deleted: trunk/perl-flat/dev-scripts/output.png =================================================================== (Binary files differ) Deleted: trunk/perl-flat/dev-scripts/pfa.gdl =================================================================== --- trunk/perl-flat/dev-scripts/pfa.gdl 2007-02-09 17:16:21 UTC (rev 84) +++ trunk/perl-flat/dev-scripts/pfa.gdl 2007-02-09 17:17:25 UTC (rev 85) @@ -1,29 +0,0 @@ -graph: { -display_edge_labels: yes - -node: { title:"0" shape:circle borderstyle: solid} -node: { title:"1" shape:circle borderstyle: solid} -node: { title:"2" shape:circle borderstyle: solid} -node: { title:"3" shape:circle borderstyle: solid} -node: { title:"4" shape:circle borderstyle: solid} -node: { title:"5" shape:circle borderstyle: solid} -node: { title:"6" shape:circle borderstyle: solid} -node: { title:"7" shape:circle borderstyle: solid} -node: { title:"8" shape:circle borderstyle: solid} -node: { title:"9" shape:circle borderstyle: double bordercolor: red} - -edge: { source: "0" target: "1" label: "a" arrowstyle: line } -edge: { source: "1" target: "9" label: "#lambda" arrowstyle: line } -edge: { source: "2" target: "3" label: "b" arrowstyle: line } -edge: { source: "3" target: "9" label: "#lambda" arrowstyle: line } -edge: { source: "4" target: "5" label: "c" arrowstyle: line } -edge: { source: "5" target: "9" label: "#lambda" arrowstyle: line } -edge: { source: "6" target: "7" label: "d" arrowstyle: line } -edge: { source: "7" target: "9" label: "#lambda" arrowstyle: line } -edge: { source: "8" target: "0" label: "#lambda" arrowstyle: line } -edge: { source: "8" target: "2" label: "#lambda" arrowstyle: line } -edge: { source: "8" target: "4" label: "#lambda" arrowstyle: line } -edge: { source: "8" target: "6" label: "#lambda" arrowstyle: line } -} - - Deleted: trunk/perl-flat/dev-scripts/pfa.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: notifies s. of c. c. <per...@li...> - 2007-03-05 22:50:47
|
Revision: 116 http://svn.sourceforge.net/perl-flat/?rev=116&view=rev Author: estrabd Date: 2007-03-05 14:50:48 -0800 (Mon, 05 Mar 2007) Log Message: ----------- modified acyclic path search to accept @goals nodes in addition to the src node Modified Paths: -------------- trunk/perl-flat/dev-scripts/all-strings-no-cycles.pl trunk/perl-flat/dev-scripts/explode.pl Modified: trunk/perl-flat/dev-scripts/all-strings-no-cycles.pl =================================================================== --- trunk/perl-flat/dev-scripts/all-strings-no-cycles.pl 2007-03-05 04:52:51 UTC (rev 115) +++ trunk/perl-flat/dev-scripts/all-strings-no-cycles.pl 2007-03-05 22:50:48 UTC (rev 116) @@ -68,10 +68,7 @@ foreach my $symbol (@{$nodes{$startNode}{$adjacent}}) { push(@string,$symbol); acyclic($adjacent); - if ($low{$startNode} > $low{$adjacent}) { - $low{$startNode} = $low{$adjacent}; - } - if ($dfa->is_accepting($adjacent)) { + if ($dfa->array_is_subset([$adjacent],[$dfa->get_accepting()])) { #< proof of concept printf("%s\n",join('',@string)); } pop(@string); Modified: trunk/perl-flat/dev-scripts/explode.pl =================================================================== --- trunk/perl-flat/dev-scripts/explode.pl 2007-03-05 04:52:51 UTC (rev 115) +++ trunk/perl-flat/dev-scripts/explode.pl 2007-03-05 22:50:48 UTC (rev 116) @@ -16,21 +16,6 @@ use FLAT::DFA; use FLAT::Regex::WithExtraOps; -# fucking A! -# perl bdetest.pl "a&b&c&d" will give you all permutations ... once the transformations are done. -# because it takes so darn long to do transformations, it it might be useful to have a native -# interface to dumping a "frozen" DFA object to file...time to investigate - -print STDERR <<END; - - This example includes the serialization of the DFA object, - so if the file exists, it will not go through the transformation again; - In a basic sense, this is an example of compressing data - compare the - size of the serialized object with a text file containing all strings stored - in the DFA. The "compression" is even more extreme if you compare the size - of the output'd text with the size of the actual regular expression. -END - my $dfa; #example: use Storable; @@ -55,11 +40,12 @@ my @string = (); # anonymous, recursive function -&acyclic($dfa->get_starting()); +&acyclic($dfa->get_starting(),$dfa->get_accepting()); #<-- accepts start node and set of possible goals # this function finds all acyclic paths in the dfa for each symbol!! sub acyclic { my $startNode = shift; + my @goalNodes = @_; # tree edge detection if (!exists($dflabel{$startNode})) { $dflabel{$startNode} = ++$lastDFLabel; # the order inwhich this link was explored @@ -67,11 +53,8 @@ if (!exists($dflabel{$adjacent})) { # initial tree edge foreach my $symbol (@{$nodes{$startNode}{$adjacent}}) { push(@string,$symbol); - acyclic($adjacent); - if ($low{$startNode} > $low{$adjacent}) { - $low{$startNode} = $low{$adjacent}; - } - if ($dfa->is_accepting($adjacent)) { + acyclic($adjacent,@goalNodes); + if ($dfa->array_is_subset([$adjacent],[@goalNodes])) { #< proof of concept printf("%s\n",join('',@string)); } pop(@string); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |