문제

I am writing a simple program safety checker in Prolog and I need a data structure to hold variable valuation. Since I want to detect when I am visiting same state again, this structure must support some reasonable comparison semantics, so I can store visited states in set.

library(avl) has convenient getter/setter interface. The problem is, AVL holding the same mapping can take multiple forms. Thus two identical states would be considered distinct if their AVL representation differs.

A structure holding mapping in ordered lists would be free of this problem. However, I can't find anything like that in Sicstus docs. Is there any standard structure that does what I need, or do I have to implement it myself?

도움이 되었습니까?

해결책

You have ordered sets but in AVL you can always convert AVLs to ordered lists of key-valued pairs and then compare them.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top