Ai Lab 12
Ai Lab 12
1. Lack of Declarative Semantics: Traditional programming languages, like C, Java, and Pascal,
are imperative and require programmers to specify how to achieve a particular task step by step.
This can make code hard to read, understand, and maintain. Prolog, on the other hand, o ffers a
declarative approach, where you specify what you want to achieve, and the system figures out how
to do it. This makes Prolog particularly well-suited for tasks involving complex logical
relationships.
2. Inefficiency in Symbolic Reasoning: Traditional languages are not well-suited for symbolic
reasoning and complex rule-based systems. They require extensive programming to handle symbolic
manipulation and rule-based inference. Prolog, with its built-in support for symbolic reasoning,
makes it easier to work with knowledge representation and rule-based systems.
3. Limited Pattern Matching: Pattern matching is a fundamental aspect of many applications, such as
text processing and artificial intelligence. Traditional languages often lack powerful built-in pattern
matching capabilities, making it harder to work with data matching specific patterns. Prolog excels at
pattern matching, making it an excellent choice for tasks like natural language processing and expert
systems.
4. Explicit Data Manipulation: Traditional languages require explicit data manipulation, which
can be tedious and error-prone. Prolog, on the other hand, uses unification and pattern matching to
handle data manipulation implicitly, simplifying the code and reducing the chance of errors.
5. Procedural Complexity: Traditional languages often lead to complex and lengthy code due to
their procedural nature. Prolog's declarative nature allows for more concise code, making it easier to
express complex relationships and logic in a compact manner.
6. Difficulties in Handling Uncertainty: Many real-world problems involve uncertainty and incomplete
information. Traditional languages struggle to handle these issues e ffectively. Prolog, with its ability to
represent and reason with uncertain information through probabilistic and fuzzy logic extensions, is
better equipped to address such problems.
• Evolution of Prolog:
The programming language, Prolog, was born of a project aimed not at producing a programm3ing
language but at processing natural languages; in this case, French. The project gave rise to a preliminary
version of Prolog at the end of 1971 and a more definitive version at the end of 1972.
Year Milestone
Birth of Prolog - Alain Colmerauer and Robert Kowalski laid the foundation for
1972 Prolog with the development of the first Prolog system at the University of Aix-
Marseille.
First Interpreter - The first Prolog interpreter was implemented, which marked the
1973 practical realization of Prolog as a programming language.
Edinburgh Prolog - David H. D. Warren developed the Warren Abstract Machine (WAM)
1980 and Edinburgh Prolog, making Prolog more efficient and widely adopted.
ISO Standardization - The first official Prolog standard, Edinburgh Prolog, was proposed
1981 as an international standard, but it wasn't accepted.
C-Prolog - Quintus Prolog, one of the first commercially available Prolog systems,
1982 was developed by SRI International.
Integration with Other Languages - Prolog saw integration with other languages and
2010s tools, enabling hybrid systems and more extensive applications.
Expanding Use Cases - Prolog is being explored for new applications, including
Future natural language processing, data analysis, and rule-based systems.
The problem domain of AI lab and the library which will be used and their distribution.
The problem domain of an AI lab encompasses the study and development of artificial intelligence (AI) technologies
and applications. It involves creating algorithms, models, and systems that mimic human intelligence and
behavior, enabling computers to perform tasks that typically require human cognitive abilities. AI labs focus on
areas such as
Face recognition
Speech recognition
Solving Complex Problems
Training Future AI Experts
Collaboration and Networking
2. Repl.it: Repl.it is an online platform that supports various programming languages, including Prolog. It provides
an online code editor, compiler/interpreter, and collaborative coding features. You can write and run Prolog code in
your browser on Repl.it at Repl.it Prolog.
3. Ideone: Ideone is an online compiler and debugging tool that supports Prolog. You can write Prolog code in the
online editor and run it to see the output. It's available at Ideone Prolog.
4. OnlineGDB: OnlineGDB is an online IDE and debugger that supports Prolog. You can write, run, and
debug Prolog code within your web browser. It's accessible at OnlineGDB Prolog.
5. TutorialsPoint: TutorialsPoint offers an online Prolog compiler and editor that allows you to write and
execute Prolog code. You can access it at TutorialsPoint Prolog.
Fig 1.6 Online IDE for Prolog
Step 2: Click on Download which is adjacent to Home, dropdown list will appear then click on SWI-Prolog.
Fig 1.7 SWI Download website
Step 4: After clicking on stable release new webpage will open which will contain stable versions of prolog for
different platforms. Click on the one as per your system configuration. Lets take the one for 64-bit operating system.
Step 5: After clicking on SWI-Prolog 8.4.0-1 for Microsoft Windows (64 bit), a new webpage will open, check
on I understand checkbox to make the download link active.
Step 6: Now check for the executable file in downloads in your system and run it.
Step 7: It will prompt confirmation to make changes to your system. Click on Yes.
Step 10: After it there will be screen of installing options so check the box for Add swipl to the system path for all
users, and also check the box for create a desktop icon and then click on the Next button.
Fig 1.9 Installation formatting
Step 11:The last screen is of choosing components, all components are already marked so don’t change anything just
click on Install button.
Step 12: After this installation process will start and will hardly take a minute to complete the installation.
Step 14: SWI Prolog is successfully installed on the system and an icon is created on the desktop.