readeropf.blogg.se

Dynamic programming prolog
Dynamic programming prolog












dynamic programming prolog

We went over Prolog for five weeks or so, and while I did thoroughly enjoy learning a whole new paradigm, it still felt like it was just a toy.

dynamic programming prolog dynamic programming prolog

And learning logic programming is one of those ventures that will expand your horizons.įinally, here's a logic programming interpreter I wrote some years ago for a class: Prolog certainly isn't your every day programming tool, but in some cases it's a really good tool to have. In practice, it wouldn't probably be Prolog itself, because implementing similar languages is so much fun and writing the code to call an external Prolog interpreter is about as much trouble but a lot less fun. This is just a crazy idea I've been brewing, but this would definitely be a nice use case for a Prolog -style logic programming language. If the final output has ambiguous types, it is a compile error in the source program. This means that there will be ambiguous types for expressions, something which is quite hairy to implement using a H-M based classic type inference algorithm. The advantage of this approach would be allowing function overloading (similarly to C++ or Java) informally without interfaces or type classes. In the second step, the logic program is evaluated which will result in the types for the program. In the first step (a typical syntax tree walk), rather than doing the actual unification directly, a Prolog -style logic program would be emitted. I have been considering writing a compiler for a programming language that would do type inference indirectly in two steps. The same algorithm is behind Hindley-Milner -style type inference algorithms. I'll share an idea for a logic programming project that I've been brewing for quite some time (but never started working on).Īs you may know, the engine behind Prolog is based on the unification algorithm (finding substitution values for variables to make two patterns equal).














Dynamic programming prolog