DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

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

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦077cccc33⟧ Ada Source

    Length: 10240 (0x2800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package Dyn, seg_028100

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code





-------- SIMTEL20 Ada Software Repository Prologue ------------
--                                                           -*
-- Unit name    : EXPERT
-- Version      : 1.0
-- Author       : Alan McDonley
--              : Texas Instruments
--              :
--              :
-- DDN Address  : N/A
-- Copyright    : (c)
-- Date created :  11 Sep 85
-- Release date :  3 Dec 85
-- Last update  :  3 Dec 85
-- Machine/System Compiled/Run on : VAX 11/785, VMS 4.1, DEC Ada
--                                                           -*
---------------------------------------------------------------
--                                                           -*
-- Keywords     :  Expert System, Artificial Intelligence
----------------:
--
-- Abstract     :
----------------:
-- EXPERT is a backward chaining or goal driven expert system.  It is
--based on two articles, first Sept 1981 BYTE (Duda and Gaschnig)
--published the expert system in BASIC
--skirting the use of recursion, second Jan/Feb 85 issue of
--JOURNAL OF PASCAL,ADA, & MODULA-2 (Darrell Morgeson)
--published in Modula-2 with recursion
--implemented.  The listing had one logic error which caused pointer
--explosion on the last hypothesis in the GETRULE routine.  This
--implementation follows the MODULA-2 design completely and
--was not designed from the ground up in Ada.  Many improvements would
--be possible if more time permitted my working on this.
--                                                           -*
------------------ Revision history ---------------------------
--                                                           -*
-- DATE         VERSION\x09AUTHOR                  HISTORY
-- 12/3/85      1.0     Alan McDonley           Initial Release
--                                                           -*
------------------ Distribution and Copyright -----------------
--                                                           -*
-- This prologue must be included in all copies of this software.
--
-- This software is released to the Ada community.
-- This software is released to the Public Domain (note:
--   software released to the Public Domain is not subject
--   to copyright protection).
-- Restrictions on use or distribution:  NONE
--                                                           -*
------------------ Disclaimer ---------------------------------
--                                                           -*
-- This software and its documentation are provided "AS IS" and
-- without any expressed or implied warranties whatsoever.
-- No warranties as to performance, merchantability, or fitness
-- for a particular purpose exist.
--
-- Because of the diversity of conditions and hardware under
-- which this software may be used, no warranty of fitness for
-- a particular purpose is offered.  The user is advised to
-- test the software thoroughly before relying on it.  The user
-- must assume the entire risk and liability of using this
-- software.
--
-- In no event shall any person or organization of people be
-- held responsible for any direct, indirect, consequential
-- or inconsequential damages or lost profits.
--                                                           -*
-------------------END-PROLOGUE--------------------------------

with Text_Io;
use Text_Io;
package Dyn is

------------------------------------------------------------------------------
--  This is a package of several string manipulation functions based on     --
-- a built-in dynamic string type DYN_STRING.  It is an adaptation and      --
-- extension of the package proposed by Sylvan Rubin of Ford Aerospace and  --
-- Communications Corporation in the Nov/Dec 1984 issue of the Journal of   --
-- Pascal, Ada and Modula-2.  Some new functions have been added, the       --
-- SUBSTRING function has been modified to permit it to return the right    --
-- part of a string if the third parameter is permitted to default, and     --
-- much of the body code has been rewritten.                                --
------------------------------------------------------------------------------
-- R.G. Cleaveland 07 December 1984:                                        --
--  Implementation initially with the Telesoft Ada version                  --
-- This required definition of the DYN_STRING type without use of a         --
-- discriminant; an arbitrary maximum string length was chosen.  This       --
-- should be changed when an improved compiler is available.                --
------------------------------------------------------------------------------
-- Richard Powers 03 January 1985:                                          --
-- changed to be used with a real compiler.                                 --
-- Some of the routines removed by my whim.                                 --
------------------------------------------------------------------------------
-- Richard Powers 26 January 1985:
-- Added UPPER_CASE function
------------------------------------------------------------------------------
-- Alan McDonley 28 AUG 1985;
-- Added overload for GET_LINE, PUT, OPEN
------------------------------------------------------------------------------

    type Dyn_String is private;

    String_Too_Short : exception;

    function D_String (Char : Character) return Dyn_String;
    -- Creates a one-byte dynamic string of contents CHAR.

    function D_String (Str : String) return Dyn_String;
    -- Creates a dynamic string of contents STR.

    function D_String (Int : in Integer) return Dyn_String;
    -- Creates a dynamic string of contents INT.

-- The following four functions convert from dynamic strings to the
-- desired representation:
    function Char (Dstr : Dyn_String) return Character;
    function Str (Dstr : Dyn_String) return String;
    function Int (Dstr : Dyn_String) return Integer;
    function Flt (Dstr : Dyn_String) return Float;

    function Length (Dstr : Dyn_String) return Natural;
    function "<" (Ds1, Ds2 : Dyn_String) return Boolean;
    function "&" (Ds1, Ds2 : Dyn_String) return Dyn_String;

    function Substring
                (Dstr : Dyn_String;      -- Returns a subpart of this string
                 Start : Natural;      -- starting at this position
                 Length : Natural := 0) -- and of this length.
                return Dyn_String;
    -- if LENGTH is zero or not specified, the remainder of the
    -- string is returned (eg the "RIGHT" function).

    function Index
                (Source_String,              --If this string contains
                 Pattern_String : Dyn_String; --this string starting at or AFTER
                 Start_Pos : Integer)         --this position, the position of
                return Integer;             --such start is returned.
    -- If the string lengths prohibit the search -1 is returned.
    -- If no match was found, 0 is returned.
    -- (This is like the INSTR function of BASIC).

    function Rindex
                (Source_String,             --If this string contains
                 Pattern_String :
                    Dyn_String; --this string starting at or BEFORE
                 Start_Pos : Integer)         --this position, the position of
                return Integer;             --such start is returned.
    -- If the string lengths prohibit the search -1 is returned.
    -- If no match was found, 0 is returned.

    function Upper_Case (Strg : in Dyn.Dyn_String) return String;
    -- Return the input string in upper case


    procedure Get_Line (Filename : in Text_Io.File_Type;
                        Item : out Dyn.Dyn_String;
                        Last : out Natural);

    procedure Get_Line (Item : out Dyn.Dyn_String; Last : out Natural);

    procedure Put (Filename : in Text_Io.File_Type; Item : in Dyn.Dyn_String);

    procedure Put (Item : in Dyn.Dyn_String);

    procedure Open (Filename : in out Text_Io.File_Type;
                    Mode : in Text_Io.File_Mode;
                    Filenm : in Dyn_String);

private

    type String_Contents (Size : Natural := 0) is
        record
            Data : String (1 .. Size);
        end record;

    type Dyn_String is access String_Contents;

end Dyn;

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

E3 Meta Data

    nblk1=9
    nid=0
    hdr6=12
        [0x00] rec0=1d rec1=00 rec2=01 rec3=006
        [0x01] rec0=10 rec1=00 rec2=02 rec3=010
        [0x02] rec0=13 rec1=00 rec2=03 rec3=012
        [0x03] rec0=14 rec1=00 rec2=04 rec3=024
        [0x04] rec0=0c rec1=00 rec2=05 rec3=07e
        [0x05] rec0=19 rec1=00 rec2=06 rec3=062
        [0x06] rec0=14 rec1=00 rec2=07 rec3=056
        [0x07] rec0=17 rec1=00 rec2=08 rec3=078
        [0x08] rec0=15 rec1=00 rec2=09 rec3=000
    tail 0x21722212e83be7c456cc7 0x42a00088462060003