This chapter describes an approach to modeling the domain-specific knowledge of mathematics learners in a predicate-logic formalism suited for computer implementation. Two hypotheses are central to this approach. First, a person's cognitive behavior is a knowledge-based process that evolves from relatively simple component processes of an inferential nature. The complexity of a person's observed behavior in a domain depends on the knowledge base: how many facts and rules he or she has and how these facts and rules are organized. Second, a person's behavior in a task situation is generally not supported by the total body of his or her long-term knowledge. Rather, it is assumed that knowledge must be activated to be used in a given situation and that the accessibility of particular knowledge depends on contextual cues in the situation. The degree to which particular knowledge is contextually bound with respect to a set of specific situations is called situation specificity.