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

⟦7d6532889⟧ Ada Source

    Length: 5120 (0x1400)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, procedure Bbr_Test, seg_02a45c

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 Bbr_Attributes;
with Bbr_Do_Action;
with Bbr_Rule_Base;
with Condition;
with Fact;
with Bbr_Frames;
with Text_Io;

use Bbr_Attributes;
use Bbr_Frames;
use Condition;

procedure Bbr_Test is
    use Fact;  
    function Firable_On_Facts return Fact.Collection
        renames Bbr_Rule_Base.Rule_Base.Firable_On_Facts;

    function Firable_On_Rule return Bbr_Rule_Base.Rule_Base.Rule_Id
        renames Bbr_Rule_Base.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
                Bbr_Do_Action (For_Rule => Firable_On_Rule, On_Facts => Result);
            else
                exit;
            end if;
        end;
    end loop;
    Dump_Working_Memory;
end Bbr_Test;
pragma Main;

E3 Meta Data

    nblk1=4
    nid=3
    hdr6=6
        [0x00] rec0=20 rec1=00 rec2=01 rec3=056
        [0x01] rec0=19 rec1=00 rec2=04 rec3=020
        [0x02] rec0=08 rec1=00 rec2=02 rec3=000
        [0x03] rec0=02 rec1=21 rec2=12 rec3=442
    tail 0x21522752283e26c68829e 0x42a00088462063c03
Free Block Chain:
  0x3: 0000  00 00 00 7d 80 11 20 20 20 20 20 20 20 20 20 20  ┆   }            ┆