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

⟦cb5d52005⟧ Ada Source

    Length: 8192 (0x2000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Pilotes_Et_Avions, procedure Aeroport, seg_011e8f

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 Expertsystem;
use Expertsystem;
with Pilote, Avion, Permis;

procedure Aeroport is

    package Pilotes_Et_Avions is
        procedure Recherche_Des_Pilotes;
    end Pilotes_Et_Avions;


    package body Pilotes_Et_Avions is

-----------------------------------------------------------------------------
--          REGLES
-----------------------------------------------------------------------------

--  Regle 1 : recherche pilote de plus de 35 ans pilotant un B747
-------------------------------------------------------------------------
        function Match_1 (P : Pilote.Object; Pe : Permis.Object)
                         return Boolean is
        begin
            return Pilote.L_Age (P) >= 35 and then
                      not Pilote.Flag_Traite (P) and then
                      (Permis.La_Licence (Pe) = Pilote.La_Licence (P) and
                       Permis.Le_Nom (Pe) = "B747                          ");
        end Match_1;

        function Rule_1 is new Tuplecollection.Join2 (Match_1);

        function Pilote_35_B747_C return Tuplecollection.Object is
        begin
            return Rule_1 (Pilote.Les_Pilotes, Permis.Les_Permis);
        end Pilote_35_B747_C;

        procedure Pilote_35_B747_A (Mg : Tuple.Object) is
            P : Pilote.Object;
        begin  
            P := Tuple.First (Mg);
            Pilote.Modifier (P, True);
            Put_Line ("PILOTES_35_747 : " & Pilote.Le_Nom (P));
        end Pilote_35_B747_A;


--  Regle 2 : recherche tous les pilotes pilotant un B747
-------------------------------------------------------------------------
        function Match_2 (P : Pilote.Object; Pe : Permis.Object)
                         return Boolean is
        begin
            return not Pilote.Flag_Traite (P) and then
                      (Permis.La_Licence (Pe) = Pilote.La_Licence (P) and
                       Permis.Le_Nom (Pe) = "B747                          ");
        end Match_2;

        function Rule_2 is new Tuplecollection.Join2 (Match_2);

        function Pilotes_747_C return Tuplecollection.Object is
        begin
            return Rule_2 (Pilote.Les_Pilotes, Permis.Les_Permis);
        end Pilotes_747_C;

        procedure Pilotes_747_A (Mg : Tuple.Object) is
            P  : Pilote.Object;  
            Pe : Permis.Object;
        begin  
            P  := Tuple.First (Mg);
            Pe := Tuple.Second (Mg);
            Pilote.Modifier (P, True);
            Put_Line ("PILOTES_747 : " & Pilote.Le_Nom (P) &
                      " avec le permis " & Permis.La_Licence (Pe));
        end Pilotes_747_A;



-----------------------------------------------------------------------------
--          FAITS
-----------------------------------------------------------------------------

        procedure Creer_Faits is
        begin
            Pilote.Effacer_Faits;
            Avion.Effacer_Faits;
            Permis.Effacer_Faits;
            Pilote.Creer_Faits;
            Avion.Creer_Faits;
            Permis.Creer_Faits;
        end Creer_Faits;


-----------------------------------------------------------------------------
--          MOTEUR D'INFERENCE
-----------------------------------------------------------------------------

        package Recherche_Pilote_1 is
           new Engine (Context_Name => "Pilote_1  ",
                       Resolution   => Lex,
                       Used_Rules   => 1,
                       Name_1       => "Pilotes_35_747 ",
                       Condition_1  => Pilote_35_B747_C,
                       Action_1     => Pilote_35_B747_A);

        package Recherche_Pilote_2 is new Engine (Context_Name => "Pilote_2  ",
                                                  Resolution => Lex,
                                                  Used_Rules => 1,
                                                  Name_1 => "Pilotes_747    ",
                                                  Condition_1 => Pilotes_747_C,
                                                  Action_1 => Pilotes_747_A);



-----------------------------------------------------------------------------
--
-----------------------------------------------------------------------------

        procedure Recherche_Des_Pilotes is
            Result : Boolean;
        begin
            Put_Line ("-------------------------------------------------");
            Creer_Faits;
            --Rulemanager.Mask (Context => "Pilote_1  ", Rule => 1);
            Result := Recherche_Pilote_1.Inference (Any);
            --Rulemanager.Unmask (Context => "Pilote_1  ", Rule => 1);
            Creer_Faits;
            Result := Recherche_Pilote_2.Inference (Any);
            Put_Line ("-------------------------------------------------");
        end Recherche_Des_Pilotes;


    end Pilotes_Et_Avions;



begin


    Debugger.Resetdebug (Debugger.Text);
    Debugger.Setdebugon (Debugger.Completly);
    Debugger.Refreshdebug;
    Debugger.Setdebugoff (Debugger.Conditionevalued);

    Pilotes_Et_Avions.Recherche_Des_Pilotes;

end Aeroport;


E3 Meta Data

    nblk1=7
    nid=0
    hdr6=e
        [0x00] rec0=1e rec1=00 rec2=01 rec3=00a
        [0x01] rec0=17 rec1=00 rec2=02 rec3=094
        [0x02] rec0=1e rec1=00 rec2=03 rec3=038
        [0x03] rec0=00 rec1=00 rec2=07 rec3=004
        [0x04] rec0=17 rec1=00 rec2=04 rec3=072
        [0x05] rec0=1c rec1=00 rec2=05 rec3=00a
        [0x06] rec0=0c rec1=00 rec2=06 rec3=001
    tail 0x2170df05c82466cdb2582 0x42a00088462063c03