interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / core / hive-not-swarm / main.om

87 lines · 1989 bytes Raw Blame History
1note core/hive-not-swarm/main.om: deterministic Hive-vs-Swarm experiment comparison CLI.
2note Compose: si/directives/om2.om core/hive-not-swarm/lib.om core/hive-not-swarm/main.om
3
4text tm_banner "=== HIVE, NOT SWARM: EXACT CONCURRENCY MODEL ===\n"
5text tm_grid_h "\n[Base Model Grid n=1..16]\n"
6text tm_sc_h "\n[Upstream Reference Scenarios]\n"
7text tm_inv_h "\n[Algebraic Invariants]\n"
8text tm_inv_ok "discrete_difference=PASS (15/15) convexity=PASS (14/14)\n"
9text tm_inv_fail "invariants=FAIL\n"
10text tm_s_base "base"
11text tm_s_h10 "H10"
12text tm_s_p002 "p002"
13text tm_s_p4 "P4"
14text tm_s_c06 "c06"
15text tm_s_a30 "A30"
16text tm_s_a240 "A240H10"
17
18fn main to int
19hns_ob_reset
20hns_ob_str tm_banner
21hns_ob_str tm_grid_h
22hns_ob_flush
23
24m = new HiveModel 0 1 0 1 0 1 0 1 0 1 0 1
25lim = new HiveLimits 0 1 0 1 0 1 1
26hive_base_params edit m edit lim
27hive_print_grid view m view lim
28
29hns_ob_reset
30hns_ob_str tm_sc_h
31hns_ob_flush
32hive_print_scenario tm_s_base view m view lim
33
34hive_base_params edit m edit lim
35put lim hnum 10
36put lim hden 1
37hive_print_scenario tm_s_h10 view m view lim
38
39hive_base_params edit m edit lim
40put lim pnum 1
41put lim pden 50
42hive_print_scenario tm_s_p002 view m view lim
43
44hive_base_params edit m edit lim
45put lim maxp 4
46hive_print_scenario tm_s_p4 view m view lim
47
48hive_base_params edit m edit lim
49put m cnum 3
50put m cden 5
51hive_print_scenario tm_s_c06 view m view lim
52
53hive_base_params edit m edit lim
54put m anum 30
55put m aden 1
56hive_print_scenario tm_s_a30 view m view lim
57
58hive_base_params edit m edit lim
59put m anum 240
60put m aden 1
61put lim hnum 10
62put lim hden 1
63hive_print_scenario tm_s_a240 view m view lim
64
65hive_base_params edit m edit lim
66inv_ok = true
67for i ulong 15
68if not hive_discrete_diff_ok view m view lim add i 1
69inv_ok = false
70end
71end
72for j ulong 14
73if not hive_convexity_ok view m view lim add j 1
74inv_ok = false
75end
76end
77hns_ob_reset
78hns_ob_str tm_inv_h
79if inv_ok
80hns_ob_str tm_inv_ok
81hns_ob_flush
82ret 0
83end
84hns_ob_str tm_inv_fail
85hns_ob_flush
86ret 1
87end