摘要
数学表达式是现代计算机科学中必不可少的组成部分,数学教学软件中如果缺少数学表达式有效性的判定,将会严重影响软件的运行效率和用户体验。针对此问题提出了一种采用递归方法来判别数学表达式有效性的方法。首先对表达式进行规格化处理,然后遍历数学表达式,进行括号匹配、运算符优先级处理和数学基本初等函数识别,最后进行常量的识别。对其中遇到的问题进行了讨论,并提供了解决方案。该方法已经应用于数学软件、远程教育等应用领域的函数作图中,当用户输入表达式错误时,它能够及时提醒用户输入的错误位置,达到了很好的效果。实验表明:数学表达式的有效性判别可以显著提高教学软件、函数作图的效率,改善用户体验。
Mathematical expression is indispensable in modern computer science, the failure of judging the validity of mathematical expression would bring about the loss of efficiency of instructional software and distance learning. To solve this problem, a novel approach of judging the validity of mathematical expression was proposed. The core idea of approach is to recognize arithmetic symbols, mathematical functions, defined and undefined constants in the recursion method, which reduces the calculation work by decomposing the large problem into multiple small problems. This approach has been applied to the function plotting in the intelligent tutoring system, which can remind the mistakes of input in time and help plot real-time graph of functions. Experiments indicate that efficiency of instructional software and function plotting is significantly increased by the approach.
出处
《计算机应用》
CSCD
北大核心
2015年第A01期335-338,共4页
journal of Computer Applications
基金
国家科技支撑计划项目(2013BAH72B01)
关键词
数学表达式
有效性
递归
运算符优先级
函数
mathematical expression
validity
recursion
operator precedence
function