Vers une automatisation du calcul des quines
Deprecated: Creation of dynamic property Item::$cache_has_content_parts is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/items/model/_item.class.php on line 4911
Deprecated: Creation of dynamic property smilies_plugin::$classfile_path is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/plugins/model/_plugins.class.php on line 413
Deprecated: Creation of dynamic property quicktags_plugin::$classfile_path is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/plugins/model/_plugins.class.php on line 413
Deprecated: Creation of dynamic property archives_plugin::$classfile_path is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/plugins/model/_plugins.class.php on line 413
Deprecated: Creation of dynamic property archives_plugin::$dbtable is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/plugins/_archives.plugin.php on line 54
Deprecated: Creation of dynamic property archives_plugin::$dbprefix is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/plugins/_archives.plugin.php on line 55
Deprecated: Creation of dynamic property archives_plugin::$dbIDname is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/plugins/_archives.plugin.php on line 56
Deprecated: Creation of dynamic property email_elements_plugin::$classfile_path is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/plugins/model/_plugins.class.php on line 413
Deprecated: Creation of dynamic property financial_contribution_plugin::$classfile_path is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/plugins/model/_plugins.class.php on line 413
Deprecated: Creation of dynamic property ping_b2evonet_plugin::$classfile_path is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/plugins/model/_plugins.class.php on line 413
Deprecated: Creation of dynamic property ping_pingomatic_plugin::$classfile_path is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/plugins/model/_plugins.class.php on line 413
Deprecated: Creation of dynamic property auto_p_plugin::$classfile_path is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/plugins/model/_plugins.class.php on line 413
Deprecated: Creation of dynamic property texturize_plugin::$classfile_path is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/plugins/model/_plugins.class.php on line 413
Deprecated: Creation of dynamic property nofollow_plugin::$classfile_path is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/plugins/model/_plugins.class.php on line 413
Deprecated: Creation of dynamic property content_blocks_plugin::$classfile_path is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/plugins/model/_plugins.class.php on line 413
Deprecated: Creation of dynamic property Item::$renderers_validated is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/items/model/_item.class.php on line 11107
Deprecated: Creation of dynamic property Item::$pages is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/items/model/_item.class.php on line 2412
L'automate doit comporter une bascule de plus. De huit variables, les tables de vérités passent à neuf, soit cinq cent douze états pour huit variables de sorties. Cela commence à faire beaucoup lorsqu'on le fait à la main. J'ai trouvé un outil en mode texte pour réduire les quines : qmc (en version 0.6.3). Il ne reste plus qu'à générer automatiquement un fichier d'entrée pour cet outil directement depuis les tables de transitions.
#!/usr/local/bin/rpl -csp
/*
* Format du fichier d'entrée :
* 010X00X
* *1111111
* *X000X01
*
* Le X correspond à une valeur indifférente. Les entiers binaires
* spécifiés doivent donner une combinaison vraie. Les lignes
* commençant par une étoile indiquent un résultat indifférent.
*/
TRANSITIONS
<<
{ "length*(1)" }
{ { "name" "transitions.in" } "sequential" "old"
"readonly" "flow" }
open format
0
-> F_IN NB_LIGNES
<<
while
F_IN "end of file" inquire not
repeat
""
do
F_IN read 1 get
until
if
dup "\n" same
F_IN "end of file" inquire or
then
drop true
else
+
false
end
end
if
dup "" same not
then
'NB_LIGNES' incr
else
drop
end
end
F_IN close
NB_LIGNES ->list
>>
1
-> LISTE I
<<
do
LISTE I get ucase
-> E
<<
if
E "X" pos dup
then
// Il y a au moins un X
-> P
<<
{ "0" "1" } forall J
if
P 1 same
then
J E 2 over size sub +
elseif
P E size same
then
E 1 over size 1 - sub J +
else
E 1 P decr sub J +
E P incr E size sub +
end
next
LISTE swap I swap put swap
1 ->list + 'LISTE' sto
>>
else
// Pas de X, on passe au suivant
drop
'I' incr
end
>>
until
LISTE size I same
end
LISTE l->t << < >> sort
>>
forall I
if
I "*" pos
then
"x" "# " I 2 over size sub + "b" + str-> b->r ->str +
else
"# " I + "b" + str-> b->r ->str
end
disp
next
>>
Je concède que c'est un peu sauvage, mais cela fonctionne parfaitement pour mon usage. Cet outil prend le fichier transitions.in et écrit sur la sortie standard un fichier correspondant et attendu par qmc. Le langage RPL/2 est toujours disponible au même endroit.
Aucun commentaire pour le moment
Deprecated: Creation of dynamic property CommentQuery::$dbtablename is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/comments/model/_commentquery.class.php on line 57
Deprecated: Creation of dynamic property CommentQuery::$dbprefix is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/comments/model/_commentquery.class.php on line 58
Deprecated: Creation of dynamic property CommentQuery::$dbIDname is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/comments/model/_commentquery.class.php on line 59
Deprecated: Creation of dynamic property ItemQuery::$dbtablename is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/items/model/_itemquery.class.php on line 78
Deprecated: Creation of dynamic property ItemQuery::$dbprefix is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/items/model/_itemquery.class.php on line 79
Deprecated: Creation of dynamic property ItemQuery::$dbIDname is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/items/model/_itemquery.class.php on line 80
Deprecated: Creation of dynamic property CommentList2::$filterset_name is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/comments/model/_commentlist.class.php on line 87
Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/_core/_param.funcs.php on line 1407
Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/_core/_param.funcs.php on line 1407
Deprecated: Creation of dynamic property CommentList2::$query_is_initialized is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/comments/model/_commentlist.class.php on line 396
Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/_core/_misc.funcs.php on line 10537
Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/_core/_misc.funcs.php on line 10542
Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/_core/_misc.funcs.php on line 10537
Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/_core/_misc.funcs.php on line 10542
Deprecated: Creation of dynamic property CommentQuery::$ymdhms_min is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/comments/model/_commentquery.class.php on line 680
Deprecated: Creation of dynamic property CommentQuery::$ymdhms_max is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/comments/model/_commentquery.class.php on line 681
Deprecated: Creation of dynamic property ItemQuery::$m is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/items/model/_itemquery.class.php on line 842
Deprecated: Creation of dynamic property ItemQuery::$w is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/items/model/_itemquery.class.php on line 843
Deprecated: Creation of dynamic property CommentList2::$inlist_orders is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/comments/model/_commentlist.class.php on line 1295