|
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 - download
Length: 33792 (0x8400) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, generic, package body Engine_Lex_Mea, seg_01173e, seg_0117a7
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─ ⟦5a81ac88f⟧ »Space Info Vol 1« └─⟦this⟧
with Class; with Context; with Date; with Debugger; with Instance; with Tuple; with Tuple_Collection; with Unbounded_Array; package body Engine_Lex_Mea is package Utc is new Unbounded_Array (Element => Tuple.Object, Content => Tuple_Collection.Object); Current_Rule : Context.Rule_Id := 0; Current_Tuple : Tuple.Object; Current_Tuple_Sort : Tuple.Object; A_Tuple : Tuple.Object; The_Tuple : Tuple.Object; Local_Context : Context.Reference; ------------------------------------------------------------------------------ function "<" (Left, Right : Instance.Reference) return Boolean is Date_Left, Date_Right : Date.Reference; begin Date_Left := Class.Get (In_Class => Instance.Isa (Left), The_Instance => Instance.Value (Left)); Date_Right := Class.Get (In_Class => Instance.Isa (Right), The_Instance => Instance.Value (Right)); return Date_Left < Date_Right; end "<"; procedure Sortdate is new Tuple.Sort ("<"); ------------------------------------------------------------------------------ function Evaluate_Tuple_Collection (For_Rule : Context.Rule_Id) return Tuple_Collection.Object is An_Object : Utc.Object; begin if not Context.Is_Masked (In_Context => Local_Context, The_Rule => For_Rule) then case For_Rule is when 1 => An_Object := Utc.Create (Condition_1); when 2 => An_Object := Utc.Create (Condition_2); when 3 => An_Object := Utc.Create (Condition_3); when 4 => An_Object := Utc.Create (Condition_4); when 5 => An_Object := Utc.Create (Condition_5); when 6 => An_Object := Utc.Create (Condition_6); when 7 => An_Object := Utc.Create (Condition_7); when 8 => An_Object := Utc.Create (Condition_8); when 9 => An_Object := Utc.Create (Condition_9); when 10 => An_Object := Utc.Create (Condition_10); when 11 => An_Object := Utc.Create (Condition_11); when 12 => An_Object := Utc.Create (Condition_12); when 13 => An_Object := Utc.Create (Condition_13); when 14 => An_Object := Utc.Create (Condition_14); when 15 => An_Object := Utc.Create (Condition_15); when 16 => An_Object := Utc.Create (Condition_16); when 17 => An_Object := Utc.Create (Condition_17); when 18 => An_Object := Utc.Create (Condition_18); when 19 => An_Object := Utc.Create (Condition_19); when 20 => An_Object := Utc.Create (Condition_20); when 21 => An_Object := Utc.Create (Condition_21); when 22 => An_Object := Utc.Create (Condition_22); when 23 => An_Object := Utc.Create (Condition_23); when 24 => An_Object := Utc.Create (Condition_24); when 25 => An_Object := Utc.Create (Condition_25); when 26 => An_Object := Utc.Create (Condition_26); when 27 => An_Object := Utc.Create (Condition_27); when 28 => An_Object := Utc.Create (Condition_28); when 29 => An_Object := Utc.Create (Condition_29); when 30 => An_Object := Utc.Create (Condition_30); when others => null; end case; end if; declare A_Tuple_Collection : constant Tuple_Collection.Object := Utc.Get (An_Object); begin if Debugger_On then if For_Rule /= Context.Null_Rule and then Debugger.Is_Debugged (Debugger.Condition_Evalued) then Debugger.Send_Condition_Evalued (In_Context => Local_Context, With_Rule => For_Rule, Result => Tuple_Collection.Is_Not_Null (A_Tuple_Collection), Facts => A_Tuple_Collection); end if; end if; Utc.Free (An_Object); return A_Tuple_Collection; end; end Evaluate_Tuple_Collection; ------------------------------------------------------------------------------ procedure Execute_Tuple (For_Tuple : Tuple.Object; For_Rule : Context.Rule_Id) is begin case For_Rule is when 1 => Action_1 (For_Tuple); when 2 => Action_2 (For_Tuple); when 3 => Action_3 (For_Tuple); when 4 => Action_4 (For_Tuple); when 5 => Action_5 (For_Tuple); when 6 => Action_6 (For_Tuple); when 7 => Action_7 (For_Tuple); when 8 => Action_8 (For_Tuple); when 9 => Action_9 (For_Tuple); when 10 => Action_10 (For_Tuple); when 11 => Action_11 (For_Tuple); when 12 => Action_12 (For_Tuple); when 13 => Action_13 (For_Tuple); when 14 => Action_14 (For_Tuple); when 15 => Action_15 (For_Tuple); when 16 => Action_16 (For_Tuple); when 17 => Action_17 (For_Tuple); when 18 => Action_18 (For_Tuple); when 19 => Action_19 (For_Tuple); when 20 => Action_20 (For_Tuple); when 21 => Action_21 (For_Tuple); when 22 => Action_22 (For_Tuple); when 23 => Action_23 (For_Tuple); when 24 => Action_24 (For_Tuple); when 25 => Action_25 (For_Tuple); when 26 => Action_26 (For_Tuple); when 27 => Action_27 (For_Tuple); when 28 => Action_28 (For_Tuple); when 29 => Action_29 (For_Tuple); when 30 => Action_30 (For_Tuple); when others => null; end case; if Debugger_On then if For_Rule /= Context.Null_Rule and then (Debugger.Is_Debugged (Debugger.Choosed_Action) or Debugger.Is_Debugged (Debugger.Action_Fact)) then Debugger.Send_Choosed_Action (In_Context => Local_Context, The_Rule => For_Rule, The_Fact => For_Tuple); end if; Debugger.Send_New_Step; if For_Rule = Context.Null_Rule then Debugger.Send_Failed; end if; end if; end Execute_Tuple; ------------------------------------------------------------------------------ function Lex_Or_Mea_Infer return Boolean is First_Tuple : Boolean := True; Date_1, Date_2 : Date.Reference; A_Reference_1, A_Reference_2 : Instance.Reference; begin Current_Rule := 0; for I in 1 .. Used_Rules loop for J in 1 .. Tuple_Collection.Cardinality (Evaluate_Tuple_Collection (Context.Rule_Id (I))) loop A_Tuple := Tuple_Collection.Get (Evaluate_Tuple_Collection (Context.Rule_Id (I)), J); if First_Tuple then Current_Tuple := A_Tuple; Sortdate (A_Tuple); Current_Tuple_Sort := A_Tuple; Current_Rule := Context.Rule_Id (I); First_Tuple := False; else Tuple.Split (A_Tuple, A_Reference_1); Tuple.Split (Current_Tuple, A_Reference_2); Date_1 := Class.Get (Instance.Isa (A_Reference_1), Instance.Value (A_Reference_1)); Date_2 := Class.Get (Instance.Isa (A_Reference_2), Instance.Value (A_Reference_2)); if Context."=" (Resolution, Context.Mea) and Date_1 > Date_2 then Current_Rule := Context.Rule_Id (I); Current_Tuple := A_Tuple; else The_Tuple := A_Tuple; Sortdate (A_Tuple); for K in 1 .. Tuple.Cardinality (A_Tuple) loop Date_1 := Class.Get (Instance.Isa (Tuple.Get (A_Tuple, K)), Instance.Value (Tuple.Get (A_Tuple, K))); Date_2 := Class.Get (Instance.Isa (Tuple.Get (Current_Tuple_Sort, K)), Instance.Value (Tuple.Get (Current_Tuple_Sort, K))); if Date_1 > Date_2 then Current_Rule := Context.Rule_Id (I); Current_Tuple := The_Tuple; Current_Tuple_Sort := A_Tuple; exit; elsif Date_1 < Date_2 then exit; end if; if K = Tuple.Cardinality (Current_Tuple) then exit; end if; end loop; end if; end if; end loop; end loop; Execute_Tuple (For_Tuple => Current_Tuple, For_Rule => Current_Rule); return Current_Rule /= Context.Null_Rule; end Lex_Or_Mea_Infer; ------------------------------------------------------------------------------ function Lex_Or_Mea_Infer_Debug return Boolean is First_Tuple : Boolean := True; Date_1, Date_2 : Date.Reference; A_Reference_1, A_Reference_2 : Instance.Reference; begin Debugger.Send_Conflict_Set_Started; Current_Rule := 0; for I in 1 .. Used_Rules loop for J in 1 .. Tuple_Collection.Cardinality (Evaluate_Tuple_Collection (Context.Rule_Id (I))) loop A_Tuple := Tuple_Collection.Get (Evaluate_Tuple_Collection (Context.Rule_Id (I)), J); if First_Tuple then Current_Tuple := A_Tuple; Sortdate (A_Tuple); Current_Tuple_Sort := A_Tuple; Current_Rule := Context.Rule_Id (I); First_Tuple := False; else Tuple.Split (A_Tuple, A_Reference_1); Tuple.Split (Current_Tuple, A_Reference_2); Date_1 := Class.Get (Instance.Isa (A_Reference_1), Instance.Value (A_Reference_1)); Date_2 := Class.Get (Instance.Isa (A_Reference_2), Instance.Value (A_Reference_2)); if Context."=" (Resolution, Context.Mea) and Date_1 > Date_2 then Current_Rule := Context.Rule_Id (I); Current_Tuple := A_Tuple; else The_Tuple := A_Tuple; Sortdate (A_Tuple); for K in 1 .. Tuple.Cardinality (A_Tuple) loop Date_1 := Class.Get (Instance.Isa (Tuple.Get (A_Tuple, K)), Instance.Value (Tuple.Get (A_Tuple, K))); Date_2 := Class.Get (Instance.Isa (Tuple.Get (Current_Tuple_Sort, K)), Instance.Value (Tuple.Get (Current_Tuple_Sort, K))); if Date_1 > Date_2 then Current_Rule := Context.Rule_Id (I); Current_Tuple := The_Tuple; Current_Tuple_Sort := A_Tuple; exit; elsif Date_1 < Date_2 then exit; end if; if K = Tuple.Cardinality (Current_Tuple) then exit; end if; end loop; end if; end if; end loop; end loop; Debugger.Send_Conflict_Set_Finished; if Debugger.Is_Debugged (Debugger.Choosed_Rule) or Debugger.Is_Debugged (Debugger.Rule_Facts) then Debugger.Send_Choosed_Rule (In_Context => Local_Context, The_Rule => Current_Rule, The_Fact => Current_Tuple); end if; Execute_Tuple (For_Tuple => Current_Tuple, For_Rule => Current_Rule); Debugger.Send_New_Step; return Current_Rule /= Context.Null_Rule; end Lex_Or_Mea_Infer_Debug; ------------------------------------------------------------------------------ generic with function Inferstrategy return Boolean; Strategynam : String := " ??? "; function Stepnumber (Step : Natural) return Boolean; function Stepnumber (Step : Natural) return Boolean is A_Step : Boolean; begin if Debugger_On then Debugger.Send_Strategy_Used (With_Name => Resolution); end if; if Step = Instance.Any then loop A_Step := Inferstrategy; exit when not A_Step; end loop; else for I in 1 .. Step loop A_Step := Inferstrategy; exit when not A_Step; end loop; end if; return A_Step; end Stepnumber; function Lex_Or_Mea_Strategy is new Stepnumber (Lex_Or_Mea_Infer, "///"); function Lex_Or_Mea_Strategy_Debug is new Stepnumber (Lex_Or_Mea_Infer_Debug, "///"); function Inference (Step : Natural := 1) return Boolean is begin if Context."=" (Resolution, Context.Lex) or Context."=" (Resolution, Context.Mea) then if Debugger_On then Debugger.Send_Context_Entered (Local_Context); return Lex_Or_Mea_Strategy_Debug (Step); else return Lex_Or_Mea_Strategy (Step); end if; else raise Illegal_Strategy; end if; end Inference; begin Local_Context := Context.Create (With_Name => Context_Name); Context.Add (In_Context => Local_Context, The_Rule => 1, With_Name => Name_1); Context.Add (In_Context => Local_Context, The_Rule => 2, With_Name => Name_2); Context.Add (In_Context => Local_Context, The_Rule => 3, With_Name => Name_3); Context.Add (In_Context => Local_Context, The_Rule => 4, With_Name => Name_4); Context.Add (In_Context => Local_Context, The_Rule => 5, With_Name => Name_5); Context.Add (In_Context => Local_Context, The_Rule => 6, With_Name => Name_6); Context.Add (In_Context => Local_Context, The_Rule => 7, With_Name => Name_7); Context.Add (In_Context => Local_Context, The_Rule => 8, With_Name => Name_8); Context.Add (In_Context => Local_Context, The_Rule => 9, With_Name => Name_9); Context.Add (In_Context => Local_Context, The_Rule => 10, With_Name => Name_10); Context.Add (In_Context => Local_Context, The_Rule => 11, With_Name => Name_11); Context.Add (In_Context => Local_Context, The_Rule => 12, With_Name => Name_12); Context.Add (In_Context => Local_Context, The_Rule => 13, With_Name => Name_13); Context.Add (In_Context => Local_Context, The_Rule => 14, With_Name => Name_14); Context.Add (In_Context => Local_Context, The_Rule => 15, With_Name => Name_15); Context.Add (In_Context => Local_Context, The_Rule => 16, With_Name => Name_16); Context.Add (In_Context => Local_Context, The_Rule => 17, With_Name => Name_17); Context.Add (In_Context => Local_Context, The_Rule => 18, With_Name => Name_18); Context.Add (In_Context => Local_Context, The_Rule => 19, With_Name => Name_19); Context.Add (In_Context => Local_Context, The_Rule => 20, With_Name => Name_20); Context.Add (In_Context => Local_Context, The_Rule => 21, With_Name => Name_21); Context.Add (In_Context => Local_Context, The_Rule => 22, With_Name => Name_22); Context.Add (In_Context => Local_Context, The_Rule => 23, With_Name => Name_23); Context.Add (In_Context => Local_Context, The_Rule => 24, With_Name => Name_24); Context.Add (In_Context => Local_Context, The_Rule => 25, With_Name => Name_25); Context.Add (In_Context => Local_Context, The_Rule => 26, With_Name => Name_26); Context.Add (In_Context => Local_Context, The_Rule => 27, With_Name => Name_27); Context.Add (In_Context => Local_Context, The_Rule => 28, With_Name => Name_28); Context.Add (In_Context => Local_Context, The_Rule => 29, With_Name => Name_29); Context.Add (In_Context => Local_Context, The_Rule => 30, With_Name => Name_30); if Debugger_On then Debugger.Reset_Debug (Mode => Debugger.Text); Debugger.Set_Debug_On (Item => Debugger.Context_Entered); Debugger.Send_Context_Entered (With_Number => Local_Context); end if; end Engine_Lex_Mea;
nblk1=20 nid=15 hdr6=32 [0x00] rec0=21 rec1=00 rec2=01 rec3=066 [0x01] rec0=1a rec1=00 rec2=17 rec3=00e [0x02] rec0=04 rec1=00 rec2=08 rec3=020 [0x03] rec0=16 rec1=00 rec2=0f rec3=04a [0x04] rec0=16 rec1=00 rec2=1a rec3=06a [0x05] rec0=19 rec1=00 rec2=19 rec3=00e [0x06] rec0=1f rec1=00 rec2=06 rec3=002 [0x07] rec0=1e rec1=00 rec2=0d rec3=038 [0x08] rec0=1a rec1=00 rec2=0e rec3=080 [0x09] rec0=0d rec1=00 rec2=14 rec3=082 [0x0a] rec0=13 rec1=00 rec2=02 rec3=004 [0x0b] rec0=10 rec1=00 rec2=0a rec3=040 [0x0c] rec0=18 rec1=00 rec2=05 rec3=034 [0x0d] rec0=14 rec1=00 rec2=13 rec3=008 [0x0e] rec0=02 rec1=00 rec2=12 rec3=006 [0x0f] rec0=11 rec1=00 rec2=1f rec3=06a [0x10] rec0=15 rec1=00 rec2=11 rec3=02c [0x11] rec0=1c rec1=00 rec2=10 rec3=022 [0x12] rec0=23 rec1=00 rec2=0c rec3=014 [0x13] rec0=00 rec1=00 rec2=1b rec3=01a [0x14] rec0=18 rec1=00 rec2=1c rec3=040 [0x15] rec0=18 rec1=00 rec2=07 rec3=036 [0x16] rec0=18 rec1=00 rec2=09 rec3=028 [0x17] rec0=1b rec1=00 rec2=18 rec3=000 [0x18] rec0=01 rec1=00 rec2=03 rec3=000 [0x19] rec0=1d rec1=00 rec2=0a rec3=072 [0x1a] rec0=1a rec1=00 rec2=1c rec3=03e [0x1b] rec0=07 rec1=00 rec2=04 rec3=000 [0x1c] rec0=20 rec1=00 rec2=0b rec3=028 [0x1d] rec0=12 rec1=00 rec2=07 rec3=000 [0x1e] rec0=00 rec1=00 rec2=00 rec3=02b [0x1f] rec0=f3 rec1=c0 rec2=00 rec3=000 tail 0x2170d81ea823983556e14 0x42a00088462063c03 Free Block Chain: 0x15: 0000 00 16 03 fc 80 18 65 5f 43 6f 6c 6c 65 63 74 69 ┆ e_Collecti┆ 0x16: 0000 00 04 03 fc 80 07 65 6e 20 35 20 3d 3e 07 00 31 ┆ en 5 => 1┆ 0x4: 0000 00 0b 00 0f 80 06 4d 6f 64 65 6c 3b 06 00 00 00 ┆ Model; ┆ 0xb: 0000 00 1d 00 43 80 1f 32 37 2c 20 4e 61 6d 65 5f 32 ┆ C 27, Name_2┆ 0x1d: 0000 00 1e 00 0c 80 09 54 75 70 6c 65 2e 46 69 72 09 ┆ Tuple.Fir ┆ 0x1e: 0000 00 20 00 51 80 04 29 20 6f 72 04 00 47 20 20 20 ┆ Q ) or G ┆ 0x20: 0000 00 00 00 13 80 10 20 20 20 20 54 68 65 5f 52 75 ┆ The_Ru┆