**fact:**
protein(annexin,[a,s,d,f]).
**rules:**
(i dont know)
**query:**
protein(N,[q,w,e,a,s,d,f])
**result:**
N= annexin
**query:**
protein(N,[q,w,e,a,s,d,f,w,o,e])
**result:**
N= annexin
答案 0 :(得分:2)
a
是腺嘌呤,但那些非经典的碱基是什么?不管怎样,让我们使用dcg。
protein(annexin) -->
[a,s,d,f].
withprotein(Protein) -->
...,
protein(Protein),
... .
... --> [] | [_], ... .
用法:
?- phrase(withprotein(Protein), [q,w,e,a,s,d,f,w,o,e]).
Protein = annexin
答案 1 :(得分:0)
当且仅当其定义是字符串的子列表时,字符串才包含蛋白质:
protein(annexin, [a,s,d,f]).
has_protein(Protein, List) :-
protein(Protein, ProteinDefinition),
sublist(ProteinDefinition, List).