This repository has been archived on 2026-03-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
TP-KRR/pip1/3DMsolver.lp
vandechat96 94a5a22062 first commit
2023-02-28 22:29:48 +01:00

24 lines
662 B
Plaintext

#show match/3.
% Let the choice to have a triplet in the match or not
unmatch(X,Y,Z) :- tri(X,Y,Z), not match(X,Y,Z).
match(X,Y,Z) :- tri(X,Y,Z), not unmatch(X,Y,Z).
% every letter in domain must be used
:- dom(X), not match(X,_,_).
% cannot have different matching with same first letter
:- match(X,Y,Z), match(X,Y1,Z1), Z != Z1.
:- match(X,Y,Z), match(X,Y1,Z1), Y1 != Y.
% cannot have different matching with same second letter
:- match(X,Y,Z), match(X1,Y,Z1), X1 != X.
:- match(X,Y,Z), match(X1,Y,Z1), Z != Z1.
% cannot have different matching with same third letter
:- match(X,Y,Z), match(X1,Y1,Z), X != X1.
:- match(X,Y,Z), match(X1,Y1,Z), Y1 != Y.