Add validity checking for Inspect.Algebra documents