←back to thread

Clolog

(github.com)
258 points todsacerdoti | 2 comments | | HN request time: 0.532s | 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 #
1. barrenko ◴[] No.43703416[source]
I really don't know not nearly enough about the topic - but couldn't a lot of these be handled with types, so my question is - are types at least adjacent to logical programming? (apologies in advance)
replies(1): >>43705916 #
2. iLemming ◴[] No.43705916[source]
Yes, afaik there is meaningful relevance between logic programming and type systems - Curry-Howard; Dependent types; SMT solvers (related to SAT solvers mentioned in this discussion). However, constraint problems discussed (scheduling, travel planning, puzzles) would require quite verbose and complex encoding to solve with a type system and significant sophistication - Idris or Coq aren't for the faint-hearted.

Type systems would absolutely choke on trying to solve things like: Knowlege representation and querying - imagine medical diagnosis systems with thousands symptoms and conditions; Dynamic constraint solving - where constraints emerge at runtime; Exploratory search problems requiring bfs/dfs of large solution spaces - e.g., route finding with changing conditions; NLP tasks - grammar parsing and understanding; etc.