|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: B T
Length: 4034 (0xfc2)
Types: TextFile
Names: »B«
└─⟦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⟧
package body Systexpertr is
-- les variables internes :
type Tcontexte is (Contexte0, Contexte1, Contexte2);
Contexte : Tcontexte := Contexte0;
-- les variables de l'application :
Buts : Collection.Object;
Solutions : Collection.Object;
Situation : Expertsystem.Reference;
Affdemande : Boolean := True; -- affichage demande ?
-- regles a utiliser dans le contexte 0 :
function Regle0 return Boolean is
begin
-- R-0-A
-- SI LE RANG COURANT DANS L'ECHIQUIER EST EGAL AU RANG A ATTEINDRE
-- ET SI L'ENSEMBLE DES SOLUTIONS EST VIDE
-- ALORS REMPLIR L'ENSEMBLE DES SOLUTIONS AVEC LES SITUATIONS DE NIVEAU
-- COURANT (QUI ONT DEJA ETE OUVERTES)
Regletrouversolution:
begin
if Rangcourant = Rangfinal and
Collection.Cardinality (Solutions) = 0 then
Solutions := Niveaufinal (Rangfinal);
return (True);
end if;
end Regletrouversolution;
-- R-0-B
-- SI L'ENSEMBLE DES SOLUTIONS N'EST PAS VIDE
-- ALORS AFFICHER SON CONTENU
Regleaffichersol:
begin
if Collection.Cardinality (Solutions) /= 0 then
Chrono.Stop (0);
if Affdemande then
Affichersol (Solutions);
end if;
return (False); -- F I N I !
end if;
end Regleaffichersol;
-- R-0-C
-- SI LE RANG COURANT DANS L'ECHIQUIER EST DIFFERENT DU RANG A ATTEINDRE
-- ET SI L'ENSEMBLE DES BUTS EST VIDE
-- ALORS REMPLIR L'ENSEMBLE DES BUTS AVEC LES SITUATIONS DE NIVEAU COURANT
-- NON ENCORE OUVERTES
Reglechercherbut:
begin
if Rangcourant /= Rangfinal and
Collection.Cardinality (Buts) = 0 then
Buts := Niveaunonouvert (Rangcourant);
Put (" Nb buts niveau courant :");
Put (Integer (Collection.Cardinality (Buts)));
Put_Line (" ");
return (True);
end if;
end Reglechercherbut;
-- R-0-D
-- SI L'ENSEMBLE DES BUTS N'EST PAS VIDE
-- ALORS COMMENCER / CONTINUER A TRAITER SON CONTENU
Regletraiterbut:
begin
if Collection.Cardinality (Buts) /= 0 then
Rangcourant := Rangcourant + 1;
Situation := Collection.First (Buts);
for Essai in 1 .. Rangfinal loop
if Situationcorrecte
(Situation, Rangcourant, Essai) then
Ajoutsituation (Situation, Rangcourant, Essai);
end if;
end loop;
Fermesituation (Situation);
Collection.Remove (Buts, Situation);
if Collection.Cardinality (Buts) /= 0 then
Rangcourant := Rangcourant -
1; -- continuer au meme niveau
end if; -- tq ens Buts pas vide
return (True);
end if;
end Regletraiterbut;
-- etc ... autres regles du contexte 0
return (False); -- fin des regles de REGLE0
end Regle0;
-- MISE EN ROUTE DU MOTEUR DU S-E
procedure Enroute (Nbrereine : Natural; Affdem : Boolean) is
begin
-- initialisations
Affdemande := Affdem;
Collection.Clear (Buts);
Collection.Clear (Solutions);
Reines.Enroute (Nbrereine);
end Enroute;
-- ENTRETIENT DU MOTEUR DU S-E
function Continue return Boolean is
Resu : Boolean;
begin
case Contexte is
when Contexte0 =>
Resu := Regle0;
-- when contexte1 => resu:=regle1;
when others =>
Resu := False;
end case;
return (Resu);
end Continue;
end Systexpertr;