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

⟦2255d06c0⟧ Ada Source

    Length: 4096 (0x1000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, procedure Test_Rule_Base, seg_02aec4

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 Application;
with Attribute;
with Condition;
with Do_Action;
with Fact;
with Some_Frames;
with Text_Io;

use Attribute;
use Condition;
use Some_Frames;

procedure Test_Rule_Base is
    use Fact;  
    function Firable_On_Facts return Fact.Collection
        renames Application.Rule_Base.Firable_On_Facts;

    function Firable_On_Rule return Application.Rule_Base.Rule_Id
        renames Application.Rule_Base.Firable_On_Rule;

    procedure Load_Initial_Working_Memory is
    begin
        Robots.Add ((Colour => Green, State => Free));
        Robots.Add ((Colour => Red, State => Busy));
        Robots.Add ((Colour => Red, State => Free));
        Robots.Add ((Colour => Blue, State => Free));
        Robots.Add ((Colour => Green, State => Busy));

        Balls.Add ((Size => 50, Colour => Blue, Place => On_Heap));
        Balls.Add ((Size => 75, Colour => Green, Place => On_Heap));
        Balls.Add ((Size => 95, Colour => Red, Place => On_Heap));
        Balls.Add ((Size => 100, Colour => Blue, Place => On_Heap));

        Boxes.Add ((Size => 750, Colour => Red, State => Free));
        Boxes.Add ((Size => 10000, Colour => Green, State => Free));
        Boxes.Add ((Size => 150, Colour => Red, State => Busy));
    end Load_Initial_Working_Memory;

    procedure Dump_Working_Memory is  
        Facts : constant Fact.Collection :=
           Fact.Find (Pattern'(1 .. Max_Slots => Is_Any));
    begin
        Text_Io.Put_Line ("---> the working memory now contains " &
                          Integer'Image (Facts'Length) & " facts");
        Fact.Put (Facts);
    end Dump_Working_Memory;

begin
    Load_Initial_Working_Memory;
    loop
        declare
            Result : constant Fact.Collection := Firable_On_Facts;
        begin
            if Result /= Empty_Collection then
                Do_Action (For_Rule => Firable_On_Rule, On_Facts => Result);
            else
                exit;
            end if;
        end;
    end loop;
    Dump_Working_Memory;
end Test_Rule_Base;

E3 Meta Data

    nblk1=3
    nid=0
    hdr6=6
        [0x00] rec0=20 rec1=00 rec2=01 rec3=072
        [0x01] rec0=1a rec1=00 rec2=03 rec3=024
        [0x02] rec0=06 rec1=00 rec2=02 rec3=000
    tail 0x21523361883e5850b872d 0x42a00088462063c03