Theory of chemically assisted fracture