编写程序的专家系统?
,开发一个高级软件来操作矩阵代数方程,确切地说是张量操作,使用维度大小、系统上的可用内存等多个标准来生成优化的 C++ 代码。
我正在集思广益 张量收缩引擎 TCE 的精神,但专门面向生成优化而不是通用代码。 所需的最终结果是在我的领域中擅长生成并行程序的软件。
- 这种开发属于专家系统的范畴吗?
- 考虑到限制,还有哪些其他项目在同一领域工作以生成代码?
I am brainstorming an idea of developing a high level software to manipulate matrix algebra equations, tensor manipulations to be exact, to produce optimized C++ code using several criteria such as sizes of dimensions, available memory on the system, etc.
Something which is similar in spirit to tensor contraction engine, TCE, but specifically oriented towards producing optimized rather than general code.
The end result desired is software which is expert in producing parallel program in my domain.
- Does this sort of development fall on the category of expert systems?
- What other projects out there work in the same area of producing code given the constraints?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您所描述的更像是特定于领域的语言。
What you are describing is more like a Domain-Specific Language.
http://en.wikipedia.org/wiki/Domain-specific_language
它不会被称为专家系统,至少不是传统意义上的专家系统。
专家系统是基于规则的推理引擎,所涉及的专业知识被清楚地封装在规则中。您建议的系统虽然可能将有关问题域本质的见解封装在某种线性代数模型中,但它更像是一个黑匣子,而不是专家系统。专家系统的特征之一是它们可以对其推理产生“解释”,这种特征之所以成为可能,部分原因是知识表示虽然形式化,但仍接近于自然语言中的简单陈述;矩阵及其运算虽然可能是基于对现实的类似观察而得出的,但透明度要低得多...
从问题的描述中不清楚您提出的系统是否会优化现有代码(可能在有限的领域),或者如果它会产生优化的代码,在这种情况下驱动湾一些外部目标/功能......
It wouldn't be called an expert system, at least not in the traditional sense of this concept.
Expert systems are rule-based inference engines, whereby the expertise in question is clearly encapsulated in the rules. The system you suggest, while possibly encapsulating insight about the nature of the problem domain inside a linear algebra model of sorts, would act more as a black box than an expert system. One of the characteristics of expert systems is that they can produce an "explanation" of their reasoning, and such a feature is possible in part because the knowledge representation, while formalized, remains close to simple statements in a natural language; matrices and operations on them, while possibly being derived upon similar observation of reality, are a lot less transparent...
It is unclear from the description in the question if the system you propose would optimize existing code (possibly in a limited domain), or if it would produced optimized code, in that case driven bay some external goal/function...
油井生产系统(规则系统)是四种通用计算方法之一(图灵机、丘奇递归函数、后生产系统和马尔可夫算法[以及其他几种已添加到该列表中]),它们或多或少具有以下各自的实现:命令式编程、函数式编程、基于规则的编程——据我所知,马尔可夫算法没有独立的实现。这些都是图灵等价的。
因此,基于规则的编程可以用来编写任何东西。此外,早期的数学/符号操作程序通常使用基于规则的编程,直到问题得到充分理解为止(随后该方法更改为命令式或约束编程 - 请参阅 MACSYMA - 嗯 MACSYMA 是用 Lisp 编写的,所以也许我有一个不同的程序或者也许他们最初为此在 Lisp 中实现了一个规则系统)。
您可以轻松编写规则系统来执行矩阵操作。您可以根据逻辑支持进行跟踪,以记录促成解决方案的实际触发规则(某些触发的规则可能不会直接促成解决方案)。然后,对于每条规则,您都有一个到一组 C++ 指令的映射(这些指令不必是“完整的”——它们更像是半可执行的要求),这些指令作为中间语言输出。然后由解析器读取,将其链接到所需的输入数据和所需的任何类型的修复。您可能会发现生成功能代码更容易 - 一方面,修复后您可以更轻松地优化功能源中的输出代码。
话虽如此,其他贡献者已经概述了一种特定于领域的语言方法,TED 人员也这样做了(我的建议是,这也只是使用规则)。
Well production systems (rule systems) are one of four general approaches to computation (Turing machines, Church recursive functions, Post production systems and Markov algorithms [and several more have been added to that list]) which more or less have these respective realizations: imperative programming, functional programming, rule based programming - as far as I know Markov algorithms don't have an independent implementation. These are all Turing equivalent.
So rule based programming can be used to write anything at all. Also early mathematical/symbolic manipulation programs did generally use rule based programming until the problem was sufficiently well understood (whereupon the approach was changed to imperative or constraint programming - see MACSYMA - hmmm MACSYMA was written in Lisp so perhaps I have a different program in mind or perhaps they originally implemented a rule system in Lisp for this).
You could easily write a rule system to perform the matrix manipulations. You could keep a trace depending on logical support to record the actual rules fired that contributed to a solution (some rules that fire might not contribute directly to a solution afterall). Then for every rule you have a mapping to a set of C++ instructions (these don't have to be "complete" - they sort of act more like a semi-executable requirement) which are output as an intermediate language. Then that is read by a parser to link it to the required input data and any kind of fix up needed. You might find it easier to generate functional code - for one thing after the fix up you could more easily optimize the output code in functional source.
Having said that, other contributors have outlined a domain specific language approach and that is what the TED people did too (my suggestion is that too just using rules).