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 - metrics - download
Index: B T

⟦b54a06f12⟧ TextFile

    Length: 2363 (0x93b)
    Types: TextFile
    Names: »B«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile

with Instrument;
use Instrument;
-- BENCHMARK   CHARACTER STRING SEARCH.
procedure Chssa2 is
    -- PRAGMA SUPPRESS (ACCESS_CHECK);
    -- PRAGMA SUPPRESS (DISCRIMINANT_CHECK);
    -- PRAGMA SUPPRESS (INDEX_CHECK);
    -- PRAGMA SUPPRESS (LENGTH_CHECK);
    -- PRAGMA SUPPRESS (RANGE_CHECK);
    -- PRAGMA SUPPRESS (DIVISION_CHECK);
    -- PRAGMA SUPPRESS (OVERFLOW_CHECK);
    -- PRAGMA SUPPRESS (STORAGE_CHECK);

    subtype Short_Integer is Integer;

    type String is array (1 .. 120) of Character;
    Numiterations : constant Integer := 10000;
    -- TO MAKE IT MILLISECONDS/SEC
    Position_To_Pass : Short_Integer;

    function Strsch (S, K : in String; Ns, Nk : in Short_Integer)
                    return Short_Integer is

        I, J : Short_Integer;
        Base, Ksave, Cont : Short_Integer;
        Kend, Ssave : Short_Integer;
        R : Short_Integer;
    begin
        Base := 1;
        Ksave := 1;
        Cont := Ns - Nk + Base;
        Kend := Ksave + Nk - 1;
        I := 1;
        J := 1;
        <<Top>>
            while S (I) /= K (J) loop
                if I >= Cont then
                    R := -1;
                    goto Finish;
                end if;
                I := I + 1;
            end loop;
        Ssave := I;
        J := J + 1;
        while J <= Kend loop
            I := I + 1;
            if S (I) /= K (J) then
                I := Ssave + 1;
                J := Ksave;
                goto Top;
            end if;
            J := J + 1;
        end loop;
        R := Ssave - Base + 1;
        <<Finish>>

           return (R);
    end Strsch;

    procedure Benche is
        S, K : String;
        Position : Short_Integer := 0;
        Ns, Nk : Short_Integer;
    begin
        S :=
           "000000000000000000000000000000000000000000000000000000000000HERE" &
              "000000" & "00000000000000000000HERE IS A MATCH000000000000000";
        K :=
           "HERE IS A MATCH                                                 " &
              "      " & "                                                  ";
        Ns := 120;
        Nk := 15;
        Position := Strsch (S, K, Ns, Nk);
        Position_To_Pass := Position;
    end Benche;

begin
    Start ("CHSSA2", "Char. String Search (test)");
    for I in 1 .. Numiterations loop
        Benche;
    end loop;

    Stop;
end Chssa2;