• Title/Summary/Keyword: STGM

Search Result 5, Processing Time 0.017 seconds

Compiling Lazy Functional Programs to Java on the basis of Spineless Taxless G-Machine with Eval-Apply Model (Eval-Apply 모델의 STGM에 기반하여 지연 계산 함수형 프로그램을 자바로 컴파일하는 기법)

  • Nam, Byeong-Gyu;Choi, Kwang-Hoon;Han, Tai-Sook
    • Journal of KIISE:Software and Applications
    • /
    • v.29 no.5
    • /
    • pp.326-335
    • /
    • 2002
  • Recently there have been a number of researches to provide code mobility to lazy functional language (LFL) programs by translating LFL programs to Java programs. These approaches are basically baled on architectural similarities between abstract machines of LFLs and Java. The abstract machines of LFLs and Java programming language, Spineless Tagless G-Machine(STGM) and Java Virtual Machine(JVM) respectively, share important common features such as built- in garbage collector and stack machine architecture. Thus, we can provide code mobility to LFLs by translating LFLs to Java utilizing these common features. In this paper, we propose a new translation scheme which fully utilizes architectural common features between STGM and JVM. By redefining STGM as an eval-apply evaluation model, we have defined a new translation scheme which utilizes Java Virtual Machine Stack for function evaluation and totally eliminates stack simulation which causes array manipulation overhead in Java. Benchmark program translated to Java programs by our translation scheme run faster on JDK 1.3 than those translated by the previous schemes.

Design and Implementation of a Lazy Functinal Language Compiler for Java Virtual Machine (자바가상기계를 대상으로 하는 지연계산기반 함수형 언어 컴파일러의 설계 및 구현)

  • 최광훈;임현일;한태숙
    • Proceedings of the Korean Information Science Society Conference
    • /
    • 2000.10a
    • /
    • pp.326-328
    • /
    • 2000
  • 본 논문에서는 지연계산기반 함수형 언어 프로그램을 받아 Java 프로그램을 목적 코드로 생성하는 컴파일러를 설계하고 구현한다. 이 컴파일러는 제한된 형태의 함수형 언어 Shared Term Graph(STG)를 입력언어로 하는 추상기계 Spineless Tagiess G-Machine (STGM)을 수행 모델로 한다. 본 논문에서는 명령형 언어 L-code를 제안하고 이를 입력언어로 하는 새로운 형태의 STGM인 L-Machine을 제안한다. STG 언어를 L-code로 변환하는 컴파일러와 L-code를 Java로 변환하는 컴파일러를 설계하고 구현함으로써 원하는 컴파일러를 구성한다. 그리고 Glasgow Haskell 컴파일러를 전단부로 하여 지연계산 기반 함수형 언어 Haskell로 작성된 프로그램들을 컴파일하여 STG 프로그램으로 변환한 다음 본 논문에서 구현한 컴파일러로 이를 Java 프로그램으로 변환한다. 변환된 Java 프로그램을 Sun JIT 컴파일러로 컴파일하여 수행한 성능 평가 결과를 제시한다.

  • PDF

Compiling Haskell to Java via an Intermediate Code L (중간언어 L-코드를 이용한 Haskell-Java 언어 번역기 구현)

  • Choi, Kwang-Hoon;Han, Tai-Sook
    • Journal of KIISE:Software and Applications
    • /
    • v.28 no.12
    • /
    • pp.955-965
    • /
    • 2001
  • We propose a systematic method of compiling Haskell based on the spineless Tagless G-machine (STGM) for the Java, Virtual Machine (JVM) We introduce an intermediate language called L-code to identify each micro-operation of the machine by its instruction, Each macro operation of the machine is identified by a binding Each instruction of the L-code can be easily translated into Java statements. After our determination on representation and L-code program from a STG program is translated into Java program according to out compilation rules. Our experiment shows that the execution times of translated benchmarks are competitive compared with those in Haskell interpreter Hugs, particularly when Glasgow Haskell compiler's STG -level optimizations are applied.

  • PDF

