A general framework for scientifically inspired explanations in AI