具有三变量辅助函数的指数递归 ML 函数
我需要帮助弄清楚我需要递归地为辅助函数做什么,我有点迷失了我需要为辅助函数做什么。
这是问题和示例输入。
以下是辅助函数的示例
这是我到目前为止所写的内容
I need help figuring out what I need to do for the helper function recursively, I am kinda lost of in what I need to do for the helper function.
Here is the question and the example input.
Here is the example of what the helper function does
This is what I have written so far
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您只需稍微更改一下符号即可找到解决方案。
不要写 a*bn,而是写
exp3(a, b, n)
。然后这个例子说,
你实际上已经得到了解决方案——文本字面意思是“引理 4.15 提供了一个基本情况,引理 4.16 提供了一个递归情况”。
引理 4.15:
引理 4.16:
并且需要帮助的函数应该只有一种情况;示例中显示的第一个“步骤”:
You only need to change the notation slightly to find the solution.
Instead of a*bn, write
exp3(a, b, n)
.Then the example says,
And you have actually been given the solution – the text literally says "Lemma 4.15 provides a base case, Lemma 4.16 a recursive case".
Lemma 4.15:
Lemma 4.16:
And the function that needs help should only have one case; the first "step" shown in the example: