2
운동 2.2 f를 조건에 대한 표현 (X, g (X, a))와 F (B, Y)를 요청하고 통일 수행 이 용어의 주소 (각각 a1과 a2로 표시).통합 알고리즘 예
나는 용어 힙 표현을 건설 한, 다음과 같이입니다 :
f(X, g(X, a)):
0 STR 1
1 a/0
2 STR 3
3 g/2
4 REF 4
5 STR 1
6 STR 7
7 f/2
8 REF 4
9 STR 3
f(b, Y):
10 STR 11
11 b/0
12 STR 7
13 STR 11
14 REF 14
과 지금의 Unify를 추적하도록 요청하고 (A1, A2), 그러나 20 페이지의 알고리즘에서 다음 1 내가 얻을 :
d1 = deref(a1) = deref(10) = 10
d2 = deref(a2) = deref(0) = 0
0 != 10 so we continue
<t1, v1> = STORE(d1) = STORE(10) = <STR, 11>
<t2, v2> = STORE(d2) = STORE(0) = <STR, 1>
t1 != REF and t2 != REF so we continue
f1/n1 = STORE(v1) = STORE(11) = b/0
f2/n2 = STORE(v2) = STORE(1) = a/0
and now b != a so the algorithm terminated with fail = true,
and thus unification failed, but obviously there exists
a solution with X = b and Y = g(b, a).
내 실수는 어디에 있습니까?