general inference engine