git.iko.soy/rowtype-yoga/psfp
on 4669fb5 help sign in
74 lines 2.0 kB history raw
1// Generated by purs version 0.13.6
2"use strict";
3var $foreign = require("./foreign.js");
4var HeytingAlgebra = function (conj, disj, ff, implies, not, tt) {
5 this.conj = conj;
6 this.disj = disj;
7 this.ff = ff;
8 this.implies = implies;
9 this.not = not;
10 this.tt = tt;
11};
12var tt = function (dict) {
13 return dict.tt;
14};
15var not = function (dict) {
16 return dict.not;
17};
18var implies = function (dict) {
19 return dict.implies;
20};
21var ff = function (dict) {
22 return dict.ff;
23};
24var disj = function (dict) {
25 return dict.disj;
26};
27var heytingAlgebraBoolean = new HeytingAlgebra($foreign.boolConj, $foreign.boolDisj, false, function (a) {
28 return function (b) {
29 return disj(heytingAlgebraBoolean)(not(heytingAlgebraBoolean)(a))(b);
30 };
31}, $foreign.boolNot, true);
32var conj = function (dict) {
33 return dict.conj;
34};
35var heytingAlgebraFunction = function (dictHeytingAlgebra) {
36 return new HeytingAlgebra(function (f) {
37 return function (g) {
38 return function (a) {
39 return conj(dictHeytingAlgebra)(f(a))(g(a));
40 };
41 };
42 }, function (f) {
43 return function (g) {
44 return function (a) {
45 return disj(dictHeytingAlgebra)(f(a))(g(a));
46 };
47 };
48 }, function (v) {
49 return ff(dictHeytingAlgebra);
50 }, function (f) {
51 return function (g) {
52 return function (a) {
53 return implies(dictHeytingAlgebra)(f(a))(g(a));
54 };
55 };
56 }, function (f) {
57 return function (a) {
58 return not(dictHeytingAlgebra)(f(a));
59 };
60 }, function (v) {
61 return tt(dictHeytingAlgebra);
62 });
63};
64module.exports = {
65 HeytingAlgebra: HeytingAlgebra,
66 tt: tt,
67 ff: ff,
68 implies: implies,
69 conj: conj,
70 disj: disj,
71 not: not,
72 heytingAlgebraBoolean: heytingAlgebraBoolean,
73 heytingAlgebraFunction: heytingAlgebraFunction
74};