work in progress: logic system