summaryrefslogtreecommitdiff
path: root/starts/meaning-vm/level1.cpp
blob: d6896b35b5083765300b346b0e89d3f68244d8e2 (plain)
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
#include "level-1/level-1.hpp"

#include <iostream>

using namespace intellect::level1;
using namespace intellect::level1::concepts;

int main()
{
	decls(make, linked, habit);
	decls(needs, assumes, makes);
	decls(not, topic);
	decls(A, B, C);
	decls(source, type, target);

	(make-linked).set(is, habit);
	(make-linked).set(needs, []() -> ref {
			decls(structure, function, argument, position);
			decls(variable, A, B, C, provide);

			ref ret = a(structure);
			ret.link(is, function-argument);
			ret.set(argument-position, ref(1)),
			ret.set(a(variable, A), provide);
			ret.set(a(variable, B), provide);
			ret.set(a(variable, C), provide);
			return ret;
	}());
	movetoname(a(link), A-B-C-linked).set(link-source, A);
	(A-B-C-linked).set(link-type, B);
	(A-B-C-linked).set(link-target, C);
	a(not, not-A-B-C-linked).set(topic, A-B-C-linked);
	(make-linked).set(assumes, not-A-B-C-linked);
	(make-linked).set(makes, A-B-C-linked);

	std::cout << (make-linked).dump("dumped", true) << std::endl;

	return 0;
}