likes(john,mary).
person(mary).
person(john).
있습니다. 프롤로그 답변을 알 수 없도록 할 수있는 방법이 없습니까? 즉
\+ likes(mary,john)
우리는 가능한보다는 거짓으로 결합되지 않은 표현을 치료 프롤로그 요청할 수 있습니다. 나는 실존 적 양화를 허용하고 거짓이 아닌 언 바운드 관계를 다루는 IDP 시스템을 사용 해왔다. 그러나 나는 더 많은 주류를 사용하고 싶다. 당신이 문 산출
vocabulary V{
type Person
Likes(Person,Person)
}
theory T: V{
//Everyone might like someone and disallow narcisiscm
!x : ?y: Likes(x,y) & ~Likes(x,x).
}
//some instance without special meaning
structure S:V{
Person={A..C}
}
procedure main(){
//Print all possible solutions
printmodels(allmodels(T,S))
}
을 할 수 IDP에서 예를 들어 http://adams.cs.kuleuven.be/idp/server.html
언급 한 바와 같이
Number of models: 27
Model 1
=======
structure : V {
Person = { "A"; "B"; "C" }
Likes = { "A","B"; "A","C"; "B","A"; "B","C"; "C","A"; "C","B" }
}
//...
당신은 [Closed-world assumption] (https://en.wikipedia.org/wiki/Closed-world_assumption) 대 [Open-world assumption] (https://en.wikipedia.org/wiki)를 알고 있습니까?/열린 세계 _ 어설 션)? –
프롤로그는 닫힌 시스템에만 응답 할 수 있다고 말하고 있습니까? 내가 공개 시스템을 고려해도되는지, 아니면 그런면에서 제한되어 있다고 말하면서 다른 언어를 사용해 봐야한다고 생각할 수 있습니다. – awiebe
'mary'와'john'이 사람이기 때문에'likes (mary, john)'이 성공합니다. 두 번째 절에서 말하는 것입니다. –