- midstring(?ABC, ?B, ?AC) is nondet
- midstring(?ABC, ?B, ?AC, LenA) is nondet
- midstring(?ABC, ?B, ?AC, LenA, LenB) is nondet
- midstring(?ABC, ?B, ?AC, LenA, LenB, LenC) is nondet
- Too difficult to explain. See the Quintus docs. As far as I
understand them the code below emulates this function just fine.