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 / seed / profile / README.md

94 lines · 6916 bytes Raw Blame History Source

seed/profile: critical source profile (DRA-419)

profile.om is a seeded-Omega checker that applies an adaptation of Holzmann's Power of Ten to a unit of .om sources. It runs from the repository root, because it reads the host words from seed/effects/effects.om. Compile the checked unit with the pinned omc too. This tool is a token-level profile, not a parser or a typechecker.

profile [bounds] [SOURCE ...]     (no SOURCE: read the unit from stdin)

The sources are concatenated in the order given. Line numbers refer to that concatenation.

exitstdoutmeaning
0PROFILE-PASSevery rule holds
1PROFILE-REFUSED:<rule>:<line>first violation
2(usage on stderr)more than 16 arguments, or an unreadable argument
3PROFILE-INVALIDa capacity was exceeded, the unit has no function, or fn/end are unbalanced
4I/O error, or a SOURCE cannot be opened

Capacities, all fail-closed (exit 3): at most 65535 input bytes, 4095 lines, 16383 tokens, 63 bytes per token, 128 functions and 128 host words. Every loop in the checker is bounded, and its storage is static globals only.

Rules

idrule
B1while needs bound N. A for count must be a literal, a const, len X of a declared array, or carry bound N. N must be at most 8192.
B2Recursion is admitted only in qualified form. Every function on a cycle takes depth as its first parameter, never assigns it and has no new. Each in-cycle call passes depth unchanged, or passes NAME after the canonical guard NAME = add depth 1 / if gt NAME LIM (LIM at most 64) / an optional call to a unit function / ret, exit or trap / end, with no reassignment of NAME before the call. The stop must close the guard's then-block: an else or any other structural line in the guard is refused. The assignment and the call must be in the same block instance. No line between them may leave that block or start its else arm; equal nesting depth alone does not count. An entry from outside the cycle passes a literal or a const of at most 64. The omc/DRA-311 leaf-removal analysis then runs over the remaining edges, and any surviving node is refused.
B3Each global and each new is at most 65536 elements. All globals together are at most 65536 bytes. The new bytes per function, and across the whole unit, are each at most 65536.
E1The result of a call or host word assigned to a name must be read on the straight-line continuation before the name is reassigned or the function returns. The exemption is note p10 allow E1 <reason> on the line before.
X1Host words (the effects table) appear only in functions marked note p10 effect on the line before fn.
P1A function marked note p10 pure contains no put and calls only pure functions.
C1requires, ensures and invariant need an earlier om2 line. om2 release is refused, because it compiles contracts out.

bounds mode checks B1, B2, B3, P1 and C1. It skips E1 and X1 for units that carry no p10 annotations, such as seed/omc/tests/recursion/nest.om.

Assignments are recognised in both spellings that the pinned omc accepts (s_name/s_assign, name [=] value). One classifier serves B2, B3 and E1: a line assigns when its second token is =, or when its first token is not a statement keyword, a unit function or a host word. omc refuses a parameter, global or local named like a function (error 10) or a host word (error 16), so a leading function or host-word name is always a call. So nd sub nd 1 after a guard, depth ulong 0, a b new T N frame allocation and an r f 2 overwrite are checked like their = forms. The canonical B2 guard itself must still be spelled NAME = add depth 1; NAME add depth 1 is refused.

Profiled modules

seed/authority/action.om, store.om and lock.om are profiled as one unit together with dispatch.om, which is their consumer. The fixes this profile forced are as follows.

Limits (what is not proved)

Checks

seed/profile/check.om is the driver, in seeded Omega. Build it with the pinned omc and run it from the repository root:

mkdir -p build/seed && seed/out/omc < seed/profile/check.om > build/seed/profile-check
chmod +x build/seed/profile-check && build/seed/profile-check

It exits 0 (PROFILE CHECK PASS), 1 (PROFILE CHECK FAIL failed=N) or 3 (NOT_RUN: no seed/out/omc, or its sha256 is not OMC_PIN). It runs these checks:

.github/workflows/om-profile-arm64.yml runs the checks on pull requests, on pushes to main, and weekly.