3 ms·
For anyone who learned Prolog, implementing Prolog in Prolog is a classic exercise in the language which can be one in a dozen lines. The goal is to be able to
by coliveira 9y ago
For anyone who learned Prolog, implementing Prolog in Prolog is a classic exercise in the language which can be one in a dozen lines. The goal is to be able to modify the language to handle additional syntax that is problem-specific (think about a macro system that can implement in its own syntax).
- fusiongyro 9y agoEven aside from changing the syntax, you often have to do this to modify the resolution strategy, such as using breadth-first instead of depth-first search, or add probabilistic or fuzzy logic. A lot of papers on Prolog from the 80s start with "what would it be like to use logic-X from Prolog?" You can do a lot of interesting deep cuts like this without a huge amount of work. Prolog even has a built-in context-free parser that works the same way: definite clause grammars.