←back to thread

Clolog

(github.com)
258 points todsacerdoti | 1 comments | | HN request time: 0s | source
Show context
sterlind ◴[] No.43696088[source]
really happy to see something of a revival of interest for logic programming lately. it's an extremely powerful tool if you know when to reach for it.
replies(2): >>43696328 #>>43696926 #
MarkMarine ◴[] No.43696328[source]
When would you reach for it?
replies(3): >>43696697 #>>43696708 #>>43696837 #
iLemming ◴[] No.43696708[source]
Scheduling, e.g., course scheduling - allocating rooms, professors, time slots while satisfying constraints; Product configuration systems - helping customers select compatible options for complex products; Genealogical research - querying family relationships and ancestry; Static analysis tools for code - finding bugs or verifying properties without execution; Medical diagnosis systems - inferring conditions from symptoms based on medical knowledge; Travel planning - finding optimal routes with multiple constraints; Legal reasoning systems - determining applicability of laws to specific cases; Natural language interfaces - parsing questions and generating appropriate database queries; Hardware verification - proving correctness of circuit designs; Puzzle solvers - Sudoku, crosswords, logic puzzles;

Basically anything that excels when declarative specification of relationships is more natural than imperative algorithms.

replies(3): >>43697181 #>>43697768 #>>43703416 #
whartung ◴[] No.43697768[source]
Well the bigger question is how big does the system have to be to warrant breaking out a new technique, much less adding a new runtime or other large dependency.

Now, I have no direct experience with any of the common logical programming systems. I have familiarity.

But anytime I came upon anything that might justify such a system, the need just didn’t seem to justify it.

Talking less than 100 rules. Most likely less than a couple dozen. Stacking some IFs and a bit of math, strategically grouped in a couple aptly named wrapper methods to help reduce the cognitive load, and it’s all worked pretty well.

And, granted, if I had solid experience using these systems, onboarding cost would be lower.

When have you found it to be worth cutting over?

replies(3): >>43698127 #>>43700439 #>>43703919 #
1. iLemming ◴[] No.43698127{4}[source]
Absolutely valid and befitting point - adding complexity without clear benefits never should be justified. Most (business) applications have ruleset logic for specific problems not exceeding a dozens of rules - regular code often works fine.

Logic systems tend to show the value when rules become complex with many interdependencies or non-linear execution patterns emerge, or rules change frequently or need to be defined at runtime; when you need explanation tools - e.g., why was this conclusion reached?, etc.

I agree, situations for when you need to implement a logic system are not extremely common, but maybe I just have not worked in industries where they are - on top of my head I can think of: factory floor scheduling; regulatory compliance (e.g., complex tax rules); insurance systems, risk-calculation (credit approval); strategy games; retail - complex discounting; etc.