backward chaining object oriented typescript inference rules engine