DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦ad3b7913a⟧ Ada Source

    Length: 35840 (0x8c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Dbgraph, package body Dbtext, package body Debugger, seg_00deb3, separate Expertsystem

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



with Text_Io;

separate (Expertsystem)


package body Debugger is

    Textmode : Boolean := True; -- T if 100 % text mode, F if 100 % graphic
    Graffortext : Boolean :=
       False; -- T if we are passing for N step in graphic mode
    Firstmenu : Boolean :=
       False; -- T when 1st context entered has try to start menu
    Wascalled : Boolean :=
       False; -- T when someone has explicitly call the debugger

    type Statearray is array (Itemdebugged) of Boolean;
    State : Statearray;
    Counter : Natural := 0;

    Lastcontext : Natural := 1;
    Lastnumber : Natural := 1;
    Currentcontext : Natural := 1;
    Lastcontextentered : Natural := 0;
    Laststrategy : Strategyname;

    Bell : constant Character := Character'Val (7);
    Aaah : constant Natural := Character'Pos ('A');
    Space : constant Natural := Character'Pos (' ');
    Zero : constant Natural := Character'Pos ('0');


    package Entier_Io is new Text_Io.Integer_Io (Integer);


    Firstitem : constant Itemdebugged := Contextentered;
    Lastitem : constant Itemdebugged := Actionfact;

    Grafnr : Natural := Itemdebugged'Pos (Lastitem) + 1;
    Contnr : Natural := Itemdebugged'Pos (Lastitem) + 2;
    Runnr : Natural := Itemdebugged'Pos (Lastitem) + 3;
    Brkpnr : Natural := Itemdebugged'Pos (Lastitem) + 4;
    Exitnr : Natural := Itemdebugged'Pos (Lastitem) + 5;
    Listnr : Natural := Itemdebugged'Pos (Lastitem) + 6;

    subtype Commandname is String (1 .. 22);
    Cmdname : array (Itemdebugged) of Commandname :=
       ("ENTREE EN CONTEXTE    ", "STRATEGIE UTILISEE    ",
        "DEBUT ENS. DE CONFLIT ", "FIN   ENS. DE CONFLIT ",
        "CONDITIONS EVALUEES   ", "REGLES CHOISIES       ",
        "ACTIONS CHOISIES      ", "INSTANCES DES REGLES  ",
        "INSTANCE  DES ACTIONS ",
        others => "                      ");


    Steptojump : Natural := 1;
    Stepcounter : Natural := 0;

    type Bpinfo is
        record
            Bprulenumber : Ruleid := 0;
            Bpcontextnumber : Contextid := 0;
            Bptimesnumber : Natural := 0;
            Bpcounter : Natural := 0;
            Bpused : Boolean := False;
        end record;

    Bplist : array (Contextid) of Bpinfo;
    Bpcount : Natural := 0;
    Bpstate : Statearray;
    Bpsaved : Boolean := False;

    Contlist : array (Contextid) of Contextname;
    Rulelist : array (Contextid, Ruleid) of Rulename;

    package Dbtext is

        procedure Sendcontextentered (Name : Contextname; Number : Contextid);
        procedure Sendstrategyused (Name : Strategyname);
        procedure Sendconflictsetstarted;
        procedure Sendconflictsetfinished;
        procedure Sendconditionevalued (Name : Rulename;
                                        Number : Natural;
                                        Result : Boolean;
                                        Facts : Tuplecollection.Object);
        procedure Sendchoosedrule (Number : Natural; Fact : Tuple.Object);
        procedure Sendchoosedaction
                     (Name : Rulename; Number : Natural; Fact : Tuple.Object);
        procedure Sendnewstep;
        procedure Sendfailed;
        procedure Resetdebug;
        procedure Refreshdebug;

    end Dbtext;


    package Dbgraph is

        procedure Sendcontextentered (Name : Contextname; Number : Contextid);
        procedure Sendstrategyused (Name : Strategyname);
        procedure Sendconflictsetstarted;
        procedure Sendconflictsetfinished;
        procedure Sendconditionevalued (Name : Rulename;
                                        Number : Natural;
                                        Result : Boolean;
                                        Facts : Tuplecollection.Object);
        procedure Sendchoosedrule (Number : Natural; Fact : Tuple.Object);
        procedure Sendchoosedaction
                     (Name : Rulename; Number : Natural; Fact : Tuple.Object);
        procedure Sendnewstep;
        procedure Sendfailed;
        procedure Resetdebug;
        procedure Refreshdebug;

    end Dbgraph;


    procedure Menulist is
        Choice : Character;
        Cont : Contextid;
        Touche : Character;
    begin
        Put_Line ("");
        Put_Line ("       LISTE DES REGLES ET ETAT DE CHACUNES    ");
        Put_Line ("");
        Put ("Donnez le numero du contexte desire 1..8 > ");
        Get (Choice);
        if Choice > '0' and Choice <= '8' then
            Cont := Contextid'Val (Character'Pos (Choice) - Zero);
        else
            Cont := 1;
        end if;
        Put ("Le nom de ce contexte est ");
        Put_Line (Contlist (Cont));

        for I in 1 .. Ruleid'Last loop
            Put (I);
            Put (" : ");
            Put (Rulelist (Cont, I));
            if Rulemanager.Ismasked (Cont, I) then
                Put (" M ");
            else
                Put (" - ");
            end if;
            if (I mod 2) = 0 then
                Put_Line ("");
            end if;
        end loop;
        Put_Line ("");
        Put ("Pressez S et RETURN pour revenir au MENU du DEBUGGER > ");
        Get (Touche);
    end Menulist;

    procedure Menubreak is
        Letter : Natural;
        Choice : Character;
    begin
        loop
            Put_Line ("");
            Put_Line
               ("MENU DES POINTS D'ARRET. Repondre 0,0,xxx pour desarmer un point d'arret");
            Put_Line ("");
            Put_Line
               ("   Numero   Numero   Numero     Compteur     Maxi   Etat");
            Put_Line
               ("    point    regle   contexte   passage    passage  point");
            Put_Line
               ("===========================================================");
            for I in 1 .. Contextid'Last loop
                Put (I);
                Put ("    ");
                Put (Bplist (I).Bprulenumber);
                Put ("    ");
                Put (Bplist (I).Bpcontextnumber);
                Put ("    ");
                Put (Bplist (I).Bpcounter);
                Put ("    ");
                Put (Bplist (I).Bptimesnumber);
                Put ("    ");
                if Bplist (I).Bpused then
                    Put_Line ("  ON");
                else
                    Put_Line ("  OFF");
                end if;
            end loop;
            Put ("  Tapez un chiffre (1..8 ou 0 pour sortir) >");

            Get (Choice);
            if Choice >= '0' and Choice <= '8' then
                Letter := Character'Pos (Choice) - Zero;
            else
                Letter := 500;
            end if;

            if Letter >= 1 and Letter <= 8 then
                Put ("Indiquer les caracteristiques du POINT d'ARRET No ");
                Put (Letter);
                Put_Line ("");
                Put ("   Numero de la regle a attendre (0 ou 1-30) ==>");
                Entier_Io.Get (Bplist (Letter).Bprulenumber);
                Put ("   Numero du contexte concerne (0 ou 1-8)    ==>");
                Entier_Io.Get (Bplist (Letter).Bpcontextnumber);
                Put ("   Nombre de passage avant arret (0 ou +)    ==>");
                Entier_Io.Get (Bplist (Letter).Bptimesnumber);
                Put_Line ("");

                Bplist (Letter).Bpcounter := 0;

                if Bplist (Letter).Bprulenumber = 0 and
                   Bplist (Letter).Bpcontextnumber = 0 then
                    Bplist (Letter).Bpused := False;
                    Bpcount := Bpcount - 1;
                else
                    Bplist (Letter).Bpused := True;
                    Bpcount := Bpcount + 1;
                end if;
            else
                if Letter = 0 then
                    exit;
                end if;
            end if;
        end loop;
    end Menubreak;



    procedure Menu is
        Letter : Natural;
        Choice : Character;

        procedure Turntograf is
        begin
            Put ("  Combien de pas (1..32000) >");
            Entier_Io.Get (Steptojump);
            Dbgraph.Refreshdebug;
            Textmode := False;
            Graffortext := True;
            if Bpsaved = False then
                Bpstate := State;
                State := (others => True);
            end if;
        end Turntograf;

        procedure Jumpnstep is
        begin
            Put ("  Combien de pas (1..32000) >");
            if Bpsaved = False then
                Bpstate := State;
                Bpsaved := True;
                State := (others => False);
                State (Choosedrule) := True;
            end if;
            Entier_Io.Get (Steptojump);
        end Jumpnstep;

    begin
        loop
            Put_Line ("");
            Put ("               MENU DEBUGGER          COMPTE-TOUR MOTEUR : ");
            Put (Counter);
            Put_Line ("");
            Put_Line ("");
            for I in Firstitem .. Lastitem loop
                Put (Character'Val (Aaah + Itemdebugged'Pos (I)));
                Put (" : ");
                Put (Cmdname (I));
                if State (I) then
                    Put ("  oui        ");
                else
                    Put ("     non     ");
                end if;
                if (Itemdebugged'Pos (I) mod 2) = 1 then
                    Put_Line ("");
                end if;
                Letter := Itemdebugged'Pos (I);
            end loop;

            Put (Character'Val (Aaah + Grafnr));
            Put (" : ");
            Put ("pour CONTINUER de X pas en GRAPHIQUE");

            Put_Line ("");
            Put (Character'Val (Aaah + Contnr));
            Put (" : ");
            Put ("pour CONTINUER de 1 pas            ");

            Put (Character'Val (Aaah + Runnr));
            Put (" : ");
            Put_Line ("pour CONTINUER de X pas");

            Put (Character'Val (Aaah + Brkpnr));
            Put (" : ");
            Put ("pour le menu des POINTS D'ARRET    ");

            Put (Character'Val (Aaah + Exitnr));
            Put (" : ");
            Put_Line ("pour TOUT ARRETER D'URGENCE");

            Put (Character'Val (Aaah + Listnr));
            Put (" : ");
            Put ("pour la liste d'ETAT des REGLES ");

            Put_Line ("");
            Put ("  Tapez une lettre SVP >");

            Get (Choice);

            if Choice >= 'a' and Choice <= 'z' then
                Letter := Character'Pos (Choice) - Aaah - Space;
            elsif Choice >= 'A' and Choice <= 'Z' then
                Letter := Character'Pos (Choice) - Aaah;
            else
                Letter := 500;
            end if;

            if Letter >= Itemdebugged'Pos (Firstitem) and
               Letter <= Itemdebugged'Pos (Lastitem) then
                State (Itemdebugged'Val (Letter)) :=
                   not State (Itemdebugged'Val (Letter));
            else
                if Letter = Exitnr then
                    raise Program_Error;
                elsif Letter = Grafnr then
                    Turntograf;
                    exit;
                elsif Letter = Contnr then
                    Steptojump := 1;
                    exit;
                elsif Letter = Runnr then
                    Jumpnstep;
                    exit;
                elsif Letter = Brkpnr then
                    Menubreak;
                elsif Letter = Listnr then
                    Menulist;
                else
                    Put (Bell);
                end if;
            end if;
        end loop;
        Put_Line ("");
    end Menu;


    procedure Breakptsupdate (Number : Natural) is
    begin
        if Bpcount /= 0 then
            for I in 1 .. Contextid'Last loop
                if Bplist (I).Bpcontextnumber = Lastcontextentered and
                   Bplist (I).Bprulenumber = Number  
                    then
                    Bplist (I).Bpcounter := Bplist (I).Bpcounter + 1;
                end if;
            end loop;
        end if;
    end Breakptsupdate;

    function Breakptsarrived return Boolean is
    begin
        if Bpcount = 0 then
            return False;
        else
            for I in 1 .. Contextid'Last loop
                if Bplist (I).Bpcounter >= Bplist (I).Bptimesnumber and
                   Bplist (I).Bpcounter /= 0 and Bplist (I).Bpused then
                    Bplist (I).Bpcounter := 0;
                    Put (Bell);
                    Put_Line ("D# *******************************");
                    Put_Line ("D# *** POINT D'ARRET RENCONTRE ***");
                    Put_Line ("D# *******************************");
                    return True;
                end if;
            end loop;
            return False;
        end if;
    end Breakptsarrived;




    package body Dbtext is

        procedure Displayref (Aref : Expertsystem.Reference) is
        begin
            Put (Classidentity.Unknownclassname (Aref));
            Put (".");
            Put (Classidentity.Unknownobjectname (Aref));
            Put (" ");
        end Displayref;

        procedure Displaytuple0 is new Tuple.Forall (Displayref);
        procedure Displaytuple (Atuple : Tuple.Object) is
        begin
            Put ("D#   Instance : ");
            Displaytuple0 (Atuple);
            Put_Line (" ");
        end Displaytuple;

        procedure Displaytuplecollection0 is
           new Tuplecollection.Forall (Displaytuple);
        procedure Displaytuplecollection (Tc : Tuplecollection.Object) is
        begin
            Displaytuplecollection0 (Tc);
        end Displaytuplecollection;


        procedure Sendcontextentered (Name : Contextname; Number : Contextid) is
        begin
            if Number /= Lastcontextentered then
                Lastcontextentered := Number;
                if State (Contextentered) then
                    Put_Line (" ");
                    Put ("D# Nouveau contexte No ");
                    Put (Number);
                    Put (" : ");
                    Put_Line (Name);
                end if;
            end if;
            if not Firstmenu then
                if Wascalled then
                    Menu;
                end if;
                Firstmenu := True;
            end if;
        end Sendcontextentered;

        procedure Sendstrategyused (Name : Strategyname) is
        begin
            if State (Strategyused) and Laststrategy /= Name then
                Put ("D# Strategie utilisee : ");
                Put_Line (Name);
                Laststrategy := Name;
            end if;
        end Sendstrategyused;

        procedure Sendconflictsetstarted is
        begin
            if State (Conflictsetstarted) then
                Put_Line (" ");
                Put_Line ("D# Construction de l'ensemble de conflit ... ");
            end if;
        end Sendconflictsetstarted;

        procedure Sendconflictsetfinished is
        begin
            if State (Conflictsetfinished) then
                Put_Line ("D# Ensemble de conflit termine.");
                Put_Line (" ");
            end if;
        end Sendconflictsetfinished;

        procedure Sendconditionevalued (Name : Rulename;
                                        Number : Natural;
                                        Result : Boolean;
                                        Facts : Tuplecollection.Object) is
        begin
            if State (Conditionevalued) then
                Put ("D# Evaluation regle No ");
                Put (Number);
                if Result then
                    Put (" => VRAI : ");
                else
                    Put (" => FAUX : ");
                end if;
                Put_Line (Name);

            end if;
            if State (Rulefacts) and Tuplecollection.Isnotnull (Facts) then
                Put_Line ("D# Faits impliques :");
                Displaytuplecollection (Facts);
            end if;
        end Sendconditionevalued;

        procedure Sendchoosedrule (Number : Natural; Fact : Tuple.Object) is
        begin
            Breakptsupdate (Number);
            if State (Choosedrule) and Steptojump = 1 then
                Put ("D# Regle choisie : No ");
                Put (Number);
                Put_Line (" ");
            end if;
            if State (Rulefacts) and Tuple.Isnotnull (Fact) then
                Put_Line ("D# Faits impliques :");
                Displaytuple (Fact);
            end if;
            if Breakptsarrived then
                if Bpsaved then
                    State := Bpstate;
                    Bpsaved := False;
                end if;
                Menu;
                Stepcounter := 0;
            end if;

        end Sendchoosedrule;

        procedure Sendchoosedaction
                     (Name : Rulename; Number : Natural; Fact : Tuple.Object) is
        begin
            if State (Choosedaction) then
                Put_Line (" ");
                Put ("D# Action executee : No ");
                Put (Number);
                Put (" = ");
                Put_Line (Name);
            end if;
            if State (Actionfact) and Tuple.Isnotnull (Fact) then
                Put_Line ("D# Fait concerne :");
                Displaytuple (Fact);
            end if;
        end Sendchoosedaction;

        procedure Sendnewstep is
        begin
            if Counter >= Natural'Last then
                Counter := 0;
            end if;
            Counter := Counter + 1;
            if State (Newstep) and Steptojump = 1 then
                Put ("D# Compte-tour moteur : ");
                Put (Counter);
                Put_Line (" ");
            end if;
            Stepcounter := Stepcounter + 1;
            if Stepcounter = Steptojump then
                if Bpsaved then
                    State := Bpstate;
                    Bpsaved := False;
                end if;
                Menu;
                Stepcounter := 0;
            end if;
        end Sendnewstep;

        procedure Sendfailed is
        begin
            if State (Failed) or Steptojump /= 1 then
                Put ("D# Plus de regle valide. ");
                Put_Line (" ");
            end if;
        end Sendfailed;

        procedure Resetdebug is
        begin
            Setdebugoff (Completly);
            Counter := 0;
            Steptojump := 1;
            Stepcounter := 0;
            Lastcontextentered := 0;
            Laststrategy := "     ";
            for I in Contextid loop
                Bplist (I).Bpused := False;
            end loop;
            Bpcount := 0;
            Bpsaved := False;
        end Resetdebug;

        procedure Refreshdebug is
        begin
            null;
        end Refreshdebug;

    end Dbtext;

    package body Dbgraph is


        procedure Sendcontextentered (Name : Contextname; Number : Contextid) is
        begin
            Currentcontext := Number;
            if Number /= Lastcontextentered then
                Lastcontextentered := Number;
                if State (Contextentered) then
                    Terminal.Atxy (1, 11);
                    Put ("Contexte courant : ");
                    Put_Line (Name);
                    Terminal.Atxy (1, 15);
                end if;
            end if;

        end Sendcontextentered;

        procedure Sendstrategyused (Name : Strategyname) is
        begin
            if State (Strategyused) and Name /= Laststrategy then
                Terminal.Atxy (50, 11);
                Put ("Strategie courante : ");
                Put_Line (Name);
                Terminal.Atxy (1, 15);
                Laststrategy := Name;
            end if;
        end Sendstrategyused;

        procedure Sendconflictsetstarted is
        begin
            if State (Conflictsetstarted) then
                Terminal.Atxy (1, 12);
                Put ("                                                  ");
                Terminal.Atxy (1, 12);
                Put ("Construction de l'ensemble de conflit ... ");
                Terminal.Atxy (1, 15);
            end if;
        end Sendconflictsetstarted;

        procedure Sendconflictsetfinished is
        begin
            if State (Conflictsetfinished) then
                Terminal.Atxy (1, 12);
                Put ("                                                  ");
                Terminal.Atxy (1, 12);
                Put ("Ensemble de conflit termine. ");
                Terminal.Atxy (1, 15);
            end if;
        end Sendconflictsetfinished;

        procedure Sendconditionevalued (Name : Rulename;
                                        Number : Natural;
                                        Result : Boolean;
                                        Facts : Tuplecollection.Object) is
            Nb : Natural;
        begin
            Terminal.Atxy (Number + 1, Currentcontext + 1);
            Nb := Tuplecollection.Cardinality (Facts);
            if Nb = 0 then
                Put ('.');
            else
                if Nb > 9 then
                    Put ('+');
                else
                    Put (Character'Val (Nb + Zero));
                end if;
            end if;
            Terminal.Atxy (1, 15);
        end Sendconditionevalued;

        procedure Sendchoosedrule (Number : Natural; Fact : Tuple.Object) is
            Nb : Natural;
            Touche : Character;
        begin
            Breakptsupdate (Number);
            if State (Choosedrule) and Number /= 0 then
                Terminal.Atxy (Lastnumber + 41, Lastcontext + 1);
                Put ('.');
                Terminal.Atxy (Number + 41, Currentcontext + 1);
                Put ('*');
                Lastnumber := Number;
                Lastcontext := Currentcontext;
                Terminal.Atxy (1, 15);
                Put
                   ("                                                                    ");
                Terminal.Atxy (1, 15);
            end if;
            if Breakptsarrived then
                if Bpsaved then
                    State := Bpstate;
                    Bpsaved := False;
                end if;
                Graffortext := False;
                Textmode := True;
                Put
                   ("Pressez S et RETURN pour revenir au DEBUGGER en mode TEXT > ");
                Get (Touche);
                Menu;
                Stepcounter := 0;
            end if;

        end Sendchoosedrule;

        procedure Sendchoosedaction
                     (Name : Rulename; Number : Natural; Fact : Tuple.Object) is
        begin
            null;
        end Sendchoosedaction;

        procedure Sendnewstep is
            Touche : Character;
        begin
            if Counter >= Natural'Last then
                Counter := 0;
            end if;
            Counter := Counter + 1;
            if State (Newstep) then
                Terminal.Atxy (53, 12);
                Put ("Compte-tour moteur : ");
                Put (Counter);
                delay 1.0;
                Terminal.Atxy (1, 15);
            end if;

            if Graffortext then
                Stepcounter := Stepcounter + 1;
                if Stepcounter = Steptojump then
                    if Bpsaved then
                        State := Bpstate;
                        Bpsaved := False;
                    end if;
                    Graffortext := False;
                    Textmode := True;
                    Put
                       ("Pressez S et RETURN pour revenir au DEBUGGER en mode TEXT > ");
                    Get (Touche);
                    Menu;
                    Stepcounter := 0;
                end if;
            end if;

        end Sendnewstep;

        procedure Sendfailed is
        begin
            Counter := 0;
            if State (Failed) then
                Terminal.Atxy (1, 12);
                Put ("                                                  ");
                Terminal.Atxy (1, 12);
                Put ("Plus de regle valide. ");
                Terminal.Atxy (1, 15);
            end if;
        end Sendfailed;

        procedure Resetdebug is
        begin
            Counter := 0;
            Setdebugoff (Completly);
        end Resetdebug;


        procedure Refreshdebug is
        begin
            Terminal.Clear;
            Terminal.Atxy (1, 1);
            Put (' ');
            for I in 1 .. Ruleid'Last loop
                Put (Character'Val (Zero + (I mod 10)));
            end loop;
            Terminal.Atxy (41, 1);
            Put (' ');
            for I in 1 .. Ruleid'Last loop
                Put (Character'Val (Zero + (I mod 10)));
            end loop;
            for I in 1 .. Contextid'Last loop
                Terminal.Atxy (1, I + 1);
                Put (Character'Val (Zero + (I mod 10)));
                Terminal.Atxy (41, I + 1);
                Put (Character'Val (Zero + (I mod 10)));
            end loop;
            Terminal.Atxy (1, 10);
            Put
               ("          REGLES EVALUEES                          REGLES CHOISIES");
            Terminal.Atxy (1, 15);
            Laststrategy := "     ";
            Lastcontextentered := 0;
        end Refreshdebug;

    end Dbgraph;




    procedure Sendcontextentered (Name : Contextname; Number : Contextid) is
    begin
        if Textmode then
            Dbtext.Sendcontextentered (Name, Number);
        else
            Dbgraph.Sendcontextentered (Name, Number);
        end if;
    end Sendcontextentered;

    procedure Sendstrategyused (Name : Strategyname) is
    begin
        if Textmode then
            Dbtext.Sendstrategyused (Name);
        else
            Dbgraph.Sendstrategyused (Name);
        end if;
    end Sendstrategyused;

    procedure Sendconflictsetstarted is
    begin
        if Textmode then
            Dbtext.Sendconflictsetstarted;
        else
            Dbgraph.Sendconflictsetstarted;
        end if;
    end Sendconflictsetstarted;

    procedure Sendconflictsetfinished is
    begin
        if Textmode then
            Dbtext.Sendconflictsetfinished;
        else
            Dbgraph.Sendconflictsetfinished;
        end if;
    end Sendconflictsetfinished;

    procedure Sendconditionevalued (Name : Rulename;
                                    Number : Natural;
                                    Result : Boolean;
                                    Facts : Tuplecollection.Object) is
    begin
        if Textmode then
            Dbtext.Sendconditionevalued (Name, Number, Result, Facts);
        else
            Dbgraph.Sendconditionevalued (Name, Number, Result, Facts);
        end if;
    end Sendconditionevalued;

    procedure Sendchoosedrule (Number : Natural; Fact : Tuple.Object) is
    begin
        if Textmode then
            Dbtext.Sendchoosedrule (Number, Fact);
        else
            Dbgraph.Sendchoosedrule (Number, Fact);
        end if;
    end Sendchoosedrule;

    procedure Sendchoosedaction
                 (Name : Rulename; Number : Natural; Fact : Tuple.Object) is
    begin
        if Textmode then
            Dbtext.Sendchoosedaction (Name, Number, Fact);
        else
            Dbgraph.Sendchoosedaction (Name, Number, Fact);
        end if;
    end Sendchoosedaction;

    procedure Sendnewstep is
    begin
        if Textmode then
            Dbtext.Sendnewstep;
        else
            Dbgraph.Sendnewstep;
        end if;
    end Sendnewstep;

    procedure Sendfailed is
    begin
        if Textmode then
            Dbtext.Sendfailed;
        else
            Dbgraph.Sendfailed;
        end if;
    end Sendfailed;

    procedure Refreshdebug is
    begin
        if Textmode then
            Dbtext.Refreshdebug;
        else
            Dbgraph.Refreshdebug;
        end if;
    end Refreshdebug;



    function Isdebugged (What : Itemdebugged) return Boolean is
    begin
        return State (What);
    end Isdebugged;

    procedure Setdebugon (Item : Itemdebugged) is
    begin
        if Item = Completly then
            for I in Itemdebugged loop
                State (I) := True;
            end loop;
        else
            State (Item) := True;
        end if;
    end Setdebugon;

    procedure Setdebugon (Item : Itemset) is
    begin
        for I in Item'Range loop
            Setdebugon (Item (I));
        end loop;
    end Setdebugon;

    procedure Setdebugoff (Item : Itemdebugged) is
    begin
        if Item = Completly then
            for I in Itemdebugged loop
                State (I) := False;
            end loop;
        else
            State (Item) := False;
        end if;
    end Setdebugoff;

    procedure Setdebugoff (Item : Itemset) is
    begin
        for I in Item'Range loop
            Setdebugoff (Item (I));
        end loop;
    end Setdebugoff;

    procedure Resetdebug (Mode : Debuggingmode) is
    begin
        Graffortext := False;
        Wascalled := True;
        if Mode = Text then
            Textmode := True;
            Firstmenu := False;
            Dbtext.Resetdebug;
        else
            Textmode := False;
            Firstmenu := True;
            Dbgraph.Resetdebug;
        end if;  
    end Resetdebug;

    procedure Sendrulesnames
                 (Contextnumber : Contextid;
                  Ctxname : Contextname;
                  Name_1, Name_2, Name_3, Name_4, Name_5, Name_6,
                  Name_7, Name_8, Name_9, Name_10, Name_11, Name_12,
                  Name_13, Name_14, Name_15, Name_16, Name_17, Name_18,
                  Name_19, Name_20, Name_21, Name_22, Name_23, Name_24,
                  Name_25, Name_26, Name_27, Name_28, Name_29, Name_30 :
                     Rulename) is
    begin
        Contlist (Contextnumber) := Ctxname;
        Rulelist (Contextnumber, 1) := Name_1;
        Rulelist (Contextnumber, 2) := Name_2;
        Rulelist (Contextnumber, 3) := Name_3;
        Rulelist (Contextnumber, 4) := Name_4;
        Rulelist (Contextnumber, 5) := Name_5;
        Rulelist (Contextnumber, 6) := Name_6;
        Rulelist (Contextnumber, 7) := Name_7;
        Rulelist (Contextnumber, 8) := Name_8;
        Rulelist (Contextnumber, 9) := Name_9;
        Rulelist (Contextnumber, 10) := Name_10;
        Rulelist (Contextnumber, 11) := Name_11;
        Rulelist (Contextnumber, 12) := Name_12;
        Rulelist (Contextnumber, 13) := Name_13;
        Rulelist (Contextnumber, 14) := Name_14;
        Rulelist (Contextnumber, 15) := Name_15;
        Rulelist (Contextnumber, 16) := Name_16;
        Rulelist (Contextnumber, 17) := Name_17;
        Rulelist (Contextnumber, 18) := Name_18;
        Rulelist (Contextnumber, 19) := Name_19;
        Rulelist (Contextnumber, 20) := Name_20;
        Rulelist (Contextnumber, 21) := Name_21;
        Rulelist (Contextnumber, 22) := Name_22;
        Rulelist (Contextnumber, 23) := Name_23;
        Rulelist (Contextnumber, 24) := Name_24;
        Rulelist (Contextnumber, 25) := Name_25;
        Rulelist (Contextnumber, 26) := Name_26;
        Rulelist (Contextnumber, 27) := Name_27;
        Rulelist (Contextnumber, 28) := Name_28;
        Rulelist (Contextnumber, 29) := Name_29;
        Rulelist (Contextnumber, 30) := Name_30;
    end Sendrulesnames;

begin
    Resetdebug (Text);
    Wascalled := False;
end Debugger;

E3 Meta Data

    nblk1=22
    nid=22
    hdr6=42
        [0x00] rec0=21 rec1=00 rec2=01 rec3=04e
        [0x01] rec0=1a rec1=00 rec2=02 rec3=010
        [0x02] rec0=1a rec1=00 rec2=03 rec3=07c
        [0x03] rec0=18 rec1=00 rec2=04 rec3=02e
        [0x04] rec0=20 rec1=00 rec2=05 rec3=020
        [0x05] rec0=1d rec1=00 rec2=06 rec3=030
        [0x06] rec0=1c rec1=00 rec2=07 rec3=016
        [0x07] rec0=17 rec1=00 rec2=08 rec3=004
        [0x08] rec0=25 rec1=00 rec2=09 rec3=028
        [0x09] rec0=1b rec1=00 rec2=0a rec3=03a
        [0x0a] rec0=1f rec1=00 rec2=0b rec3=01a
        [0x0b] rec0=1d rec1=00 rec2=0c rec3=050
        [0x0c] rec0=19 rec1=00 rec2=0d rec3=042
        [0x0d] rec0=21 rec1=00 rec2=0e rec3=026
        [0x0e] rec0=1c rec1=00 rec2=0f rec3=03c
        [0x0f] rec0=1b rec1=00 rec2=10 rec3=046
        [0x10] rec0=1b rec1=00 rec2=11 rec3=00e
        [0x11] rec0=1f rec1=00 rec2=12 rec3=00a
        [0x12] rec0=1f rec1=00 rec2=13 rec3=034
        [0x13] rec0=22 rec1=00 rec2=14 rec3=036
        [0x14] rec0=1b rec1=00 rec2=15 rec3=04c
        [0x15] rec0=1a rec1=00 rec2=16 rec3=016
        [0x16] rec0=19 rec1=00 rec2=17 rec3=01c
        [0x17] rec0=20 rec1=00 rec2=18 rec3=038
        [0x18] rec0=1c rec1=00 rec2=19 rec3=01c
        [0x19] rec0=1e rec1=00 rec2=1a rec3=074
        [0x1a] rec0=26 rec1=00 rec2=1b rec3=020
        [0x1b] rec0=1e rec1=00 rec2=1c rec3=012
        [0x1c] rec0=29 rec1=00 rec2=1d rec3=010
        [0x1d] rec0=27 rec1=00 rec2=1e rec3=028
        [0x1e] rec0=1a rec1=00 rec2=1f rec3=058
        [0x1f] rec0=15 rec1=00 rec2=20 rec3=010
        [0x20] rec0=0f rec1=00 rec2=21 rec3=000
        [0x21] rec0=0f rec1=00 rec2=21 rec3=000
    tail 0x2170aace0821b4bafed55 0x42a00088462060003
Free Block Chain:
  0x22: 0000  00 00 00 06 80 03 61 6d 65 03 04 05 06 07 08 09  ┆      ame       ┆