DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦c7104eacd⟧ TextFile

    Length: 25557 (0x63d5)
    Types: TextFile
    Names: »B«

Derivation

└─⟦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⟧ 

TextFile

separate (Expertsystem)

package body Tuplecollection is

    function Getref (C : Collection.Object; Number : Positive := 1)
                    return Expertsystem.Reference renames Collection.Get;

    function Card (C : Collection.Object) return Natural
        renames Collection.Cardinality;

    function Get (Thetuplecollection : Tuplecollection.Object;
                  Number : Positive := 1) return Expertsystem.Reference is
    begin
        if Number > Thetuplecollection.Count then
            return Nullreference;
        else
            return Thetuplecollection.Cells (Number);
        end if;
    end Get;

    function Isfull (Thetuplecollection : Tuplecollection.Object)
                    return Boolean is
    begin
        return Thetuplecollection.Count >= Thetuplecollection.Size;
    end Isfull;

    procedure Add (Thetuplecollection : in out Tuplecollection.Object;
                   Aref : Expertsystem.Reference) is
    begin
        if Isfull (Thetuplecollection) then
            declare
                Bigtuplecoll : Tuplecollection.Object
                                  (Thetuplecollection.Size +
                                   Thetuplecollection.Size / 2);
            begin
                Bigtuplecoll.Cells (1 .. Thetuplecollection.Size) :=
                   Thetuplecollection.Cells (1 .. Thetuplecollection.Size);
                Bigtuplecoll.Count := Thetuplecollection.Count;
                Bigtuplecoll.Unity := Thetuplecollection.Unity;
                Thetuplecollection := Bigtuplecoll;
            end;
        end if;
        Thetuplecollection.Count := Thetuplecollection.Count + 1;
        Thetuplecollection.Cells (Thetuplecollection.Count) := Aref;
    end Add;

    procedure Merge (Thetuplecollection : in out Tuplecollection.Object;
                     R1 : Expertsystem.Reference := Nullreference;
                     R2 : Expertsystem.Reference := Nullreference;
                     R3 : Expertsystem.Reference := Nullreference;
                     R4 : Expertsystem.Reference := Nullreference;
                     R5 : Expertsystem.Reference := Nullreference;
                     R6 : Expertsystem.Reference := Nullreference;
                     R7 : Expertsystem.Reference := Nullreference;
                     R8 : Expertsystem.Reference := Nullreference;
                     R9 : Expertsystem.Reference := Nullreference;
                     R10 : Expertsystem.Reference := Nullreference) is
    begin
        if R1 /= Nullreference then
            Add (Thetuplecollection, R1);
        end if;
        if R2 /= Nullreference then
            Add (Thetuplecollection, R2);
        end if;
        if R3 /= Nullreference then
            Add (Thetuplecollection, R3);
        end if;
        if R4 /= Nullreference then
            Add (Thetuplecollection, R4);
        end if;
        if R4 /= Nullreference then
            Add (Thetuplecollection, R4);
        end if;
        if R5 /= Nullreference then
            Add (Thetuplecollection, R5);
        end if;
        if R6 /= Nullreference then
            Add (Thetuplecollection, R6);
        end if;
        if R7 /= Nullreference then
            Add (Thetuplecollection, R7);
        end if;
        if R8 /= Nullreference then
            Add (Thetuplecollection, R8);
        end if;
        if R9 /= Nullreference then
            Add (Thetuplecollection, R9);
        end if;
        if R10 /= Nullreference then
            Add (Thetuplecollection, R10);
        end if;

    end Merge;

    function Cardinality
                (Thetuplecollection : Tuplecollection.Object) return Natural is
    begin
        return Thetuplecollection.Count / Thetuplecollection.Unity;
    end Cardinality;

    function Isnull (Thetuplecollection : Tuplecollection.Object)
                    return Boolean is
    begin
        return Thetuplecollection.Count = 0;
    end Isnull;

    function Isnotnull
                (Thetuplecollection : Tuplecollection.Object) return Boolean is
    begin
        return Thetuplecollection.Count /= 0;
    end Isnotnull;

    function Join1 (C1 : Collection.Object; Quantity : Natural := 1)
                   return Tuplecollection.Object is
        Thetuplecollection : Tuplecollection.Object;
        R1 : Expertsystem.Reference;
    begin
        Thetuplecollection.Count := 0;
        Thetuplecollection.Unity := 1;
        for I in 1 .. Card (C1) loop
            R1 := Getref (C1, I);
            if Match (R1) then
                Merge (Thetuplecollection, R1);
                if (Quantity /= Any) and then
                   (Thetuplecollection.Count / Thetuplecollection.Unity >=
                    Quantity) then
                    return Thetuplecollection;
                end if;
            end if;
        end loop;
        return Thetuplecollection;
    end Join1;

    function Join2 (C1, C2 : Collection.Object; Quantity : Natural := 1)
                   return Tuplecollection.Object is
        Thetuplecollection : Tuplecollection.Object;
        R1, R2 : Expertsystem.Reference;
    begin
        Thetuplecollection.Count := 0;
        Thetuplecollection.Unity := 2;
        for I in 1 .. Card (C1) loop
            R1 := Getref (C1, I);
            for J in 1 .. Card (C2) loop
                R2 := Getref (C2, J);
                if Match (R1, R2) then
                    Merge (Thetuplecollection, R1, R2);
                    if (Quantity /= Any) and then
                       (Thetuplecollection.Count / Thetuplecollection.Unity >=
                        Quantity) then
                        return Thetuplecollection;
                    end if;
                end if;
            end loop;
        end loop;
        return Thetuplecollection;
    end Join2;

    function Join3 (C1, C2, C3 : Collection.Object; Quantity : Natural := 1)
                   return Tuplecollection.Object is
        Thetuplecollection : Tuplecollection.Object;
        R1, R2, R3 : Expertsystem.Reference;
    begin
        Thetuplecollection.Count := 0;
        Thetuplecollection.Unity := 3;
        for I in 1 .. Card (C1) loop
            R1 := Getref (C1, I);
            for J in 1 .. Card (C2) loop
                R2 := Getref (C2, J);
                for K in 1 .. Card (C3) loop
                    R3 := Getref (C3, K);
                    if Match (R1, R2, R3) then
                        Merge (Thetuplecollection, R1, R2, R3);
                        if (Quantity /= Any) and then
                           (Thetuplecollection.Count /
                            Thetuplecollection.Unity >= Quantity) then
                            return Thetuplecollection;
                        end if;
                    end if;
                end loop;
            end loop;
        end loop;
        return Thetuplecollection;
    end Join3;

    function Join4 (C1, C2, C3, C4 : Collection.Object; Quantity : Natural := 1)
                   return Tuplecollection.Object is
        Thetuplecollection : Tuplecollection.Object;
        R1, R2, R3, R4 : Expertsystem.Reference;
    begin
        Thetuplecollection.Count := 0;
        Thetuplecollection.Unity := 4;
        for I in 1 .. Card (C1) loop
            R1 := Getref (C1, I);
            for J in 1 .. Card (C2) loop
                R2 := Getref (C2, J);
                for K in 1 .. Card (C3) loop
                    R3 := Getref (C3, K);
                    for L in 1 .. Card (C4) loop
                        R4 := Getref (C4, L);
                        if Match (R1, R2, R3, R4) then
                            Merge (Thetuplecollection, R1, R2, R3, R4);
                            if (Quantity /= Any) and then
                               (Thetuplecollection.Count /
                                Thetuplecollection.Unity >= Quantity) then
                                return Thetuplecollection;
                            end if;
                        end if;
                    end loop;
                end loop;
            end loop;
        end loop;
        return Thetuplecollection;
    end Join4;

    function Join5 (C1, C2, C3, C4, C5 : Collection.Object;
                    Quantity : Natural := 1) return Tuplecollection.Object is
        Thetuplecollection : Tuplecollection.Object;
        R1, R2, R3, R4, R5 : Expertsystem.Reference;
    begin
        Thetuplecollection.Count := 0;
        Thetuplecollection.Unity := 5;
        for I in 1 .. Card (C1) loop
            R1 := Getref (C1, I);
            for J in 1 .. Card (C2) loop
                R2 := Getref (C2, J);
                for K in 1 .. Card (C3) loop
                    R3 := Getref (C3, K);
                    for L in 1 .. Card (C4) loop
                        R4 := Getref (C4, L);
                        for M in 1 .. Card (C5) loop
                            R5 := Getref (C5, M);
                            if Match (R1, R2, R3, R4, R5) then
                                Merge (Thetuplecollection, R1, R2, R3, R4, R5);
                                if (Quantity /= Any) and then
                                   (Thetuplecollection.Count /
                                    Thetuplecollection.Unity >= Quantity) then
                                    return Thetuplecollection;
                                end if;
                            end if;
                        end loop;
                    end loop;
                end loop;
            end loop;
        end loop;
        return Thetuplecollection;
    end Join5;

    function Join6 (C1, C2, C3, C4, C5, C6 : Collection.Object;
                    Quantity : Natural := 1) return Tuplecollection.Object is
        Thetuplecollection : Tuplecollection.Object;
        R1, R2, R3, R4, R5, R6 : Expertsystem.Reference;
    begin
        Thetuplecollection.Count := 0;
        Thetuplecollection.Unity := 6;
        for I in 1 .. Card (C1) loop
            R1 := Getref (C1, I);
            for J in 1 .. Card (C2) loop
                R2 := Getref (C2, J);
                for K in 1 .. Card (C3) loop
                    R3 := Getref (C3, K);
                    for L in 1 .. Card (C4) loop
                        R4 := Getref (C4, L);
                        for M in 1 .. Card (C5) loop
                            R5 := Getref (C5, M);
                            for N in 1 .. Card (C6) loop
                                R6 := Getref (C6, N);
                                if Match (R1, R2, R3, R4, R5, R6) then
                                    Merge (Thetuplecollection, R1,
                                           R2, R3, R4, R5, R6);
                                    if (Quantity /= Any) and then
                                       (Thetuplecollection.Count /
                                        Thetuplecollection.Unity >=
                                        Quantity) then
                                        return Thetuplecollection;
                                    end if;
                                end if;
                            end loop;
                        end loop;
                    end loop;
                end loop;
            end loop;
        end loop;
        return Thetuplecollection;
    end Join6;

    function Join7 (C1, C2, C3, C4, C5, C6, C7 : Collection.Object;
                    Quantity : Natural := 1) return Tuplecollection.Object is
        Thetuplecollection : Tuplecollection.Object;
        R1, R2, R3, R4, R5, R6, R7 : Expertsystem.Reference;
    begin
        Thetuplecollection.Count := 0;
        Thetuplecollection.Unity := 7;
        for I in 1 .. Card (C1) loop
            R1 := Getref (C1, I);
            for J in 1 .. Card (C2) loop
                R2 := Getref (C2, J);
                for K in 1 .. Card (C3) loop
                    R3 := Getref (C3, K);
                    for L in 1 .. Card (C4) loop
                        R4 := Getref (C4, L);
                        for M in 1 .. Card (C5) loop
                            R5 := Getref (C5, M);
                            for N in 1 .. Card (C6) loop
                                R6 := Getref (C6, N);
                                for P in 1 .. Card (C7) loop
                                    R7 := Getref (C7, P);
                                    if Match (R1, R2, R3, R4, R5, R6, R7) then
                                        Merge (Thetuplecollection, R1,
                                               R2, R3, R4, R5, R6, R7);
                                        if (Quantity /= Any) and then
                                           (Thetuplecollection.Count /
                                            Thetuplecollection.Unity >=
                                            Quantity) then
                                            return Thetuplecollection;
                                        end if;
                                    end if;
                                end loop;
                            end loop;
                        end loop;
                    end loop;
                end loop;
            end loop;
        end loop;
        return Thetuplecollection;
    end Join7;

    function Join8 (C1, C2, C3, C4, C5, C6, C7, C8 : Collection.Object;
                    Quantity : Natural := 1) return Tuplecollection.Object is
        Thetuplecollection : Tuplecollection.Object;
        R1, R2, R3, R4, R5, R6, R7, R8 : Expertsystem.Reference;
    begin
        Thetuplecollection.Count := 0;
        Thetuplecollection.Unity := 8;
        for I in 1 .. Card (C1) loop
            R1 := Getref (C1, I);
            for J in 1 .. Card (C2) loop
                R2 := Getref (C2, J);
                for K in 1 .. Card (C3) loop
                    R3 := Getref (C3, K);
                    for L in 1 .. Card (C4) loop
                        R4 := Getref (C4, L);
                        for M in 1 .. Card (C5) loop
                            R5 := Getref (C5, M);
                            for N in 1 .. Card (C6) loop
                                R6 := Getref (C6, N);
                                for P in 1 .. Card (C7) loop
                                    R7 := Getref (C7, P);
                                    for Q in 1 .. Card (C8) loop
                                        R8 := Getref (C8, Q);
                                        if Match (R1, R2, R3, R4, R5,
                                                  R6, R7, R8) then
                                            Merge (Thetuplecollection, R1, R2,
                                                   R3, R4, R5, R6, R7, R8);
                                            if (Quantity /= Any) and then
                                               (Thetuplecollection.Count /
                                                Thetuplecollection.Unity >=
                                                Quantity) then
                return Thetuplecollection;
                                            end if;
                                        end if;
                                    end loop;
                                end loop;
                            end loop;
                        end loop;
                    end loop;
                end loop;
            end loop;
        end loop;
        return Thetuplecollection;
    end Join8;

    function Join9 (C1, C2, C3, C4, C5, C6, C7, C8, C9 : Collection.Object;
                    Quantity : Natural := 1) return Tuplecollection.Object is
        Thetuplecollection : Tuplecollection.Object;
        R1, R2, R3, R4, R5, R6, R7, R8, R9 : Expertsystem.Reference;
    begin
        Thetuplecollection.Count := 0;
        Thetuplecollection.Unity := 9;
        for I in 1 .. Card (C1) loop
            R1 := Getref (C1, I);
            for J in 1 .. Card (C2) loop
                R2 := Getref (C2, J);
                for K in 1 .. Card (C3) loop
                    R3 := Getref (C3, K);
                    for L in 1 .. Card (C4) loop
                        R4 := Getref (C4, L);
                        for M in 1 .. Card (C5) loop
                            R5 := Getref (C5, M);
                            for N in 1 .. Card (C6) loop
                                R6 := Getref (C6, N);
                                for P in 1 .. Card (C7) loop
                                    R7 := Getref (C7, P);
                                    for Q in 1 .. Card (C8) loop
                                        R8 := Getref (C8, Q);
                                        for R in 1 .. Card (C9) loop
                                            R9 := Getref (C9, R);
                                            if Match (R1, R2, R3, R4, R5,
                                                      R6, R7, R8, R9) then
                Merge (Thetuplecollection, R1, R2, R3, R4, R5, R6, R7, R8, R9);
                if (Quantity /= Any) and then
                   (Thetuplecollection.Count / Thetuplecollection.Unity >=
                    Quantity) then
                    return Thetuplecollection;
                end if;
                                            end if;
                                        end loop;
                                    end loop;
                                end loop;
                            end loop;
                        end loop;
                    end loop;
                end loop;
            end loop;
        end loop;
        return Thetuplecollection;
    end Join9;

    function Join10 (C1, C2, C3, C4, C5, C6, C7, C8, C9, C10 :
                        Collection.Object;
                     Quantity : Natural := 1) return Tuplecollection.Object is
        Thetuplecollection : Tuplecollection.Object;
        R1, R2, R3, R4, R5, R6, R7, R8, R9, R10 : Expertsystem.Reference;
    begin
        Thetuplecollection.Count := 0;
        Thetuplecollection.Unity := 10;
        for I in 1 .. Card (C1) loop
            R1 := Getref (C1, I);
            for J in 1 .. Card (C2) loop
                R2 := Getref (C2, J);
                for K in 1 .. Card (C3) loop
                    R3 := Getref (C3, K);
                    for L in 1 .. Card (C4) loop
                        R4 := Getref (C4, L);
                        for M in 1 .. Card (C5) loop
                            R5 := Getref (C5, M);
                            for N in 1 .. Card (C6) loop
                                R6 := Getref (C6, N);
                                for P in 1 .. Card (C7) loop
                                    R7 := Getref (C7, P);
                                    for Q in 1 .. Card (C8) loop
                                        R8 := Getref (C8, Q);
                                        for R in 1 .. Card (C9) loop
                                            R9 := Getref (C9, R);
                                            for S in 1 .. Card (C10) loop
                R10 := Getref (C10, S);
                if Match (R1, R2, R3, R4, R5, R6, R7, R8, R9, R10) then
                    Merge (Thetuplecollection, R1, R2, R3,
                           R4, R5, R6, R7, R8, R9, R10);
                    if (Quantity /= Any) and then
                       (Thetuplecollection.Count / Thetuplecollection.Unity >=
                        Quantity) then
                        return Thetuplecollection;
                    end if;
                end if;
                                            end loop;
                                        end loop;
                                    end loop;
                                end loop;
                            end loop;
                        end loop;
                    end loop;
                end loop;
            end loop;
        end loop;
        return Thetuplecollection;
    end Join10;

    function Themost (Thetuplecollection : Object) return Tuple.Object is
        Tu, Ti : Tuple.Object;
    begin
        if Thetuplecollection.Count /= 0 then
            Tu := First (Thetuplecollection);
            for I in 2 .. Thetuplecollection.Count /
                             Thetuplecollection.Unity loop
                Ti := Get (Thetuplecollection, I);
                if not Predicate (Tu, Ti) then
                    Tu := Ti;
                end if;
            end loop;
        end if;
        return Tu;
    end Themost;

    function Restrict (Thetuplecollection : Tuplecollection.Object;
                       Quantity : Natural := Any)
                      return Tuplecollection.Object is
        Result : Tuplecollection.Object;
        Ti : Tuple.Object;
    begin
        if Thetuplecollection.Count /= 0 then
            Result.Unity := Thetuplecollection.Unity;
            for I in 1 .. Thetuplecollection.Count /
                             Thetuplecollection.Unity loop
                Ti := Get (Thetuplecollection, I);
                if Predicate (Ti) then
                    for J in 1 .. Thetuplecollection.Unity loop
                        Add (Result, Tuple.Get (Ti, J));
                    end loop;
                    if (Quantity /= Any) and then
                       (Result.Count / Result.Unity >= Quantity) then
                        return Result;
                    end if;
                end if;
            end loop;
        end if;
        return Result;
    end Restrict;

    function Findone (Thetuplecollection : Tuplecollection.Object)
                     return Tuple.Object is
        T : Tuple.Object;
    begin
        if Thetuplecollection.Count /= 0 then
            for I in 1 .. Thetuplecollection.Count /
                             Thetuplecollection.Unity loop
                T := Get (Thetuplecollection, I);
                if Predicate (T) then
                    return T;
                end if;
            end loop;
        end if;
        return T;
    end Findone;

    function Get (Thetuplecollection : Tuplecollection.Object;
                  Number : Positive := 1) return Tuple.Object is
        Tu : Tuple.Object;
    begin
        if Number <= Thetuplecollection.Count / Thetuplecollection.Unity then
            for I in 1 .. Thetuplecollection.Unity loop
                Tuple.Add (Tu,
                           Get (Thetuplecollection,
                                (Number - 1) * Thetuplecollection.Unity + I));
            end loop;
        end if;
        return Tu;
    end Get;

    function First (Thetuplecollection : Tuplecollection.Object)
                   return Tuple.Object is
    begin
        return Get (Thetuplecollection, 1);
    end First;

    function Get (Thetuplecollection : Tuplecollection.Object;
                  Frompos : Positive := 1;
                  Topos : Positive)  
                 return Tuplecollection.Object is
        Tuc : Tuplecollection.Object;
        Bornefrom : Natural;
        Borneto : Natural;
    begin
        if Topos > Thetuplecollection.Count / Thetuplecollection.Unity then
            Borneto := Thetuplecollection.Count / Thetuplecollection.Unity;
        else
            Borneto := Topos;
        end if;
        if Frompos < Thetuplecollection.Cells'First then
            Bornefrom := Thetuplecollection.Cells'First;
        else
            Bornefrom := Frompos;
        end if;

        Tuc.Unity := Thetuplecollection.Unity;
        for I in Bornefrom .. Thetuplecollection.Unity * Borneto loop
            Add (Tuc, Get (Thetuplecollection, I));
        end loop;
        return Tuc;
    end Get;

    procedure Forall (Thetuplecollection : Tuplecollection.Object) is
    begin
        for I in 1 .. Thetuplecollection.Count / Thetuplecollection.Unity loop
            declare
                Tu : Tuple.Object;
            begin
                for J in 1 .. Thetuplecollection.Unity loop
                    Tuple.Add (Tu, Get
                                      (Thetuplecollection,
                                       (I - 1) * Thetuplecollection.Unity + J));
                end loop;
                Action (Tu);
            end;
        end loop;
    end Forall;


    package body Iterator is
        function Open (Thetuplecollection : Tuplecollection.Object)
                      return Iter is
        begin
            if Thetuplecollection.Count = 0 then
                return 0;
            else
                return 1;
            end if;
        end Open;

        function Get (Thetuplecollection : Tuplecollection.Object; I : Iter)
                     return Tuple.Object is
        begin
            if I > Iter (Thetuplecollection.Count /
                         Thetuplecollection.Unity) then
                raise Illegalaccess;
            end if;
            return Get (Thetuplecollection, Positive (I));
        exception
            when Constraint_Error =>
                raise Illegalaccess;
        end Get;

        function Next (Thetuplecollection : Tuplecollection.Object; I : Iter)
                      return Iter is
            Idx : Integer;
        begin
            Idx := Integer (I) + 1;
            if Idx > Thetuplecollection.Count / Thetuplecollection.Unity then
                return 0;
            else
                return Iter (Idx);
            end if;
        exception
            when Constraint_Error =>
                raise Illegalaccess;
        end Next;

        function Atend (Thetuplecollection : Tuplecollection.Object; I : Iter)
                       return Boolean is
        begin
            return I = 0;
        end Atend;
    end Iterator;

end Tuplecollection;