URL: https://linuxfr.org/forums/programmationautre/posts/datalog Title: Datalog Authors: Anthony Jaguenaud Date: 2014年07月30日T15:15:18+02:00 License: CC By-SA Tags: Score: 2 Bonjour, suite au commentaire parlant de [racket](http://linuxfr.org/users/pmoret/journaux/python-comme-premier-langage-de-programmation#comment-1551996), j'ai essayé. Je suis tombé sur le support de datalog un langage à la _prolog_. J'ai donc fait l'exemple de la famille classique. J'ai appelé le papa _dad_, la mère _mom_, et les enfants _son[123]_. Quand je cherche à connaitre les frères de son3, j'obtiens son1 et son3 ! Je voudrais éliminer le dernier cas en ajoutant quelque chose du genre : brother(G, G) est faux ou en ajoutant dans le prédicat quelques chose du genre `G != E` ```datalog ancestor(A, B) :- parent(A, B). ancestor(A, B) :- parent(A, C), D = C, ancestor(D, B). mother(A,B) :- parent(A, B), female(A). father(A,B) :- parent(A, B), male(A). brother(G, E) :- male(G),father(P, G), mother(M,G), father(P,E), mother(M,E). parent(dad,son1). parent(dad,son2). parent(dad,son3). parent(mom,son1). parent(mom,son2). parent(mom,son3). male(dad). male(son1). male(son3). female(son2). female(mom). father(A, B)? mother(A,son2)? brother(A,son3)? ``` Si quelqu'un a une idée. Je suis preneur.