Compilation And Inference With Chemical Reaction Networks