3 ms·
My execution model is pretty simplistic. It basically does forward chaining (not backtracking which is what a real Prolog interpreter would do). The reason is
by rwmj 11y ago
My execution model is pretty simplistic. It basically does forward chaining (not backtracking which is what a real Prolog interpreter would do). The reason is that we have the core set of true terms up front, and we can just run the rules to derive more and more terms until we hit the solution, and because of the way the rules are written, we (hopefully!) won't get a combinatorial explosion of terms.
This naive execution model is described here:
https://github.com/rwmjones/libguestfs/blob/inspection-expert-system/inspection/guestfs-inspection.pod https://github.com/rwmjones/libguestfs/blob/inspection-exper...
under the section "Program evaluation".
- ScottBurson 11y agoLooks like it's more like Datalog than full Prolog. [0] You are probably using something similar to what is called the "semi-naive" evaluation strategy (which despite the disparaging-sounding name is actually pretty good). [0] https://en.wikipedia.org/wiki/Datalog https://en.wikipedia.org/wiki/Datalog
- rwmj 11y agoYes, I think you're right. I'm really exploring this for the first time since university, and I don't have any real formal basis for what I'm doing. Just a real world problem to solve.