LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-15-2018, 03:38 PM   #1
floppy_stuttgart
Senior Member
 
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 1,153
Blog Entries: 5

Rep: Reputation: 107Reputation: 107
PROLOG programming?


hello,
has somebody a list of example of prolog programming which is a real life use and not only fun/university theoretical story?
thanks!
(I am trying to move from python/OOP to the next level.. as hobby and brain massage)
 
Old 12-15-2018, 11:35 PM   #2
Mechanikx
Member
 
Registered: Jul 2018
Distribution: Slackware
Posts: 351

Rep: Reputation: 258Reputation: 258Reputation: 258
I haven't heard of many commercial software written in prolog. I do know parts of IBM watson are written in it though.
 
Old 12-16-2018, 10:52 AM   #3
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by Mechanikx View Post
I haven't heard of many commercial software written in prolog. I do know parts of IBM watson are written in it though.
Prolog (PROgramming in LOGic) is a language, expecially for AI type of research.
From wikipedia:
Code:
Prolog is a logic programming language associated with artificial intelligen
and computational linguistics.
Prolog has its roots in first-order logic, a formal logic,
and unlike many other programming languages, Prolog is intended
primarily as a declarative programming language: the program
logic is expressed in terms of relations, represented as facts
and rules.
so it's not really meant for commercial applications.

Last edited by ehartman; 12-16-2018 at 10:54 AM.
 
Old 12-16-2018, 11:16 AM   #4
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
http://www.drdobbs.com/parallel/the-...olog/184405220

Quote:
The Practical Application of Prolog

By Al Roth, December 10, 2002

Prolog is no longer confined to research laboratories, but is now considered to be a powerful tool for the development of commercial applications.
That article is a bit old, but it seems that commercial prolog implementations still exist, so someone must be making money with them...

https://sicstus.sics.se/customers.html
Quote:
SICStus Prolog Customer References
Customers of SICStus Prolog have proven its efficiency for large amounts of data and large applications. SICStus Prolog is used in a wide range of domains from medicine research to data mining of financial data. Some of the applications are briefly presented below.
 
1 members found this post helpful.
Old 12-17-2018, 09:19 AM   #5
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,473

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Wow, the thread title took me back to my college days in the mid 1980s!!!!!
 
1 members found this post helpful.
Old 11-13-2022, 04:08 PM   #6
floppy_stuttgart
Senior Member
 
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 1,153

Original Poster
Blog Entries: 5

Rep: Reputation: 107Reputation: 107
Modern application/use found https://www.youtube.com/channel/UCFF...cugmotg/videos
 
Old 11-22-2022, 03:44 PM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,636
Blog Entries: 4

Rep: Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932
I used Prolog ("GNU Prolog = gprolog") twice to solve a difficult multi-part puzzle Geocache.

One part was a Sudoku puzzle. Prolog found the answer almost instantly.

The second part was a logic problem. ("The girl with the red sweater did not sit to the left of the man with the blue jacket.") There were 21 statements in the puzzle. GProlog's "finite-domain (FD) problem solver" actually took almost eleven seconds to find the solution, albeit on a fairly slow machine.

Being "first to find" on the cache was almost an anticlimax. Geek that I am, what really interested me was learning how to use the gprolog tool to solve the puzzles. I'm still fairly weird that way.

Prolog's strength is that it has you describe the problem, not the solution. You describe the thing that you want to have solved, not the method or procedure for solving it. Not every implementation is the same. But "GNU Prolog" is considered to be very advanced, particularly in its "FD solver."

Last edited by sundialsvcs; 11-22-2022 at 03:58 PM.
 
Old 12-01-2022, 03:55 PM   #8
rclark
Member
 
Registered: Jul 2008
Location: Montana USA
Distribution: KUbuntu, Fedora (KDE), PI OS
Posts: 474

Rep: Reputation: 178Reputation: 178
I remember playing around with Borland Turbo Prolog for a time (back when). Never found a real life use case for the language though. I've installed gprolog now and then ... but again never used for 'useful' applications in the 'real' world. Same with Lisp. So, back to C, C++, (Object) Pascal, Assembly, C#, and now a little Rust for me. You might want to look into Rust (at least get a bit familiar with it) as it 'seems' to be an up and coming language. Anyway, just my experience....

Quote:
the thread title took me back to my college days in the mid 1980s!!!!!
Me too... Borland products were 'the' cats meow. Turbo Pascal, Turbo Assembler (tasm), Turbo C, Turbo Prolog, etc.

Last edited by rclark; 12-01-2022 at 04:01 PM.
 
Old 12-02-2022, 01:06 PM   #9
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,636
Blog Entries: 4

Rep: Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932
However, it must now be "fairly" said that most of the languages of which you speak (probably excluding LISP) are: "procedural." In other words, they give you ways to describe how to solve the problem.

Non-procedural languages, such as Prolog (or various statistical packages) require you to simply describe the problem, itself. They never expose to you the underlying (procedural ...) very-clever algorithms which will eventually be deployed to solve it.

Last edited by sundialsvcs; 12-02-2022 at 01:13 PM.
 
Old 12-02-2022, 05:27 PM   #10
rclark
Member
 
Registered: Jul 2008
Location: Montana USA
Distribution: KUbuntu, Fedora (KDE), PI OS
Posts: 474

Rep: Reputation: 178Reputation: 178
Oh, I understand . But my mind just doesn't 'work' the Prolog way. As part of my Applied CS degree we went through the concepts back then. Statistics was another one of those things that I couldn't apply well (never make a statistician) . The math was easy... Just didn't get the 'feel' for when to use this or that for a given problem (in quite a few cases)... Opposite of good 'o practical real world physics applications (well, until you drop into the quantum realm)... Or as in our programming world, straight forward easy to use 'C' .
 
Old 12-02-2022, 05:46 PM   #11
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,636
Blog Entries: 4

Rep: Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932Reputation: 3932
Basically, the simple way that I might describe this to you is ... "how to learn to rely upon someone else's algorithms."

"Someone else" not only mapped out "an entire general set of problems for you," but they perfected a likewise generalized set of already-debugged ways of solving them. They have "already been there," precisely so that you did not have to.

Their approach depended of course on "abstraction." For example, "a Sudoku puzzle," much like "a Logic Problem," is a finite-domain (FD) constraint problem. Which is a very-useful abstraction. If you can devise a way to frame your problem within this prescribed context, you can very quickly solve your "puzzle." Without writing a single line of procedural code.

Last edited by sundialsvcs; 12-02-2022 at 05:51 PM.
 
  


Reply

Tags
clips, oop, prolog, python


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Grasp Prolog Programming with Free Books LXer Syndicated Linux News 0 07-30-2017 09:42 AM
Prolog Help with if-then-else-else if?? magicvash Programming 1 05-27-2005 09:31 AM
Prolog problem glam1 Programming 0 10-10-2004 10:10 AM
how to compile a prolog program Randall Programming 1 06-21-2004 12:02 PM
Prolog Compiler mikeshn Programming 2 12-05-2003 09:52 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration