Created
March 2, 2012 06:33
-
-
Save bohde/1956247 to your computer and use it in GitHub Desktop.
The send more money constraint problem in Prover 9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
op(490, infix_right, "+"). | |
op(470, infix_right, "*"). | |
op(460, infix, "/"). | |
op(460, infix, "mod"). | |
op(390, prefix, "-"). | |
assign(domain_size, 10). % domain is {0,1,2,3,4,5,6,7,8,9}. | |
% S E N D | |
% + M O R E | |
% --------- | |
% M O N E Y | |
list(distinct). | |
[S,E,N,D,M,O,R,Y]. | |
end_of_list. | |
formulas(assumptions). | |
D + E = Y + C1 * 10. | |
N + R + C1 = E + C2 * 10. | |
E + O + C2 = N + C3 * 10. | |
S + M + C3 = O + M * 10. | |
% Leading zeros are not allowed. | |
S != 0. | |
M != 0. | |
end_of_list. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment