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

⟦7d2b1538c⟧ Ada Source

    Length: 9216 (0x2400)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Working_Memory, seg_02ce6c, seg_02cf0f, seg_02d136, separate Generic_Fact_Base

Derivation

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

E3 Source Code



separate (Generic_Fact_Base)
package body Working_Memory is

    type Class_Objects is array (Class_Names) of Class.Object;
    The_Classes : Class_Objects := (others => Class.Null_Class);

    procedure Make_Empty is
    begin
        for C in Class_Names loop  
            if C /= Null_Class_Name then
                Class.Make_Empty (The_Classes (C));
            end if;
        end loop;
    end Make_Empty;

    function Get (Using : Class_Names) return Class.Object is
    begin
        return The_Classes (Using);
    end Get;

    function Retrieve (Filter : Query.Objects) return Class.User_Objects is
        Result : Class.User_Objects (Filter'Range);
        function Recursive_Search (Index : Positive) return Boolean is
            The_Class_Name : Class_Names;
            The_Class      : Class.Object;
        begin
            if Index > Filter'Last then
                return True;
            else
                The_Class_Name := Filter (Index).Class;
                The_Class      := The_Classes (The_Class_Name);
                case Filter (Index).Kind is
                    when Query.Find =>
                        for Id in 1 .. Class.Last_Instance (The_Class) loop
                            if Class.Match (The_Instance     => Id,
                                            Against_Patterns =>
                                               Filter (Index).Value,
                                            Using_Class      => The_Class) then
                                if Recursive_Search (Index + 1) then
                                    Result (Index) :=
                                       Class.As_User_Object (Id, The_Class);
                                    return True;
                                end if;
                            end if;
                        end loop;
                    when Query.Check_No =>
                        for Id in 1 .. Class.Last_Instance (The_Class) loop
                            if Class.Match (The_Instance     => Id,
                                            Against_Patterns =>
                                               Filter (Index).Value,
                                            Using_Class      => The_Class) then
                                return False;
                            end if;
                        end loop;
                        if Recursive_Search (Index + 1) then
                            Result (Index) := Class.Null_User_Object;
                            return True;
                        end if;
                end case;
                return False;
            end if;
        end Recursive_Search;
    begin
        if Filter'Length /= 0 and then Recursive_Search (Filter'First) then
            return Result;
        else
            return Class.No_User_Objects;
        end if;
    end Retrieve;


    procedure Generic_Put (Where : Output_Stream.Object) is  
        procedure Class_Put is new Class.Generic_Put (Put);
    begin
        for C in The_Classes'Range loop  
            if C /= Null_Class_Name then
                Class_Put (The_Class => The_Classes (C), Where => Where);
            end if;
        end loop;
    end Generic_Put;

    procedure Default_Put (Where : Output_Stream.Object) is
        procedure Default_Working_Memory_Put is
           new Generic_Put (Class.Default_Put);
    begin
        Default_Working_Memory_Put (Where);
    end Default_Put;

    procedure Register (The_Class : Class.Object) is
    begin
        The_Classes (Class.Class_Name_Of (The_Class)) := The_Class;
    end Register;

end Working_Memory;

E3 Meta Data

    nblk1=8
    nid=3
    hdr6=a
        [0x00] rec0=1f rec1=00 rec2=01 rec3=044
        [0x01] rec0=00 rec1=00 rec2=05 rec3=008
        [0x02] rec0=11 rec1=00 rec2=02 rec3=076
        [0x03] rec0=19 rec1=00 rec2=06 rec3=04e
        [0x04] rec0=17 rec1=00 rec2=04 rec3=000
        [0x05] rec0=16 rec1=00 rec2=04 rec3=001
        [0x06] rec0=f5 rec1=40 rec2=00 rec3=002
        [0x07] rec0=08 rec1=40 rec2=46 rec3=7d4
    tail 0x21525ad2c841245067c08 0x42a00088462063c03
Free Block Chain:
  0x3: 0000  00 08 00 08 80 05 68 20 28 54 68 05 3d 20 4e 75  ┆      h (Th = Nu┆
  0x8: 0000  00 07 02 84 80 48 20 20 20 20 20 20 20 20 20 20  ┆     H          ┆
  0x7: 0000  00 00 01 b2 80 1d 73 73 2e 43 6f 6c 6c 65 63 74  ┆      ss.Collect┆