|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T
Length: 4862 (0x12fe)
Types: TextFile
Names: »TUPLE_ADA«
└─⟦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⟧
separate(expertSystem)
package body tuple is
function cardinality(theTuple : tuple.object) return natural is
begin
return theTuple.count;
end cardinality;
function isNull(theTuple : tuple.object) return boolean is
begin
return theTuple.count = 0;
end isNull;
function isNotNull(theTuple : tuple.object) return boolean is
begin
return theTuple.count /= 0;
end isNotNull;
procedure forAll(theTuple : tuple.object) is
begin
for i in 1..theTuple.count loop
action(get(theTuple,i));
end loop;
end forAll;
function first(theTuple : tuple.object) return expertSystem.reference is
begin
return get(theTuple,1);
end first;
function second(theTuple : tuple.object) return expertSystem.reference is
begin
return get(theTuple,2);
end second;
function third(theTuple : tuple.object) return expertSystem.reference is
begin
return get(theTuple,3);
end third;
function fourth(theTuple : tuple.object) return expertSystem.reference is
begin
return get(theTuple,4);
end fourth;
function fifth(theTuple : tuple.object) return expertSystem.reference is
begin
return get(theTuple,5);
end fifth;
function sixth(theTuple : tuple.object) return expertSystem.reference is
begin
return get(theTuple,6);
end sixth;
function seventh(theTuple : tuple.object) return expertSystem.reference is
begin
return get(theTuple,7);
end seventh;
function eighth(theTuple : tuple.object) return expertSystem.reference is
begin
return get(theTuple,8);
end eighth;
function ninth(theTuple : tuple.object) return expertSystem.reference is
begin
return get(theTuple,9);
end ninth;
function tenth(theTuple : tuple.object) return expertSystem.reference is
begin
return get(theTuple,10);
end tenth;
function get(theTuple : tuple.object;
item : positive := 1) return expertSystem.reference is
begin
if item > theTuple.count then
return nullReference;
else
return theTuple.cells(item);
end if;
end get;
procedure add(theTuple : in out tuple.object;
aRef : expertSystem.reference) is
begin
if theTuple.count = theTuple.size then
declare
bigTuple: tuple.object(theTuple.size + theTuple.size/2);
begin
bigTuple.cells(1..theTuple.size) := theTuple.cells(1..theTuple.size);
bigTuple.count := theTuple.count;
bigTuple.unity := theTuple.unity;
theTuple := bigTuple;
end;
end if;
theTuple.count := theTuple.count + 1;
theTuple.cells(theTuple.count) := aRef;
end add;
procedure merge(theTuple : in out tuple.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(theTuple, r1);
end if;
if r2 /= nullReference then
add(theTuple, r2);
end if;
if r3 /= nullReference then
add(theTuple, r3);
end if;
if r4 /= nullReference then
add(theTuple, r4);
end if;
if r4 /= nullReference then
add(theTuple, r4);
end if;
if r5 /= nullReference then
add(theTuple, r5);
end if;
if r6 /= nullReference then
add(theTuple, r6);
end if;
if r7 /= nullReference then
add(theTuple, r7);
end if;
if r8 /= nullReference then
add(theTuple, r8);
end if;
if r9 /= nullReference then
add(theTuple, r9);
end if;
if r10 /= nullReference then
add(theTuple, r10);
end if;
end merge;
function asObject(aRef : expertSystem.reference) return tuple.object is
result : tuple.object;
begin
add(result,aRef);
return result;
end asobject;
procedure sort(theTuple : in out tuple.object) is
repere: integer range theTuple.cells'FIRST-1..
theTuple.cells'LAST;
nombre: expertSystem.reference;
begin
for i in theTuple.cells'FIRST+1..theTuple.count-1 loop
nombre := theTuple.cells(i);
repere := i - 1;
while (repere /= theTuple.cells'FIRST-1) and then
(nombre < theTuple.cells(repere)) loop
theTuple.cells(repere+1) := theTuple.cells(repere);
repere := repere - 1;
end loop;
theTuple.cells(repere+1) := nombre;
end loop;
end sort;
end tuple;