Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /archive/0.93/doc/examples/SK.sml
ViewVC logotype

View of /archive/0.93/doc/examples/SK.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4958 - (download) (annotate)
Wed Apr 10 01:33:29 2019 UTC (3 months, 1 week ago) by dbm
File size: 418 byte(s)
adding 0.93 src and doc to archive
(* ----- An Interpreter for Call-by-Value SK-calculus ----- *)

datatype Term = S | K | appl of Term * Term;

fun Eval(appl(a,b)) = Apply(appl(Eval a,Eval b)) |
    Eval a = a

and Apply(appl(appl(K,a),b)) = a |
    Apply(appl(appl(appl(S,a),b),c)) = Eval(appl(appl(a,c),appl(b,c))) |
    Apply a = a;

infix *;
fun f * g = appl(f,g);      (* abbreviation for application *)

val I = Eval(S * K *  K);   (* I a = a *)

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0