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

⟦109e85eb8⟧ Ada Source

    Length: 17408 (0x4400)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, generic, package Generic_Rule_Base, seg_03c45a

Derivation

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

E3 Source Code



with Generic_Conflict_Set;
with Output_Stream;  
with Recency;
generic

    Max_Rules                      : in Positive := 50;  
    Max_Condition_Elements_By_Rule : in Positive := 10;
    Max_Condition_Elements         : in Positive := 200;

    type Rule_Bundles is (<>);

    type Fact_Name       is private;
    type Fact_Collection is array (Positive range <>) of Fact_Name;
    Empty_Fact_Collection : Fact_Collection;  
    with function  Get_Date (From_Fact : Fact_Name) return Recency.Object;
    with procedure Fact_Put (The_Collection : Fact_Collection;
                             Where          : Output_Stream.Object);

    type Fact_Query is private;
    Null_Fact_Query : Fact_Query;
    type Fact_Queries is array (Positive range <>) of Fact_Query;
    Null_Premiss : Fact_Queries;

    with function Retrieve (Filter : Fact_Queries) return Fact_Collection is <>;
    with procedure Queries_Put (The_Queries : Fact_Queries;
                                Where       : Output_Stream.Object);

package Generic_Rule_Base is

    subtype Rule_Id is Natural;
    No_Rule : constant Rule_Id := 0;
    subtype Premiss_Size is Natural range 0 .. Max_Condition_Elements_By_Rule;

    function  Count             return Natural;
    function  Get (R : Rule_Id) return Rule_Bundles;
    procedure Put (R : Rule_Id; Where : Output_Stream.Object);

    procedure Null_Action (On : Fact_Collection);
    generic  
        with procedure Retrieve  (The_Rule : Natural; Filter : Fact_Queries);
        with procedure Do_Action (For_Rule : Rule_Id;
                                  On_Facts : Fact_Collection);
    procedure Infere_With_Conflict_Set;


    generic
        with procedure Do_Action (For_Rule : Rule_Id;
                                  On_Facts : Fact_Collection);
    procedure Infere;

    procedure Halt;

    function Inference_Count    return Natural;
    function Elapsed_Time       return Duration;
    function Firings_Per_Second return Natural;


    Illegal_Bundle  : exception;
    Illegal_Rule_Id : exception;
    Overflow        : exception;


    package Rule_Instance is

        type Object (Size : Premiss_Size := 0) is private;

        Null_Object : constant Object;

        function  "<" (Left, Right : Object) return Boolean;
        function  Make (The_Rule_Id         : Rule_Id;
                        The_Fact_Collection : Fact_Collection) return Object;
        function  Get_Rule (From : Object) return Rule_Id;
        function  Get_Facts (From : Object) return Fact_Collection;
        procedure Put (The_Instance : Object; Where : Output_Stream.Object);

    private
        type Object (Size : Premiss_Size := 0) is
            record
                The_Rule  : Rule_Id;
                The_Facts : Fact_Collection (1 .. Size);
            end record;

        Null_Object : constant Object :=
           (Size => 0, The_Rule => No_Rule, The_Facts => Empty_Fact_Collection);

    end Rule_Instance;


    package Conflict_Set is new Generic_Conflict_Set
                                   (Instance => Rule_Instance.Object,
                                    "<"      => Rule_Instance."<",
                                    Put      => Rule_Instance.Put);


    generic
        The_Bundle : Rule_Bundles;
        type Rule_Names is (<>);
        Nothing : Rule_Names := Rule_Names'Last;

        Rule_1    : Rule_Names   := Nothing;
        Name_1    : String       := Rule_Names'Image (Rule_1);
        Premiss_1 : Fact_Queries := Null_Premiss;
        with procedure Action_1 (On : Fact_Collection) is
           Generic_Rule_Base.Null_Action;

        Rule_2    : Rule_Names   := Nothing;
        Name_2    : String       := Rule_Names'Image (Rule_2);
        Premiss_2 : Fact_Queries := Null_Premiss;
        with procedure Action_2 (On : Fact_Collection) is
           Generic_Rule_Base.Null_Action;

        Rule_3    : Rule_Names   := Nothing;
        Name_3    : String       := Rule_Names'Image (Rule_3);
        Premiss_3 : Fact_Queries := Null_Premiss;
        with procedure Action_3 (On : Fact_Collection) is
           Generic_Rule_Base.Null_Action;

        Rule_4    : Rule_Names   := Nothing;
        Name_4    : String       := Rule_Names'Image (Rule_4);
        Premiss_4 : Fact_Queries := Null_Premiss;
        with procedure Action_4 (On : Fact_Collection) is
           Generic_Rule_Base.Null_Action;

        Rule_5    : Rule_Names   := Nothing;
        Name_5    : String       := Rule_Names'Image (Rule_5);
        Premiss_5 : Fact_Queries := Null_Premiss;
        with procedure Action_5 (On : Fact_Collection) is
           Generic_Rule_Base.Null_Action;

        Rule_6    : Rule_Names   := Nothing;
        Name_6    : String       := Rule_Names'Image (Rule_6);
        Premiss_6 : Fact_Queries := Null_Premiss;
        with procedure Action_6 (On : Fact_Collection) is
           Generic_Rule_Base.Null_Action;

        Rule_7    : Rule_Names   := Nothing;
        Name_7    : String       := Rule_Names'Image (Rule_7);
        Premiss_7 : Fact_Queries := Null_Premiss;
        with procedure Action_7 (On : Fact_Collection) is
           Generic_Rule_Base.Null_Action;

        Rule_8    : Rule_Names   := Nothing;
        Name_8    : String       := Rule_Names'Image (Rule_8);
        Premiss_8 : Fact_Queries := Null_Premiss;
        with procedure Action_8 (On : Fact_Collection) is
           Generic_Rule_Base.Null_Action;

        Rule_9    : Rule_Names   := Nothing;
        Name_9    : String       := Rule_Names'Image (Rule_9);
        Premiss_9 : Fact_Queries := Null_Premiss;
        with procedure Action_9 (On : Fact_Collection) is
           Generic_Rule_Base.Null_Action;

        Rule_10    : Rule_Names   := Nothing;
        Name_10    : String       := Rule_Names'Image (Rule_10);
        Premiss_10 : Fact_Queries := Null_Premiss;
        with procedure Action_10 (On : Fact_Collection) is
           Generic_Rule_Base.Null_Action;

        Rule_11    : Rule_Names   := Nothing;
        Name_11    : String       := Rule_Names'Image (Rule_11);
        Premiss_11 : Fact_Queries := Null_Premiss;
        with procedure Action_11 (On : Fact_Collection) is
           Generic_Rule_Base.Null_Action;

        Rule_12    : Rule_Names   := Nothing;
        Name_12    : String       := Rule_Names'Image (Rule_12);
        Premiss_12 : Fact_Queries := Null_Premiss;
        with procedure Action_12 (On : Fact_Collection) is
           Generic_Rule_Base.Null_Action;

        Rule_13    : Rule_Names   := Nothing;
        Name_13    : String       := Rule_Names'Image (Rule_13);
        Premiss_13 : Fact_Queries := Null_Premiss;
        with procedure Action_13 (On : Fact_Collection) is
           Generic_Rule_Base.Null_Action;

        Rule_14    : Rule_Names   := Nothing;
        Name_14    : String       := Rule_Names'Image (Rule_14);
        Premiss_14 : Fact_Queries := Null_Premiss;
        with procedure Action_14 (On : Fact_Collection) is
           Generic_Rule_Base.Null_Action;

        Rule_15    : Rule_Names   := Nothing;
        Name_15    : String       := Rule_Names'Image (Rule_15);
        Premiss_15 : Fact_Queries := Null_Premiss;
        with procedure Action_15 (On : Fact_Collection) is
           Generic_Rule_Base.Null_Action;

        Rule_16    : Rule_Names   := Nothing;
        Name_16    : String       := Rule_Names'Image (Rule_16);
        Premiss_16 : Fact_Queries := Null_Premiss;
        with procedure Action_16 (On : Fact_Collection) is
           Generic_Rule_Base.Null_Action;

        Rule_17    : Rule_Names   := Nothing;
        Name_17    : String       := Rule_Names'Image (Rule_17);
        Premiss_17 : Fact_Queries := Null_Premiss;
        with procedure Action_17 (On : Fact_Collection) is
           Generic_Rule_Base.Null_Action;

        Rule_18    : Rule_Names   := Nothing;
        Name_18    : String       := Rule_Names'Image (Rule_18);
        Premiss_18 : Fact_Queries := Null_Premiss;
        with procedure Action_18 (On : Fact_Collection) is
           Generic_Rule_Base.Null_Action;

        Rule_19    : Rule_Names   := Nothing;
        Name_19    : String       := Rule_Names'Image (Rule_19);
        Premiss_19 : Fact_Queries := Null_Premiss;
        with procedure Action_19 (On : Fact_Collection) is
           Generic_Rule_Base.Null_Action;

        Rule_20    : Rule_Names   := Nothing;
        Name_20    : String       := Rule_Names'Image (Rule_20);
        Premiss_20 : Fact_Queries := Null_Premiss;
        with procedure Action_20 (On : Fact_Collection) is
           Generic_Rule_Base.Null_Action;


    package Generic_Rule_Bundle is
        procedure Do_Action (For_Rule : Rule_Id; On_Facts : Fact_Collection);
    end Generic_Rule_Bundle;
