CONSTRUCTION OF SPECIALIZED COMPUTER AIDED SOFTWARE ENGINEERING (CASE) TOOLS FOR THE DEVELOPMENT OF EXPERT SYSTEMS

This report presents an approach to building specialized computer-aided software engineering (CASE) tools for the development of expert systems. These tools form an integrated development environment allowing the computer aided development of different applications in the appropriate field. The integrated environment which we consider in our report represents the combination of SWI-PROLOG and Data Base Management System (DBMS) PostgreSQL tools. SWI-PROLOG provides the most appropriate tools for the solution of logical tasks in expert systems. However, SWI-PROLOG cannot manage large amounts of data. Therefore, we need to apply an appropriate data base management system to extend the capability of the knowledge base. For this purpose we used the most advanced open source PostgreSQL tools. As a result of our research we have created tools enabling the compatibility of SWI-PROLOG and DBMS PostgreSQL within the integrated development environment.


INTRODUCTION
Intelligent information systems and technologies are ones of the most promising and rapidly developing fields in theoretical and applied information technologies. It has had a significant impact on all areas of research and technology related to the use of computers, and it already today gives society what is expected from science -practically meaningful results, many of which contribute to cardinal changes in their applications (Vladimir, 2009). Expert systems (ES) occupied a special place in the development and use of intelligent information systems.
Various types of software tools can be used to create ES, among which SWI-PROLOG seems to be the most appropriate. However, SWI-PROLOG cannot manage large amounts of data. Therefore, we need to include an appropriate data base management system to boost the potential of the knowledge base.
For this purpose we used the most advanced open source PostgreSQL tools. As a result of our research we have created tools enabling the compatibility of SWI-PROLOG and DBMS PostgreSQL within the integrated development environment.

METHODS
The report describes the tools and methods which were used to create an integrated development environment.
The integrated development environment includes: • SWI-PROLOG.
• XPCE for the graphics component.
• ODBC Driver PostgreSQL DBMS. SWI-PROLOG is an open release of Prolog. Being formed from the initial data in the form of a chain of reasoning (decision rules) from the knowledge base ES can decide in unique situations for which the algorithm is not known in advance. What is more, problem solution is expected to be carried out in conditions where the initial information is incomplete, unreliable, and ambiguous, during qualitative process assessment (Yuriy, 2004). PROLOG tools appear to be the most appropriate to the solution of the above mentioned problems.
To develop graphics applications, the SWI-PROLOG distribution package includes tools that enable the development of a graphical user interface. These tools for SWI-PROLOG are provided by XPCE.
XPCE is a platform-independent tool for SWI-PROLOG, Lisp and other interactive dynamically typed programming languages.
T is a toolkit for developing graphical applications in Prolog and other interactive and dynamically typed languages. XPCE follows a rather unique approach of for developing GUI applications, which we will try to summarise using the points below.

ADD OBJECT LAYER TO PROLOG
XPCE's kernel is an object-oriented engine that allows for the definition of methods in multiple languages.
The built-in graphics are defined in C for speed as well as to define the platform-independence layer.
Applications, as well as some application-oriented libraries are defined as XPCE-classes with their methods defined in Prolog.
Prolog-defined methods can receive arguments in native Prolog data, native Prolog data may be associated with XPCE instance-variables and XPCE errors are (selectively) mapped to Prolog exceptions. These features make XPCE a natural extension to your Prolog program. http://doi.org/10.17993/3ctecno/2020.v9n1e33.61-77

HIGH LEVEL OF ABSTRACTION
XPCE's graphical layer provides a high abstraction level, hiding details on event-handling, redrawmanagement and layout management from the application programmer, while still providing access to the primitives to deal with exceptional cases.

EXPLOIT RAPID PROLOG DEVELOPMENT CYCLE
Your XPCE classes are defined in Prolog and the methods run naturally in Prolog. This implies you can easily cross the border between your application and the GUI-code inside the tracer. It also implies you can modify source-code and recompile while your application is running.