Numerical Test for the 2D Q Tomography Inversion Based on the Stochastic Ground-motion Model (추계학적 지진동모델에 기반한 2D Q 토모그래피 수치모델 역산)

  • Yun, Kwan-Hee;Suh, Jung-Hee
    • Geophysics and Geophysical Exploration
    • /
    • v.10 no.3
    • /
    • pp.191-202
    • /
    • 2007
  • To identify the detailed attenuation structure in the southern Korean Peninsula, a numerical test was conducted for the Q tomography inversion to be applied to the accumulated dataset until 2005. In particular, the stochastic pointsource ground-motion model (STGM model; Boore, 2003) was adopted for the 2D Q tomography inversion for direct application to simulating the strong ground-motion. Simultaneous inversion of the STGM model parameters with a regional single Q model was performed to evaluate the source and site effects which were necessary to generate an artificial dataset for the numerical test. The artificial dataset consists of simulated Fourier spectra that resemble the real data in the magnitude-distance-frequency-error distribution except replacement of the regional single Q model with a checkerboard type of high and low values of laterally varying Q models. The total number of Q blocks used for the checkerboard test was 75 (grid size of $35{\times}44km^2$ for Q blocks); Q functional form of $Q_0f^{\eta}$ ($Q_0$=100 or 500, 0.0 < ${\eta}$ < 1.0) was assigned to each Q block for the checkerboard test. The checkerboard test has been implemented in three steps. At the first step, the initial values of Q-values for 75 blocks were estimated. At the second step, the site amplification function was estimated by using the initial guess of A(f) which is the mean site amplification functions (Yun and Suh, 2007) for the site class. The last step is to invert the tomographic Q-values of 75 blocks based on the results of the first and second steps. As a result of the checkerboard test, it was demonstrated that Q-values could be robustly estimated by using the 2D Q tomography inversion method even in the presence of perturbed source and site effects from the true input model.

Classification of Seismic Stations Based on the Simultaneous Inversion Result of the Ground-motion Model Parameters (지진동모델 파라미터 동시역산을 이용한 지진관측소 분류)

  • Yun, Kwan-Hee;Suh, Jung-Hee
    • Geophysics and Geophysical Exploration
    • /
    • v.10 no.3
    • /
    • pp.183-190
    • /
    • 2007
  • The site effects of seismic stations were evaluated by conducting a simultaneous inversion of the stochastic point-source ground-motion model (STGM model; Boore, 2003) parameters based on the accumulated dataset of horizontal shear-wave Fourier spectra. A model parameter $K_0$ and frequency-dependent site amplification function A(f) were used to express the site effects. Once after a H/V ratio of the Fourier spectra was used as an initial estimate of A(f) for the inversion, the final A(f) which is considered to be the result of combined effect of the crustal amplification and loca lsite effects was calculated by averaging the log residuals at the site from the inversion and adding the mean log residual to the H/V ratio. The seismic stations were classified into five classes according to $logA_{1-10}^{max}$(f), the maximum level of the site amplification function in the range of 1 Hz < f < 10 Hz, i.e., A: $logA_{1-10}^{max}$(f) < 0.2, B: 0.2 $\leq$ $logA_{1-10}^{max}$(f) < 0.4, C: 0.4 $\leq$ $logA_{1-10}^{max}$(f) < 0.6, D: 0.6 $\leq$ $logA_{1-10}^{max}$(f) < 0.8, E: 0.8 $\leq$ $logA_{1-10}^{max}$(f). Implication of the classified result was supported by observing a shift of the dominant frequency of average A(f) for each classified stations as the class changes. Change of site classes after moving seismic stations to a better site condition was successfully described by the result of the station classification. In addition, the observed PGA (Peak Ground Acceleration)-values for two recent moderate earthquakes were well classified according to the proposed station classes.