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: ┃ T V

⟦19f983dec⟧ TextFile

    Length: 7009 (0x1b61)
    Types: TextFile
    Names: »V«

Derivation

└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13
    └─ ⟦124ff5788⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Generic_Expression;
with Generic_Fact_Base;
with Generic_Rule_Base;

generic

    Max_Frame_Count                : Positive := 200;
    Max_Slots                      : Positive := 20;
    Max_Condition_Elements_By_Rule : Positive := 10;  
    Max_Condition_Elements         : Positive := 200;
    Max_Rules                      : Positive := 50;
    Max_Expression_Count           : Positive := 200;

    type User_Defined_Operators is (<>);
    with function User_Defined_Match (Using_Operator : User_Defined_Operators;
                                      Value : Integer;
                                      Against : Integer) return Boolean is <>;
    with function User_Defined_Evaluate
                     (Using_Operator : User_Defined_Operators;
                      Left, Right    : Integer) return Integer is <>;
    type Rule_Bundles is (<>);

package Generic_Kbs is

    package System_Defined_Operators is

        type Operators is (
                           -- predicates

                           Is_Equal_Op,  
                           Is_Less_Op,  
                           Is_Less_Or_Equal_Op,  
                           Is_Greater_Op,  
                           Is_Greater_Or_Equal_Op,  
                           Is_Different_Op,  
                           Is_Any_Op,

                           -- arithmetic expressions

                           '+',  
                           '-',  
                           '*',  
                           '/',  
                           Abs_Op);

        function Match (Using_Operator : Operators;
                        Value          : Integer;
                        Against        : Integer) return Boolean;

        function Evaluate (Using_Operator : Operators; Left, Right : Integer)
                          return Integer;

        Illegal_Operation : exception;

    end System_Defined_Operators;


    package Expression is  
       new Generic_Expression
              (Max_Expression_Count     => Max_Expression_Count,
               System_Defined_Operators => System_Defined_Operators.Operators,
               System_Defined_Match     => System_Defined_Operators.Match,
               System_Defined_Evaluate  => System_Defined_Operators.Evaluate,
               User_Defined_Operators   => User_Defined_Operators,
               User_Defined_Match       => User_Defined_Match,
               User_Defined_Evaluate    => User_Defined_Evaluate);

    package Fact_Base is  
       new Generic_Fact_Base (Max_Frame_Count   => Max_Frame_Count,
                              Max_Slots         => Max_Slots,
                              Expression_Object => Expression.Object,
                              Null_Expression   => Expression.Null_Expression,
                              Expression_Match  => Expression.Match,
                              Expression_Put    => Expression.Put);

    package Rule_Base is
       new  
           Generic_Rule_Base
              (Max_Rules                      => Max_Rules,
               Max_Condition_Elements_By_Rule => Max_Condition_Elements_By_Rule,
               Max_Condition_Elements         => Max_Condition_Elements,
               Rule_Bundles                   => Rule_Bundles,
               Fact_Name                      => Fact_Base.Object,
               Fact_Collection                => Fact_Base.Collection,
               Empty_Fact_Collection          => Fact_Base.Empty_Collection,
               Fact_Put                       => Fact_Base.Put,
               Fact_Query                     => Fact_Base.Query,
               Null_Fact_Query                => Fact_Base.Null_Query,
               Fact_Queries                   => Fact_Base.Queries,
               Null_Premiss                   => Fact_Base.Null_Premiss,
               Retrieve                       => Fact_Base.Retrieve,
               Queries_Put                    => Fact_Base.Put);

    package System_Defined_Expression is

        function Is_Equal is  
           new Expression.Binary_System_Predicate
                  (Operator => System_Defined_Operators.Is_Equal_Op);

        function Is_Less is  
           new Expression.Binary_System_Predicate
                  (Operator => System_Defined_Operators.Is_Less_Op);

        function Is_Less_Or_Equal is
           new Expression.Binary_System_Predicate
                  (Operator => System_Defined_Operators.Is_Less_Or_Equal_Op);

        function Is_Greater is
           new Expression.Binary_System_Predicate
                  (Operator => System_Defined_Operators.Is_Greater_Op);

        function Is_Greater_Or_Equal is
           new Expression.Binary_System_Predicate
                  (Operator => System_Defined_Operators.Is_Greater_Or_Equal_Op);

        function Is_Different is
           new Expression.Binary_System_Predicate
                  (Operator => System_Defined_Operators.Is_Different_Op);

        function Is_Any is
           new Expression.Unary_System_Predicate
                  (Operator => System_Defined_Operators.Is_Any_Op);

        -- value predicate shortcuts

        function Is_Equal            (Value : Integer) return Expression.Object;
        function Is_Less             (Value : Integer) return Expression.Object;
        function Is_Less_Or_Equal    (Value : Integer) return Expression.Object;
        function Is_Greater          (Value : Integer) return Expression.Object;
        function Is_Greater_Or_Equal (Value : Integer) return Expression.Object;
        function Is_Different        (Value : Integer) return Expression.Object;

        -- alias predicate shortcuts

        function Is_Equal (Value : Expression.Alias) return Expression.Object;
        function Is_Less (Value : Expression.Alias) return Expression.Object;
        function Is_Less_Or_Equal
                    (Value : Expression.Alias) return Expression.Object;
        function Is_Greater (Value : Expression.Alias) return Expression.Object;
        function Is_Greater_Or_Equal
                    (Value : Expression.Alias) return Expression.Object;
        function Is_Different (Value : Expression.Alias)
                              return Expression.Object;

        -- arithmetic expressions

        function "+" is new Expression.Binary_System_Expression
                               (Operator => System_Defined_Operators.'+');

        function "-" is new Expression.Binary_System_Expression
                               (Operator => System_Defined_Operators.'-');

        function "*" is new Expression.Binary_System_Expression
                               (Operator => System_Defined_Operators.'*');

        function "/" is new Expression.Binary_System_Expression
                               (Operator => System_Defined_Operators.'/');

        function "abs" is new Expression.Unary_System_Expression
                                 (Operator => System_Defined_Operators.Abs_Op);


    end System_Defined_Expression;



end Generic_Kbs;