% File: hipp-dec-alternative-gus-asp.lp % Run with command: lparse -d none --true-negation -c n=5 -c m=4 -c k=4 P0.happ hipp-dec-alternative-gus-asp.lp | cmodels -ms % Alternative HIPP-DEC formulation, according to Gusfield's definition % C1 For every genotype g in G, for every ambiguous site j % of g, the values of the j'th sites of these haplotypes are different. % C2 For every genotype g in G, for every resolved site j of g, % the values of the j'th site of these haplotypes are g[j]. % C3 There are at most k unique haplotypes in H. geno(1..n). % n genotypes site(1..m). % m sites haplo(1..2*n). % k haplotypes % Generate a set of k haplotypes {h(H,J)} :- haplo(H), site(J). % C1 :- amb(G,J), h(2*G,J), h(2*G-1,J), geno(G),site(J). :- amb(G,J), not h(2*G-1,J), not h(2*G,J), geno(G),site(J). % C2 :- not h(2*G-1,J), -amb(G,J), geno(G),site(J). :- not h(2*G,J), -amb(G,J), geno(G),site(J). :- h(2*G-1,J), not -amb(G,J), not amb(G,J), geno(G),site(J). :- h(2*G,J), not -amb(G,J), not amb(G,J), geno(G),site(J). % C3 diffsite(H1,H2,J) :- 1{h(H1,J), h(H2,J)}1, haplo(H1;H2), H1