DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦6be8ed45e⟧ TextFile

    Length: 5051 (0x13bb)
    Types: TextFile
    Names: »B«

Derivation

└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13
    └─ ⟦124ff5788⟧ »DATA« 
        └─⟦this⟧ 
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
    └─ ⟦6f12a12be⟧ »DATA« 
        └─⟦this⟧ 
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─ ⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

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;