Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools

What is important

  • bound vs. not bound variables (always keep in mind if a variable is bound or not)
  • accessing the first argument works in linear time (first-argument-indexing)
  • use _In and _InEncl : see Suffixes for PEF-Predicates


Find all methods in a Class

bound vs. non-bound variables

  • what is bound: ClassID
  • what is probably not bound: MethodID

good choice: use first argument indexing (remember: ClassID is bound) with methodDefT_In

  methodDefT_In(ClassID, MethodID)

bad choice: use methodDefT (remember: MethodID is probably not bound):

  methodDefT(MethodID, ClassID, _, _, _, _, _)

running time


  • c classes
  • m methods
  • n methods in the class with ClassID
  • first argument access works in constant time
  • other access in linear time (or logarithmic if you explicitly create an index)


  • using methodDefT_In takes time n
  • using methodDefT takes time m

Assuming we have c=100 classes with the same number of methods n each, using methodDefT_In is m/n = 100n/n = 100 times faster than using methodDefT.

research/cultivate/prologperformance.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019