Some inference utilities.