Artificial Intelligence Programming Lab(AIPLab) 討論區

Please login or register.

請輸入帳號, 密碼以及預計登入時間

新聞:

[開學]106學年第1學期的課程看版開張了 歡迎同學問問題-20170917

作者 主題: [期末報告]-第二類Special Compiler 學號95441003  (閱讀 26615 次)

95441003

  • Newbie
  • *
  • 文章: 1
    • 檢視個人資料
[期末報告]-第二類Special Compiler 學號95441003
« 於: 一月 07, 2009, 01:24:13 am »
資工3A  95441003  王曉薇


第二類Special Compiler特殊編譯器



Trans compiler

TRANS is a language for writing compiler
transformations. Transformations in TRANS are applied to the
control flow graph of a program. A transformation is TRANS is
made up of two parts: a rewrites and a side condition.

The rewrite describes how the transformation should modify the
control flow graph of the program. A rewrite may modify or
replace the instrucion at a node, add or replace edges in the
graph or combinations of these.

The side condition is a CTL formula which describes where in the
graph a transformation can be applied by pattern matching
instructions at nodes, or matching properties of the control flow
graph.

The original version of TRANS, which was presented by David
Lacey in his PhD thesis matched programs written in L0, a
simple imperative language which contains only assignments, if
statements, goto statements and return statements. Nodes of
the flow graph also only contained a single instruction.

Have extended TRANS to represent each node in the CFG as a basic
block, i.e. a sequence of instructions where has one entry point,
one exit point and no branch instructions inbetween.

This format more closely resembles how the control flow graph is
represented within a compiler. It also makes the implementation
more efficient as we can store all the variables used and defined
at a node in a list instead of having to check every time we look
at a node.

Have also extended L0 and TRANS to support arrays as scientific
applications make heavy use loops and arrays.

Have also added features in TRANS to perform loop dependence
analysis.

There is a dependence between two itertions of a loop if an
element of an array is read in one of the iterations and written in
another.

We can only parallelize iterations of loops where it is impossible for
there to be a dependence, due to the non-deterministic order of
execution.

In the previous example, if we formulate and solve the linear
equation i' = i + k, then we see that there are dependencies
between iterations (1,k), (2,k+1) etc, so we can do at most k
iterations in parallel.

It becomes much more difficult to forumalte and solve these
equations quicky when given nested loops and more complex
epressions.

Have added support to TRANS for determining dependencies where
the expression involves at most one loop indexing variable.

參考資料 http://www2.warwick.ac.uk/fac/sci/dcs/research/pgportal/wpccs08/schedule/rquill.pdf 



##########加分題##########

Prolog

Prolog的意思是「使用邏輯去編寫程序」(programming in logic)。Prolog 是一種邏輯程序語言,用這種語言編寫的程序包含事實和規則,這些事實和規則組成一個知識數據庫。使用者執行這些程序的方法是在 Prolog 解釋程序中提交查詢,然後使用者就可以得到根據那些事實和規則求出的答案。

Prolog 被廣泛用於人工智能(AI)方面。

我們可以使用一個文本編輯器(例如「記事本」或 MS-DOS 編輯器)去編寫 Prolog 程序。


參考資料 http://www.puiching.edu.hk/~wtchung/trace/Prolog/index_c.htm
« 最後編輯時間: 一月 12, 2009, 12:09:18 am 由 95441003 »
已記錄

admin

  • 管理員
  • Hero Member
  • *****
  • 文章: 1897
    • 檢視個人資料
回覆: [期末報告]-第二類Special Compiler 學號95441003
« 回覆文章 #1 於: 一月 15, 2009, 02:24:39 pm »
不符合報告要求, 12
已記錄
 

SimplePortal Classic 2.0.5