Re:Alloy*: A Higher-Order Relational Constraint Solver
by yesenadam on Wednesday February 27, 2019 @11:18PM
(#19268918)
Hmm well, not all Prolog uses fit the 'give it a database' model..(In fact I can't think of any Prolog programs I've seen that do fit it) e.g. I was tried the the finite domain solver in Gnu Prolog[0] recently, I wanted arrangements of about 15 shapes that obeyed certain constraints, the program was 6 very short lines! I didn't tell it anything except the constraints.
But yeah, alloy and alloy* sound fascinating, I must investigate further, thank you.
Re:Alloy*: A Higher-Order Relational Constraint Solver
by sriram_malhar on Thursday February 28, 2019 @01:42AM
(#19269469)
You are right. Constraint solving in general is a specific area that does not require a knowledge base; instead it is a search for a solution from the specified domain that fits all the specified constraints. Here there is considerable overlap between prolog, alloy and z3.
However, most general prolog programming has the same requirements placed on other executable languages, to transform, store and communicate data. Alloy is not the tool for this aspect.
Prolog is an executable language. You, the user, give it a database, and it searches for solutions that satisfies constraints. It doesn't create the basic facts on its own.
There exists a compiler from imperative alloy to prolog to make this transition.