|
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: 9216 (0x2400) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Rule_Instance, seg_03c541, 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⟧
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 False; 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 False; 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 if The_Rules (Left.The_Rule).The_Date > The_Rules (Right.The_Rule).The_Date then return True; elsif The_Rules (Left.The_Rule).The_Date > The_Rules (Right.The_Rule).The_Date then return False; elsif Is_Earlier (Left_Facts, Right_Facts) then return True; elsif Is_Later (Left_Facts, Right_Facts) then return False; elsif Left.Size < Right.Size then return True; elsif Left.Size > Right.Size then return False; elsif The_Rules (Get_Rule (Left)).The_Bundle < The_Rules (Get_Rule (Right)).The_Bundle then return False; elsif The_Rules (Get_Rule (Left)).The_Bundle < The_Rules (Get_Rule (Right)).The_Bundle then return True; else return True; end if; 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=8 nid=3 hdr6=e [0x00] rec0=1f rec1=00 rec2=01 rec3=03c [0x01] rec0=1d rec1=00 rec2=08 rec3=056 [0x02] rec0=1f rec1=00 rec2=05 rec3=046 [0x03] rec0=1b rec1=00 rec2=07 rec3=036 [0x04] rec0=03 rec1=00 rec2=06 rec3=010 [0x05] rec0=25 rec1=00 rec2=02 rec3=024 [0x06] rec0=01 rec1=00 rec2=04 rec3=000 [0x07] rec0=01 rec1=00 rec2=04 rec3=001 tail 0x2173a865285aa7ce3608c 0x42a00088462063c03 Free Block Chain: 0x3: 0000 00 00 00 81 80 23 74 75 72 61 6c 20 3a 3d 20 54 ┆ #tural := T┆