A mixture of magnesium chloride and calcium carbide on heating gives magnesium metal. In this process calcium carbide is: