5 ms·
Are there some corners of the industry where Prolog is beneficial? Or is this mostly an academic endeavour?
by lrem 5y ago
Are there some corners of the industry where Prolog is beneficial? Or is this mostly an academic endeavour?
- tcoff91 5y agoOne big usage in industry of prolog is in airline logistics software.
- tunnuz 5y agoWhat’s the main reason for that?
- mjul 5y agoHistorically, airlines had a lot of computing power. In Jim Grays 1984 article about getting to "1000 transactions per second" (TPS), an "ordinary" system ran at 50 TPS and airlines were pushing above 800 TPS. So, they had capacity and competence. Second, airlines are expensive beasts to run so solving hard problems is worth a lot of money. Third, there are a lot of rules in aviation that suit themselves nicely to combinatorial optimisation. Think crew scheduling: if there is a delay on an inbound flight the crew may not be allowed to fly the aircraft on its next leg since they would exceed their maximum working hours for the day. But then you need to find another crew and a good rescheduling to perhaps a shorter or earlier flight for the original crew. And then you have to think about rescheduling passengers to their connecting flights or holding those flights back a bit to allow the passengers to make the connection. And you have twenty minutes to do it before they land. Handling these "catastrophes" pop up again and again in the daily operations and are well suited for the kind of combinatorial search provided by logic programming in combination with optimisation engines. There are specialist companies in this area. For example, PDC's Turbo Prolog and Visual Prolog products have been used extensively in aviation since the 90s.
- capableweb 5y agoYes, every (type of) language has it's corner, no language is best for absolutely everything. Since Prolog is a logic-based and declarative programming language, if you're dealing with goal reduction or backwards chaining, then Prolog is a excellent fit and will probably be easier to both write and maintain compared to other languages. Theorem proving, automated scheduling and querying data stores are also excellent use cases for Prolog and Prolog-like languages.
- mjul 5y agoAnother common use case is product configuration where you need to fit different parts into a compatible whole. For example, "I already have Machines A and B with control system S, but now I want to add Machines C and D from another vendor and I need the control systems to work together, what are my options?" It would query the configuration rules about products and compatibility with the 'knows' that you tell it and find options for the 'unknowns' and tell you something like, "then you can buy X, Y or Z, but if you chose Z you also need to buy an external temperature control from the Foobar 800 series with the D-bus adapter". In practice, it is often even more complex. Logic programming is great for this, and I find that using it in small subsystems of a larger application is a super powerful tool. For interactive systems, a fast implementation is really important. The CLP aspects of Scryer Prolog would also be very helpful.
- all2 5y agoThis sounds hugely beneficial for manufacturing engineering, or even product or component design.
- p_l 5y agoOne of the original big wins in expert systems were systems used to first verify, then help plan, purchases for Digital's VAX computers. Just the one that verified you didn't sell or deliver a computer with missing or incorrect parts saved a lot of money. The next systems added help in planning capacity or physical site.
- mjul 5y agoI would also add that it is a powerful tool in your development toolbox even if you don't use it in you primary applications. For example, it is very useful for e.g. generating test cases to hit every state transition in a complex business process state diagram.
- jb1991 5y agoThink about the kind of algorithms you would create to do things like automatically solving a sudoku puzzle. Or finding the ideal dimensions of a piece of furniture to fit in a small spot with certain constraints required on building that furniture. These are the kinds of problems that logic programming is well suited for, in fact they are rather trivial to do without having to construct an algorithm yourself.
- paavohtl 5y agoIt wasn't exactly Prolog, but we used a logic programming DSL for validating contract terms in a sales tool.
- jacquesm 5y agoEffectively: anything built in Erlang. Erlang has its roots in Prolog and comes with a complete eco-system for application development. There are numerous examples where Prolog itself was used, for instance, every instance of Windows NT contained a Prolog implementation to handle the details of network configuration.