1% BEGIN LICENSE BLOCK 2% Version: CMPL 1.1 3% 4% The contents of this file are subject to the Cisco-style Mozilla Public 5% License Version 1.1 (the "License"); you may not use this file except 6% in compliance with the License. You may obtain a copy of the License 7% at www.eclipse-clp.org/license. 8% 9% Software distributed under the License is distributed on an "AS IS" 10% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 11% the License for the specific language governing rights and limitations 12% under the License. 13% 14% The Original Code is The ECLiPSe Constraint Logic Programming System. 15% The Initial Developer of the Original Code is Cisco Systems, Inc. 16% Portions created by the Initial Developer are 17% Copyright (C) 2006 Cisco Systems, Inc. All Rights Reserved. 18% 19% Contributor(s): 20% 21% END LICENSE BLOCK 22 23% File : intro-sec.tex 24% Date : March 1992 25% Author : Michael Dahmen 26% Modified by : Luis Hermosilla, August 1992 27% Project : ECLiPSe User Manual 28% Content : Introduction to MegaLog-Sepia 29 30\chapter{Introduction} 31 32\eclipse provides a powerful programming environment for building 33next generation Data\-base \& Knowledge Base Management Systems. 34\eclipse integrates a knowledge base with a logic programming 35language to provide large scale persistent storage of knowledge in such a 36way that it can be efficiently accessed and processed by logic programs. 37 38\eclipse integrates all the functionality of the MegaLog system 39(\cite{BOC90}, \cite{BDH90}) and the Sepia system 40(\cite{SP91}) in a single system. 41This manual is restricted to the database and knowledge base aspects of 42\eclipse -- 43i.e.\ the MegaLog part. A description of the Prolog functionality 44-- i.e. the Sepia part -- is found in \cite{SP91}. 45 46This manual is directed at users with some experience of Prolog and 47relational databases, so in areas where \eclipse is similar to conventional 48systems the explanations are kept brief. 49 50\section{Features of \eclipse} 51 52\begin{itemize} 53\item Efficient retrieval of knowledge for any size of 54 knowledge base. 55\item Deductive rules can be stored in the 56 database. 57\item Complex structures and lists are valid data types 58 for the database. 59\item Database transparency. When making a query the user 60 does not have to specify whether the data is stored in 61 main memory or in the database. 62\item The database can be queried with either set-oriented 63 or single-tuple operations. Backtracking can be used 64 to navigate through the database and extract all 65 solutions to a goal. 66\item A full multi-user environment is provided (e.g.\ 67 concurrent access and transactions). 68\item Full database recovery procedures are included. 69\item Full garbage collection. 70\end{itemize} 71 72\newpage 73 74\section{Modules for Persistent \eclipse} 75 76The database and knowledge base systems are implemented as several \eclipse 77modules, which are 78listed below. The separation into several modules allows the user 79of \eclipse to view the system as either a pure 80Prolog, a Prolog augmented with different database functionalities or as a 81pure MegaLog. 82All predicates exported by these modules are listed in 83chapter \ref{bip-summary} and fully described in the 84Knowledge Base Built-In Specification Manual (or Knowledge Base BIP Book), 85\cite{BIP92}. 86 87\begin{itemize} 88 89\item{database\_kernel} 90 91This module is the lowest implementation level of the database and knowledge 92base. It provides a direct access to the database without going through 93processing steps of higher levels. Most of this interface is for more 94advanced users, e.g.\ as target language for a deductive database system 95(for example EKS-V1 \cite{EKS91}). 96 97\item{db} 98 99This module provides a relational algebra language embedded into 100Prolog. A tutorial style description of the relational algebra 101is given in chapter \ref{database-sec}. 102 103\item{kb} 104 105This module provides deductive relations i.e. relations that contain 106Prolog clauses as tuples. A tutorial style description of the 107deductive relations is given in chapter \ref{knowbase-sec}. 108 109\item{knowledge\_base} 110 111This module contains the user's knowledge base itself. For further details 112see chapter \ref{knowbase-sec}. 113 114\item{megalog} 115 116This is a library module that provides backwards compatibility to the 117MegaLog system 118that worked independently of {\eclipse}. It is useful for those users who 119intend to migrate their existing MegaLog programs to \eclipse. 120New developments should not use this module. 121 122\end{itemize} 123 124The modules {\bf database\_kernel}, {\bf db} and {\bf kb} 125are present in the system by default. 126However, as long as none of these modules is explicitly loaded, they 127will not come into existence. 128All modules that want to use database functionalities should load one of 129the above modules. This is achieved by adding one of the following lines 130to the source code of those modules: 131 132\begin{verbatim} 133:- import database_kernel. 134 135:- lib( db). 136 137:- lib( kb). 138\end{verbatim} 139 140Note that the operators 141are defined locally in the modules where {\tt lib/1} has been called. 142 143The module {\bf megalog} is loaded with {\tt lib(megalog)}. 144Most existing MegaLog applications can then run unchanged in this 145module. This is achieved by 146 147\begin{verbatim} 148 149[sepia]: lib(megalog). 150[sepia]: module(megalog). 151[megalog]: compile(application). 152 153\end{verbatim} 154 155The module {\bf megalog} provides an environment where most differences 156between \eclipse and the Prolog part of MegaLog are hidden. 157The remaining differences are discussed in chapter \ref{backwards-compat}. 158 159Applications that are newly developed in \eclipse should not 160use the MegaLog compatibility module. Such new developments 161may themselves be broken up into several modules. 162