I have labored this question before, but am now wondering about it from a different angle.
I notice that much code i write is deterministic. I, indeed wrap sequences of predicates into once/1.
I also noticed that test code i write is essentially determinstic – i.e. if one predicate in a test fails then the test should fail without further backtracking.
I imagine that use of once/1, essentially creates a choice point upon call of a predicate, and then removes (prunes) the choice point, when encountering a cut.
Assuming this is correct, wouldn’t it be much more performant if code sections could be declared as deterministic, so that a compiler generates code without creating choice points.
I am further assuming that choice point creation is quite an overhead beyond “simple” calls.
any thoughts are much appreciated,