HACKER Q&A
📣 2ro

Use Prolog to specify fitness function in a genetic programming context?


Why not use Prolog to specify the fitness function in a genetic programming context?


  👤 thomascountz Accepted Answer ✓
Performance (fitness functions are usually high-volume/CPU intensive operations), state management (managing mutable state isn't Prolog's strong suit), and integration (you'll have to set up communication between whatever language/framework you're using and Prolog).

More generally, if you could completely specify what makes a solution "fit" using logic, you could just ask Prolog to find a solution that satisfies those predicates. The search would then be handled by Prolog's built-in resolution and backtracking mechanisms rather than needing a GA.

Do you have a specific type of problem in mind?