|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 10240 (0x2800)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Rule_Instance, seg_03c5df, seg_03c6e1, separate Generic_Rule_Base
└─⟦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⟧
separate (Generic_Rule_Base)
package body Rule_Instance is
procedure Swap (The_Facts : in out Fact_Collection; Index : Positive) is
Tmp_Fact : Fact_Name;
begin
Tmp_Fact := The_Facts (Index);
The_Facts (Index) := The_Facts (Index + 1);
The_Facts (Index + 1) := Tmp_Fact;
end Swap;
function Sort (The_Facts : Fact_Collection) return Fact_Collection is
Result : Fact_Collection (1 .. The_Facts'Length) := The_Facts;
use Recency;
begin
for I in Result'First .. (Result'Last - 1) loop
for J in Result'First .. (Result'Last - I) loop
if Get_Date (Result (J)) < Get_Date (Result (J + 1)) then
Swap (Result, J);
end if;
end loop;
end loop;
return Result;
end Sort;
function Is_Earlier (Left, Right : Fact_Collection) return Boolean is
Max_Index : Positive;
Sorted_Left : Fact_Collection (1 .. Left'Length);
Sorted_Right : Fact_Collection (1 .. Right'Length);
use Recency;
begin
if Left'Length > Right'Length then
Max_Index := Right'Length;
else
Max_Index := Left'Length;
end if;
Sorted_Left := Sort (Left);
Sorted_Right := Sort (Right);
for I in 1 .. Max_Index loop
if Get_Date (Sorted_Left (I)) < Get_Date (Sorted_Right (I)) then
return True;
elsif Get_Date (Sorted_Left (I)) > Get_Date (Sorted_Right (I)) then
return False;
else
null;
end if;
end loop;
return Left'Length < Right'Length;
end Is_Earlier;
function Is_Later (Left, Right : Fact_Collection) return Boolean is
Max_Index : Positive;
Sorted_Left : Fact_Collection (1 .. Left'Length);
Sorted_Right : Fact_Collection (1 .. Right'Length);
use Recency;
begin
if Left'Length > Right'Length then
Max_Index := Right'Length;
else
Max_Index := Left'Length;
end if;
Sorted_Left := Sort (Left);
Sorted_Right := Sort (Right);
for I in 1 .. Max_Index loop
if Get_Date (Sorted_Left (I)) < Get_Date (Sorted_Right (I)) then
return False;
elsif Get_Date (Sorted_Left (I)) > Get_Date (Sorted_Right (I)) then
return True;
else
null;
end if;
end loop;
return Left'Length > Right'Length;
end Is_Later;
function "<" (Left, Right : Object) return Boolean is
Left_Facts : constant Fact_Collection := Get_Facts (Left);
Right_Facts : constant Fact_Collection := Get_Facts (Right);
use Recency;
begin
return Is_Earlier (Left_Facts, Right_Facts)
or else
(not Is_Later (Left_Facts, Right_Facts) and then
((The_Rules (Left.The_Rule).The_Date >
The_Rules (Right.The_Rule).The_Date)
or else
((The_Rules (Left.The_Rule).The_Date =
The_Rules (Right.The_Rule).The_Date) and then
(Left.Size < Right.Size))));
end "<";
function Make (The_Rule_Id : Rule_Id; The_Fact_Collection : Fact_Collection)
return Object is
The_Size : Natural := The_Fact_Collection'Last -
The_Fact_Collection'First + 1;
begin
return (Premiss_Size (The_Size), Rule_Id (The_Rule_Id),
Fact_Collection (The_Fact_Collection));
end Make;
function Get_Rule (From : Object) return Rule_Id is
begin
return From.The_Rule;
end Get_Rule;
function Get_Facts (From : Object) return Fact_Collection is
begin
return From.The_Facts;
end Get_Facts;
procedure Put (The_Instance : Object; Where : Output_Stream.Object) is
use Output_Stream;
begin
Put_Line ("Rule_instance'(", Where);
Indent_Right (Where);
Put ("The_Rule =>", Where);
Put (The_Instance.The_Rule, Where);
Put_Line (',', Where);
Put_Line ("The_facts =>", Where);
Indent_Right (Where);
Fact_Put (The_Instance.The_Facts (1 .. The_Instance.Size), Where);
Indent_Left (Where);
Indent_Left (Where);
Put_Line (")", Where);
end Put;
end Rule_Instance;
nblk1=9
nid=6
hdr6=a
[0x00] rec0=1f rec1=00 rec2=01 rec3=03c
[0x01] rec0=1d rec1=00 rec2=09 rec3=02c
[0x02] rec0=1e rec1=00 rec2=05 rec3=056
[0x03] rec0=16 rec1=00 rec2=07 rec3=018
[0x04] rec0=26 rec1=00 rec2=03 rec3=000
[0x05] rec0=21 rec1=00 rec2=07 rec3=018
[0x06] rec0=26 rec1=00 rec2=03 rec3=000
[0x07] rec0=26 rec1=00 rec2=03 rec3=001
[0x08] rec0=a5 rec1=26 rec2=00 rec3=001
tail 0x2173adbf085bf48863f8d 0x42a00088462063c03
Free Block Chain:
0x6: 0000 00 08 03 fc 80 04 20 20 2d 2d 04 00 06 20 20 20 ┆ -- ┆
0x8: 0000 00 04 03 fc 80 1c 73 20 28 4c 65 66 74 2e 54 68 ┆ s (Left.Th┆
0x4: 0000 00 02 03 fc 80 2b 20 20 20 54 68 65 5f 52 75 6c ┆ + The_Rul┆
0x2: 0000 00 00 00 2a 80 19 4c 65 66 74 2e 54 68 65 5f 52 ┆ * Left.The_R┆