Case-Based Modeling and the SACS Toolkit: A Mathematical Outline