• 検索結果がありません。

Japan Advanced Institute of Science and Technology

N/A
N/A
Protected

Academic year: 2021

シェア "Japan Advanced Institute of Science and Technology"

Copied!
3
0
0

読み込み中.... (全文を見る)

全文

(1)

Japan Advanced Institute of Science and Technology

JAIST Repository

https://dspace.jaist.ac.jp/

Title

逐次型戦略に基づくTRSコンパイラの構築

Author(s)

関, 康夫

Citation

Issue Date

1997‑03

Type

Thesis or Dissertation

Text version

author

URL

http://hdl.handle.net/10119/1072

Rights

Description

Supervisor:酒井 正彦, 情報科学研究科, 修士

(2)

Yasuo Seki

Scho ol of Information Science,

Japan Advanced Institute of Science and Technology

February 14, 1997

Keywords: term rewriting systems

functionallanguage

compiler

normalizing strategy.

Recently, practical systems, Elan, Sml-NJ, Gofer, OBJ and so on, of functional lan-

guageshavebeendeveloped. These systemshavespecialfeatures,i.e., delaiedevaluation,

higher-order functions, polymorphic type, etc. Other than these systems, there is a sim-

ple system, Cdimple, which generates programs written in procedural language C that

execute TRS eciently. Programs generated by Cdimple reduce terms givenby user, in

innermost strategy and outputs terms (normal form) having noreduces. Cdimple allows

user denedC program together with input TRS. If is not garanteed that it caluculates

the normalformeveniftheinput termhasa normalform, becauseofinnermost strategy.

Thispapertries ecientimplementationofTermRewritingSystems(TRS)byimproving

Cdimple based onnormalizing strategy.

In a class called Orthogonal, a term having normal form can be reduced to normal

form by rewriting the position called index. G. Huet and J.-J. Le'vy have intro duced

a class of strong sequentiality (SS) that is subclass of orthogonal. They also show an

automaton for searching for index of a given term. Althorgh an index of a given term t

can be found eciently by this artomaton, we always have to go back to root position

of t after reductions. It is inecient in case that repeatedly reducation are needed. Tus

Copyrightc 1997byYasuoSeki

(3)

continuesearching index withoutgoing back to the root p osition.

In this paper, we construct a TRS compiler that generate C program by unfolding

FB index automaton into Cprocedures. Termsare represented as dag structure. Hence,

redices are not duplicated by copying rules. Gabage collection is implemented by using

reference counter. Since garbage collections are taken plase in real time, there is a little

problem of overheadinoperating onreference counters.

We compare our TRS-compilerwith other systems (Cdimple, Elan compiler, Sml-NJ

compiler, Gofercompiler).(See gure)

Cdimple, Elan compiler and Sml-NJ compiler adapt innermost reduction strategy.

Gofer is based on leftmost outermost strategy. For some TRS's (factorial, bonatch,

naive reverse), our compiler generates several times slower code than systems based on

innermost strategy. Our compiler pro ducea little fasterprogram thanGofer.

Forquicksort, our compilertakesmuchfasterthan Cdimple andElan, Sml-NJ.How-

ever,ours isalmost program that same speed as Gofer's. for the last TRS, the programs

generated byour compiler get the answer,while others, are not terminate.

Table 1: results

OurCompiler Cdimple Elan SML-NJ Gofer

fact 8 586ms 456ms 74ms 290ms 684ms

b20 509ms 478ms 113ms 120ms 722ms

naive reverse 1000 7712ms 9760ms 566ms 1230ms 9132ms

quiq sort 20

a

0ms 14086ms 2912ms 1850ms 2 ms

quiq sort 1000 543ms

b

|

c

4

c

4 518ms

fbexamp

a

0ms

d

1

d

1

d

1 d

1

a

0<1ms

b

memoryerror

c

longtime<1,terminate

d

nonterminate

Table 1: results

参照

関連したドキュメント

(1.4) The above-mentioned propositions strengthen the earlier results on pe- riodic solutions of systems of ordinary differential equations and functional differential equations

In [6] we considered some nonlinear elliptic functional differential equations where we proved theorems on the number of weak solutions of boundary value problems for such equations

The evolution of chaotic behavior regions of the oscillators with hysteresis is presented in various control parameter spaces: in the damping coefficient—amplitude and

In the proofs we follow the technique developed by Mitidieri and Pohozaev in [6, 7], which allows to prove the nonexistence of not necessarily positive solutions avoiding the use of

Keywords and Phrases: number of limit cycles, generalized Li´enard systems, Dulac-Cherkas functions, systems of linear differential and algebraic equations1. 2001 Mathematical

Our main theorem suggests a sharp distinction between λla and the polytime functional systems based on safe recursion [13, 11, 7], because normalization in the latter systems is at

Our objective in Section 4 is to extend, several results on curvature of a contractive tuple by Popescu [19, 20], for completely contractive, covari- ant representations of

We study several choice principles for systems of finite character and prove their equivalence to the Prime Ideal Theorem in ZF set theory without Axiom of Choice, among them