Crystal-structure phase mapping is a core, long-standing challenge in materials science that requires identifying crystal structures, or mixtures thereof, in synthesized materials. Materials science experts excel at solving simple systems but cannot solve complex systems, creating a major bottleneck in high-throughput materials discovery. Herein we show how to automate crystal-structure phase mapping. We formulate phase mapping as an unsupervised pattern demixing problem and describe how to solve it using Deep Reasoning Networks (DRNets). DRNets combine deep learning with constraint reasoning for incorporating scientific prior knowledge and consequently require only a modest amount of (unlabeled) data. DRNets compensate for the limited data by exploiting and magnifying the rich prior-knowledge about the thermodynamic rules governing the mixtures of crystals with constraint reasoning seamlessly integrated into neural network optimization. DRNets are designed with an interpretable latent space for encoding prior-knowledge domain constraints and seamlessly integrate constraint reasoning into neural network optimization. DRNets surpass previous approaches on crystal-structure phase mapping, unraveling the Bi-Cu-V oxide phase diagram, and aiding the discovery of solar-fuels materials.Artificial Intelligence (AI) 1 aims to develop intelligent systems, inspired in part by human intelligence. AI systems are now performing at human and even superhuman levels on a range of tasks such as image identification 2 , face, 3 and speech recognition 4 . AI also has the potential to accelerate scientific discovery dramatically. [5][6][7][8][9][10] Recent AI achievements have been driven mainly by advances in supervised deep learning 11 , which requires large labeled datasets to supervise model training. However, in general, scientists do not have large amounts of labeled data for scientific discovery. They often solve complex tasks using only a few data samples by amplifying intuitive pattern recognition with detailed reasoning about prior knowledge to make sense of the data. Such a hybrid strategy has been difficult to automate. Herein we consider crystal-structure phase mapping, a long standing challenge in materials science that is emblematic of the class of scientific problems whose automation constitutes a substantial advancement with respect to the grand challenge of high-throughput unsupervised scientific data interpretation.Crystal-structure phase mapping involves separating noisy mixtures of X-ray diffraction (XRD) patterns into the source XRD signals of the corresponding crystal structures, a task for