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

⟦e3c991691⟧ TextFile

    Length: 3941 (0xf65)
    Types: TextFile
    Names: »B«

Derivation

└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
    └─ ⟦6f12a12be⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Output_Stream;
with Output_Stream;
with Bbr_Attributes;
with Bbr_Kbs;
with Bbr_Frames;
with Output_Stream;

use Bbr_Kbs;
use Bbr_Attributes;
use Bbr_Frames;
use Output_Stream;
package body Bbr_Painting_Bundle is

    use Kbs;
    use Expression;
    use System_Defined_Expression;

    type Rule_Names is (Paint_The_Green_Robots_In_Blue,  
                        Paint_All_Boxes_In_Green,  
                        No_More);

    -------------------------------------------------------------------------------
    package Paint_The_Green_Robots_In_Blue_Rule is
        function  Premiss return Fact_Base.Queries;
        procedure Action (The_Facts : Fact_Base.Collection);
    end Paint_The_Green_Robots_In_Blue_Rule;

    package body Paint_The_Green_Robots_In_Blue_Rule is
        function Premiss return Fact_Base.Queries is
        begin
            return (1 => (Robots.Exist ((Colour => Is_Equal (Green),  
                                         State  => Is_Any))));
        end Premiss;


        procedure Action (The_Facts : Fact_Base.Collection) is
            The_Robot : Fact_Base.Object renames The_Facts (1);
            use Output_Stream;
        begin
            New_Line (Standard_Output);
            Put_Line ("----- Paint_The_Green_Robots_In_Blue -----",
                      Standard_Output);
            New_Line (Standard_Output);
            Put ("Paint : ", Standard_Output);
            Robots.Put (The_Robot, Standard_Output);
            Robots.Change (The_Robot, Colour, To_Value => Blue);
            New_Line (Standard_Output);
            Put ("Now it is : ", Standard_Output);
            Robots.Put (The_Robot, Standard_Output);
        end Action;
    end Paint_The_Green_Robots_In_Blue_Rule;

    -------------------------------------------------------------------------------

    package Paint_All_Boxes_In_Green_Rule is
        function  Premiss return Fact_Base.Queries;
        procedure Action (The_Facts : Fact_Base.Collection);
    end Paint_All_Boxes_In_Green_Rule;

    package body Paint_All_Boxes_In_Green_Rule is
        function Premiss return Fact_Base.Queries is
        begin
            return (1 => (Boxes.Exist ((Colour       => Is_Different (Green),
                                        State | Size => Is_Any))));
        end Premiss;


        procedure Action (The_Facts : Fact_Base.Collection) is
            The_Box : Fact_Base.Object renames The_Facts (1);
            use Output_Stream;
        begin
            New_Line (Standard_Output);
            Put_Line ("----- Paint_All_Boxes_In_Green -----", Standard_Output);
            New_Line (Standard_Output);
            Put ("Paint : ", Standard_Output);
            Boxes.Put (The_Box, Standard_Output);
            Boxes.Change (The_Box, Colour, To_Value => Green);
            New_Line (Standard_Output);
            Put ("Now it is : ", Standard_Output);
            Boxes.Put (The_Box, Standard_Output);
        end Action;
    end Paint_All_Boxes_In_Green_Rule;

    -------------------------------------------------------------------------------

    package Rule_Bundle is
       new Kbs.Rule_Base.Generic_Rule_Bundle
              (The_Bundle => Bbr_Kbs.Bbr_Painting_Bundle,
               Rule_Names => Rule_Names,
               Nothing    => Rule_Names'(No_More),

               Rule_1     => Paint_The_Green_Robots_In_Blue,
               Premiss_1  => Paint_The_Green_Robots_In_Blue_Rule.Premiss,
               Action_1   => Paint_The_Green_Robots_In_Blue_Rule.Action,

               Rule_2     => Paint_All_Boxes_In_Green,
               Premiss_2  => Paint_All_Boxes_In_Green_Rule.Premiss,
               Action_2   => Paint_All_Boxes_In_Green_Rule.Action);


    procedure Do_Action (For_Rule : Kbs.Rule_Base.Rule_Id;
                         On_Facts : Kbs.Fact_Base.Collection) is
    begin
        Rule_Bundle.Do_Action (For_Rule, On_Facts);
    end Do_Action;

end Bbr_Painting_Bundle;