code: public TypeResults extractTypes(Multimap<Predicate, CQIE> ruleIndex, List<Predicate> predicatesInBottomUp, DBMetadata metadata)
              throws IncompatibleTermException {
          ImmutableMap<CQIE, ImmutableList<Optional<TermType>>> termTypeMap = extractTermTypeMap(ruleIndex.values());
  
          return new TypeResults(termTypeMap,
                  extractCastTypeMap(ruleIndex, predicatesInBottomUp, termTypeMap, metadata));
      }
docs: Main method.
  
  Extracts the TermTypes and the cast types from a set of Datalog rules.