问题有些模糊的地方比如什么是合法,怎么推理(A N C)& (C NE D) =》 (A ?D
)对这个特殊问题合法性和推理规则也不难定义。
Given d = {N, NE, E, SE, S, SW, W, NW}.
- (d1, d2) is consistent if d1 \cap d2 != \empty
- (A d1 B) (B d2 C) => (A d1 \cap d2 B)
- (A d1 B) => (B d2 A) where d2 is the substitute d1 with SN and WE
Let D be a n X n matrix (it can be considered a graph) where D(i,j) is a set
of directions from i to j, given or inferred. Then run the inference until
no more changes. During inference, whenever a new direction is inferred for
i and j, check if the new direction is consistent with existing ones.
To make it simpler, consider the given objects an ordered set, then it is
not necessry to consider both (A d1 B) and (B d2 A) though the given (B d2 A
) needs to be converted to (A d1 B)
I think this should work, not sure if it is efficient.