end Generic_Rule_Base;

E3 Meta Data

    nblk1=10
    nid=c
    hdr6=1e
        [0x00] rec0=1b rec1=00 rec2=01 rec3=02a
        [0x01] rec0=1c rec1=00 rec2=06 rec3=05c
        [0x02] rec0=04 rec1=00 rec2=0e rec3=00c
        [0x03] rec0=1c rec1=00 rec2=0d rec3=01c
        [0x04] rec0=03 rec1=00 rec2=09 rec3=028
        [0x05] rec0=18 rec1=00 rec2=0a rec3=048
        [0x06] rec0=01 rec1=00 rec2=10 rec3=01a
        [0x07] rec0=17 rec1=00 rec2=08 rec3=016
        [0x08] rec0=01 rec1=00 rec2=0f rec3=004
        [0x09] rec0=16 rec1=00 rec2=05 rec3=054
        [0x0a] rec0=01 rec1=00 rec2=02 rec3=064
        [0x0b] rec0=17 rec1=00 rec2=0b rec3=016
        [0x0c] rec0=01 rec1=00 rec2=07 rec3=00e
        [0x0d] rec0=15 rec1=00 rec2=04 rec3=01e
        [0x0e] rec0=13 rec1=00 rec2=03 rec3=000
        [0x0f] rec0=13 rec1=00 rec2=03 rec3=000
    tail 0x2173a6a4485824f67d930 0x42a00088462063c03
Free Block Chain:
  0xc: 0000  00 00 00 09 00 06 20 20 20 20 49 6c 06 00 00 00  ┆          Il    ┆