-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
97 lines (79 loc) · 3.82 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html lang="en">
<head>
<title>Lambda Calculus Interpreter</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- JQuery CSS -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/2.31.1/css/jquery.terminal.min.css" rel="stylesheet"/>
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<!-- Internal CSS -->
<link rel="stylesheet" href="index.css"/>
</head>
<body>
<div class="contents">
<!-- Lambda Calculus Interpreter -->
<div class="col-md-8 quarter left justify-content-center" style="background-color:#B3B3B3;">
<div class="container m-0 p-0">
<div class="title" id="lambdatitle">LAMBDA CALCULUS INTERPRETER [VERSION 1.0]</div>
<div id="terminal"></div>
</div>
</div>
<!-- Lambda Calculus Description -->
<div class="col-md-4 quarter right" style="background-color:#B3B3B3;">
<div class="container p-3 overflow-hidden">
<h2>Lambda Calculus Interpreter</h2>
<p>
<b>Lambda Calculus</b> (also written as <b>λ-calculus</b>) is a formal system in mathematical logic for expressing computation based on function abstraction and application using variable binding and substitution. Introduced by Alonzo Church in the 1930s, it is a universal model of computation that can be used to simulate any Turing machine.
<br><br>
The system has applications in many different areas in mathematics, philosophy, linguistics, computer science, and it has played an important role in the development of the theory of programming languages as well as functional programming languages.
</p>
<h2>Examples</h2>
<p>
Here are several input examples for the interpreter:<br>
<code>(\x.x)(\y.y)(\z.z)</code><br>
<code>(\x.x)y</code><br>
<code>(\x.(\y.xy))y</code><br>
<code>(λvw.v)xy</code><br>
<code>I(\x.x)</code><br>
<code>SKI(KIS)</code><br><br>
The full documentation for the code can be found <a href="https://github.com/NunoAGoncalves/Lambda-Calculus-Interpreter" style="color: crimson;">here</a>.<br>
The link to the original Wikipedia article can be found <a href="https://en.wikipedia.org/wiki/Lambda_calculus" style="color: crimson;">here</a>.
</p>
</div>
</div>
</div>
<!-- JQuery Terminal JS -->
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://unpkg.com/jquery.terminal@2.x.x/js/jquery.terminal.min.js"></script>
<!-- Lambda Calculus Interpreter JS -->
<script src="main.js"></script>
<script>
var terminal = $('#terminal').terminal(
function(command) {
switch(command) {
default:
this.echo('[[;teal;black]> ' + stringify(interpret(command)) + ']');
break;
case 'help':
this.echo('[[;teal;black]COMMANDS:\nhelp\nclear\nclear-history\n\nLAMBDA CALCULUS SYNTAX:\nterm ------- variable | abstraction | application\nvariable ------- IDENTIFIER\nIDENTIFIER ------- a-zA-Z \nabstraction -------\n\nSTANDARD TERMS:\nI ------- (λx.x)\nS ------- (λx.λy.λz.xz(yz))\nK ------- (λx.λy.x)\nB ------- (λx.λy.λz.x(yz))\nC ------- (λx.λy.λz.xzy)\nW ------- (λx.λy.xyy)]');
break;
case 'clear-history':
this.clear_history_state();
break;
}
},
{
greetings: '',
name: 'Lambda Calculus Interpreter',
});
terminal_print = function(str, bool=true) {
terminal.echo('[[;teal;black]' + str + ']', {newline: bool});
};
</script>
<!-- Bootstrap Bundle with Popper JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
</body>
</html>