PLATFORM INDEPENDENT PROGRAMS
XPCE/Prolog code is fully platform-independent, making it feasible to develop on your platform of choice and deliver on the platform of choice of your users. As SWI-Prolog saved-states are machineindependent, applications can be delivered as a saved-state. Such states can be executed transparently using the development-environment to facilitate debugging or the runtime emulator for better speed and space-efficiency (Merrit, 1989).

POSTGRESQL
PostgreSQL, often simply Postgres, is an object-relational database management system (ORDBMS) with an emphasis on extensibility and standards compliance. As a database server, its primary functions are to store data securely and return that data in response to requests from other software applications. It can handle workloads ranging from small single-machine applications to large Internet-facing applications (or for data warehousing) with many concurrent users; on macOS Server, PostgreSQL is the default database; (Wierse, Grinstein, & Lang, 1996;Shoham, 2014;Bench-Capon, 1990) and it is also available for Microsoft Windows and Linux (supplied in most distributions). PostgreSQL is ACID-compliant and transactional. PostgreSQL has updatable views and materialized views, triggers, foreign keys; supports functions and stored procedures, and other expandability (Habarov, 2013). Connection between PostgreSQL and Prolog is provided by an ODBC driver.
An ODBC driver uses the Open Database Connectivity (ODBC) interface by Microsoft that allows applications to access data in database management systems (DBMS) using SQL as a standard for accessing the data. ODBC permits maximum interoperability, which means a single application can access different DBMS. Application end users can then add ODBC database drivers to link the application to their choice of DBMS (Guida & Tasso, 1989).
The ODBC solution for accessing data led to ODBC database drivers, which are dynamic-link libraries on Windows and shared objects on Linux/UNIX. These drivers allow an application to gain access to one or more data sources. ODBC provides a standard interface to allow application developers and vendors of database drivers to exchange data between applications and data sources (Companys, Falster, & Burbidge, 1990;Ardeleanu, 2016).

RESULTS
The following basic functions were developed, which enable work with PostgreSQL DBMS inside SWI-PROLOG.

GETTING THE LIST OF TABLES FROM THE CONNECTED DATABASE
getTables:-odbc_current_table(PostgreSQLProlog , Table), write (Table).    As the result of the research we have developed a knowledge base and tools for the selection of data from databases using the logical programming language SWI-PROLOG and DBMS PostgreSQL.

RECEIVING A RECORD FROM CURRENT
Based on the necessary predicates enabling the compatibility of SWI-PROLOG and PostgreSQL, the following files were created, namely: • UserInterface.pl -User interface.
• DataConnection.pl -Contains the functions for interaction with the ODBC driver.
In the future, it is also necessary to envisage the possibility of adding not only a certain set of data to the knowledge base, but also adding new inference rules not existing at the time of system development.
Thus, all this confirms the fact that the development of a fully-fledged expert system of this kind is a complex and expensive task. That's why it is important to understand how SQL data types can be represented in Prolog.
The PROLOG/ ODBC interface defines the following types of PROLOG data with the specified default conversion.

ATOM
It is used by default for SQL types char, varchar, longvarchar, binary, varbinary, longvarbinary, decimal and numeric. Can be used for all non-structural types.

STRING
A string of the extended SWI-PROLOG type.

CODES
List of code characters. Can consist of any amount of text.

INTEGER
Used by default for the SQL, tiny int, small int and integer bit types.

FLOAT
Used by default for SQL real, float and double types.

SUMMARY
On the basis on conducted research the following program and GUI was developed:

CONCLUSIONS
An important feature of the expert system is that the user cannot only receive a consultation, but also to access all the knowledge from system storage by asking relevant questions.
The use of expert systems makes it possible to make decisions in unique situations for which the algorithm is not known in advance and is formed from the initial data in the form of a chain of reasoning (decision rules) from the knowledge base.
The novelty of the new CASE tool presented is that it ensures the compatibility of SWI-PROLOG and DBMS PostgreSQL within the framework of a single integrated development environment. In the future this will be applicable to the development of various expert systems.