implement domain/ragne inference