Reminds me a bit of prolog with the query system