Deprecated: Creation of dynamic property GeneralSettings::$count_col_key_names is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/settings/model/_abstractsettings.class.php on line 121

Deprecated: Creation of dynamic property AbstractSettings::$count_col_key_names is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/settings/model/_abstractsettings.class.php on line 121

Deprecated: Creation of dynamic property UserSettings::$count_col_key_names is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/settings/model/_abstractsettings.class.php on line 121

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/_init_login.inc.php on line 81

Deprecated: Creation of dynamic property CollectionSettings::$count_col_key_names is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/settings/model/_abstractsettings.class.php on line 121

Deprecated: Creation of dynamic property Item::$objtype is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/items/model/_itemlight.class.php on line 164

Deprecated: Creation of dynamic property Item::$datestart is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/items/model/_itemlight.class.php on line 175

Deprecated: Creation of dynamic property ItemList2::$filterset_name is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/items/model/_itemlistlight.class.php on line 114

Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/items/model/_itemlistlight.class.php on line 420

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 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 ItemQuery::$Blog is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/items/model/_itemquery.class.php on line 231

Deprecated: Creation of dynamic property ItemQuery::$cat_array is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/items/model/_itemquery.class.php on line 232

Deprecated: Creation of dynamic property ItemQuery::$cat_modifier is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/items/model/_itemquery.class.php on line 233

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 ItemQuery::$assignees_logins is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/items/model/_itemquery.class.php on line 525

Deprecated: Creation of dynamic property ItemQuery::$author_assignee is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/items/model/_itemquery.class.php on line 557

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: 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 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 ItemSettings::$count_col_key_names is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/settings/model/_abstractsettings.class.php on line 121

Deprecated: Creation of dynamic property Item::$switchable_params is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/items/model/_item.class.php on line 4737

Warning: Cannot modify header information - headers already sent by (output started at /export/home/bertrand/web/blog/b2evolution/blogs/inc/_core/_misc.funcs.php:10542) in /export/home/bertrand/web/blog/b2evolution/blogs/inc/_core/_template.funcs.php on line 40

Warning: Cannot modify header information - headers already sent by (output started at /export/home/bertrand/web/blog/b2evolution/blogs/inc/_core/_misc.funcs.php:10542) in /export/home/bertrand/web/blog/b2evolution/blogs/inc/_core/_template.funcs.php on line 405

Warning: Cannot modify header information - headers already sent by (output started at /export/home/bertrand/web/blog/b2evolution/blogs/inc/_core/_misc.funcs.php:10542) in /export/home/bertrand/web/blog/b2evolution/blogs/inc/_core/_template.funcs.php on line 406

Warning: Cannot modify header information - headers already sent by (output started at /export/home/bertrand/web/blog/b2evolution/blogs/inc/_core/_misc.funcs.php:10542) in /export/home/bertrand/web/blog/b2evolution/blogs/inc/_core/_template.funcs.php on line 407

Warning: Cannot modify header information - headers already sent by (output started at /export/home/bertrand/web/blog/b2evolution/blogs/inc/_core/_misc.funcs.php:10542) in /export/home/bertrand/web/blog/b2evolution/blogs/inc/_core/_template.funcs.php on line 408

Deprecated: Creation of dynamic property tinymce_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_anchors_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 videoplug_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 code_highlight_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 flowplayer_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 mermaid_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 table_contents_plugin::$classfile_path is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/plugins/model/_plugins.class.php on line 413
Vers une automatisation du calcul des quines

Vers une automatisation du calcul des quines

par Le Grincheux  


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


Formulaire en cours de chargement...


Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/sessions/model/_hit.class.php on line 932

Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/sessions/model/_hit.class.php on line 933

Deprecated: Creation of dynamic property Hit::$is_lynx is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/sessions/model/_hit.class.php on line 571

Deprecated: Creation of dynamic property Hit::$is_firefox is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/sessions/model/_hit.class.php on line 572

Deprecated: Creation of dynamic property Hit::$is_gecko is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/sessions/model/_hit.class.php on line 573

Deprecated: Creation of dynamic property Hit::$is_IE is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/sessions/model/_hit.class.php on line 574

Deprecated: Creation of dynamic property Hit::$is_winIE is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/sessions/model/_hit.class.php on line 575

Deprecated: Creation of dynamic property Hit::$is_macIE is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/sessions/model/_hit.class.php on line 576

Deprecated: Creation of dynamic property Hit::$is_chrome is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/sessions/model/_hit.class.php on line 577

Deprecated: Creation of dynamic property Hit::$is_safari is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/sessions/model/_hit.class.php on line 578

Deprecated: Creation of dynamic property Hit::$is_opera is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/sessions/model/_hit.class.php on line 579

Deprecated: Creation of dynamic property Hit::$is_NS4 is deprecated in /export/home/bertrand/web/blog/b2evolution/blogs/inc/sessions/model/_hit.class.php on line 580