Better HN
topnewbestaskshowjobs
Log inSign up

h_sakurai

7 karma · joined Apr 30, 2022 (4y ago) · 3 submissions

Submissions

comment 4y ago · link · parent

I write Prolog version bulletML in Prolog.

https://github.com/hsk/bulletpl/blob/master/bulletpl/1943_ro...

It is a movement of the rolling fire of CAPCOM shooting game 1943.

Original Bullet ML DSL is XML base, however this version base Edinburgh Prolog format.

http://www.asahi-net.or.jp/~cs8k-cyu/bulletml/index_e.html

comment 4y ago · link · parent

https://github.com/hsk/simpletapl/blob/master/prolog5/fullup...

I have rewritten all TAPL code in Prolog. It was very interesting.

https://github.com/mitsuchi/copl-in-prolog/

This is another textbook "Concept of Programming Language" implementations.

https://www.fos.kuis.kyoto-u.ac.jp/~igarashi/CoPL/

comment 4y ago · link · parent

eval(I,I):-integer(I).

eval(E1+E2,I):- eval(E1,I1),eval(E2,I2), I is I1+I2.

eval(E1E2,I):- eval(E1,I1),eval(E2,I2), I is I1I2.

:- eval(12+34,R),writeln(R),R=14.

:- halt.

Very simple Operational Semantics.

this mean

syntax

e ::= i | e+e | e * e

evaluation rule

-------------- (E-Int)

i1-->i1

e1-->i1 e2-->i2

i is i1+i2

------------------- (E-Plus)

e1+e2 --> i

e1-->i1 e2-->i2

i is i1i2

------------------- (E-Times)

e1*e2 --> i