F# implementation of knowledge base