1. A computer implemented method for performing analysis on a plurality of data stored in a database, the computer implemented method comprising: generating a first cohort from the plurality of data; generating an optimal control cohort from the plurality of data, wherein generating is performed based on the first cohort and at least one constraint, and wherein a mathematical process is used to derive the optimal control cohort; generating a first inference based on a comparison of the first cohort to the optimal control cohort, wherein the first inference is absent from the database; storing the first inference; receiving an I th query at the database regarding an I th fact, wherein I is an integer reflecting how many times a recursion process has been conducted, wherein the I th fact becomes a compound fact that includes multiple sub-facts on a subsequent iteration of the recursion process; establishing the I th fact as a frame of reference for the I th query based on the first cohort and based on the optimal control cohort; applying an I th set of rules to the I th query, wherein the I th set of rules is determined for the I th query according to a J th set of rules, wherein J is equal to I−1, wherein the I th set of rules determines how the plurality of data are to be compared to the I th fact, and wherein the first set of rules determines an I th search space for the I th query; executing the I th query to generate a second inference, wherein the second inference is determined from comparing the plurality of data according to the I th set of rules; storing the second inference; and evaluating a hypothesis within a research study based on the first cohort, the optimal control cohort, the first inference, and the second inference performed by a processor.