Flattened form in WAM

微笑、不失礼 提交于 2020-12-12 10:45:10

问题


The WAM: A Tutorial Reconstruction states that a query, p(Z, h(Z,W), f(W)), needs to be flattened using the following principles:

That being said, the query flattened form is:

X3=h(X2, X5), X4=f(X5), X1=p(X2, X3, X4);

I am lost with the definition of external variable, consider the following:

p(Z, h(Y, a(K, C), b(W)), f(W)).

Is Y an external variable? How should be the flattened form for this? From my understanding this would be the construction:

X1 = p(X2, X3, X4)
X2 = Z
X3 = h(X5, X6, X7)
X4 = f(X8)
X5 = Y
X6 = a(X7, X8)
X7 = K
X8 = C
X9 = b(X5)

But I am not sure, starting at X4 I got confused, should I have assigned the h inner values first?


回答1:


You have the order the wrong way around: You are building terms before you have built their arguments. The text says to build the arguments before you build the outer terms. For example, you must build a(K, C) before you can build h(..., a(K, C), ...), and you must build that before you can build p(..., h(..., a(K, C), ...), ...). Here is one legal order:

X7 = K
X8 = C
X6 = a(X7, X8)
X5 = Y
X9 = b(X5)
X2 = Z
X3 = h(X5, X6, X7)
X4 = f(X8)
X1 = p(X2, X3, X4)


来源:https://stackoverflow.com/questions/64814365/flattened-form-in-wam

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!