Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "UOR PrismPM SDK",
"image": "ghcr.io/afflom/prismpm-sdk-patched@sha256:21ac51c7c8027566e52566f3c6cd4c699a5468f422f01907cd2307f9c3e0b352",
"image": "ghcr.io/afflom/prismpm-sdk-patched@sha256:a4dcef3614f6f8934b5993126e20213ce2141104d9e763eb6035c62d9da9bf55",
"containerUser": "root",
"workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind",
"workspaceFolder": "${localWorkspaceFolder}",
Expand Down
2 changes: 1 addition & 1 deletion app/lexlean.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
spec = "lexlean/lock/2"
language = "1.2"
compiler_semantics = "1427f8b629013648a480454d67202788f2303f5396f1d7c70a7c350ddab6f694"
compiler_semantics = "e1b2447a28c98f87a7782a4fd4786044db3fff53fd2a76dbd5e4071fd6a6721d"
project_config_sha256 = "e91d8e06793819869865d65a8ab70e76013204cda42cf20a687d023a085e6ad8"
lean_toolchain = "leanprover/lean4:v4.32.1"

Expand Down
49 changes: 48 additions & 1 deletion app/src/Quality.lex.tex

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions app/src/System.lex.tex
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
name: systemModel,
parameters: [],
result: Production.BrowserSystem::SystemModel,
body: (record Production.BrowserSystem::SystemModel {product := (record Production.Core::Product {id := "uorust", owner := "UOR Foundation", version := "0.3.0", lifecycle := "development", sourcePolicy := "selected LexLean source and kernel proof", supportedPlatforms := (cons "browser" (nil String))}), applicationProfile := (record Production.BrowserSystem::ApplicationProfile {contract := "prismpm/browser-resident-application/1", applicationModelDigest := "sha256:6c3c5cb9c1f9dcd82745e6a53b13f79a64c1066f6558cea48e9fddfee15fa1db", execution := "browser-session", persistentStorage := "none", externalServices := "none", resources := (cons "dom" (cons "webassembly" (nil String))), capabilities := (cons "portable-static-holo-application" (nil String))}), artifacts := (cons (record Production.BrowserSystem::GeneratedArtifact {id := "uorust-application", role := "selected-application", licenseExpression := "MIT OR Apache-2.0"}) (nil Production.BrowserSystem::GeneratedArtifact)), components := (cons (record Production.BrowserSystem::Component {id := "uorust-browser", artifact := "uorust-application", kind := "browser", version := "0.3.0"}) (nil Production.BrowserSystem::Component)), targets := (cons (record Production.BrowserSystem::Target {id := "pages", kind := "github-pages-browser", adapterDigest := "sha256:59df071a35deca05e62224e43b82d7bc9b5c649f989a3424fd704123633a539e", apiVersion := "github-pages-artifact@v4", minimumReleaseStatus := "development"}) (nil Production.BrowserSystem::Target)), controls := (cons "application-acceptance" (cons "artifact-closure" (cons "source-proof" (cons "spdx" (nil String))))), standards := (cons "SPDX-3.0.1" (nil String))})
body: (record Production.BrowserSystem::SystemModel {product := (record Production.Core::Product {id := "uorust", owner := "UOR Foundation", version := "0.3.0", lifecycle := "development", sourcePolicy := "selected LexLean source and kernel proof", supportedPlatforms := (cons "browser" (nil String))}), applicationProfile := (record Production.BrowserSystem::ApplicationProfile {contract := "prismpm/browser-resident-application/1", applicationModelDigest := "sha256:8e0861b75dcc13a7933635fa2b41e12940e12526581a2718bb68b2953baf1763", execution := "browser-session", persistentStorage := "none", externalServices := "none", resources := (cons "dom" (cons "webassembly" (nil String))), capabilities := (cons "portable-static-holo-application" (nil String))}), artifacts := (cons (record Production.BrowserSystem::GeneratedArtifact {id := "uorust-application", role := "selected-application", licenseExpression := "MIT OR Apache-2.0"}) (nil Production.BrowserSystem::GeneratedArtifact)), components := (cons (record Production.BrowserSystem::Component {id := "uorust-browser", artifact := "uorust-application", kind := "browser", version := "0.3.0"}) (nil Production.BrowserSystem::Component)), targets := (cons (record Production.BrowserSystem::Target {id := "pages", kind := "github-pages-browser", adapterDigest := "sha256:59df071a35deca05e62224e43b82d7bc9b5c649f989a3424fd704123633a539e", apiVersion := "github-pages-artifact@v4", minimumReleaseStatus := "development"}) (nil Production.BrowserSystem::Target)), controls := (cons "application-acceptance" (cons "artifact-closure" (cons "source-proof" (cons "spdx" (nil String))))), standards := (cons "SPDX-3.0.1" (nil String))})
}

definition{
name: systemManifest,
parameters: [],
result: Production.BrowserSystem::SystemManifest,
body: (record Production.BrowserSystem::SystemManifest {applicationModelDigest := "sha256:6c3c5cb9c1f9dcd82745e6a53b13f79a64c1066f6558cea48e9fddfee15fa1db", productId := "uorust", productVersion := "0.3.0", componentId := "uorust-browser", artifactId := "uorust-application", targetId := "pages", controls := (cons "application-acceptance" (cons "artifact-closure" (cons "source-proof" (cons "spdx" (nil String)))))})
body: (record Production.BrowserSystem::SystemManifest {applicationModelDigest := "sha256:8e0861b75dcc13a7933635fa2b41e12940e12526581a2718bb68b2953baf1763", productId := "uorust", productVersion := "0.3.0", componentId := "uorust-browser", artifactId := "uorust-application", targetId := "pages", controls := (cons "application-acceptance" (cons "artifact-closure" (cons "source-proof" (cons "spdx" (nil String)))))})
}

theorem{
Expand Down
38 changes: 19 additions & 19 deletions crates/uorust/src/certified.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ macro_rules! certified {
pub(crate) use certified;

/// `uorust::lex::members`, certified as `Behavior::members`.
#[allow(clippy::all)]
#[allow(clippy::all, non_snake_case, unused_parens)]
pub(crate) fn lex_members(
p0: &&str,
p1: &&[std::string::String],
Expand Down Expand Up @@ -80,7 +80,7 @@ pub(crate) fn lex_members(
}

/// `uorust::lift::Types::accessor`, certified as `Behavior::typesAccessor`.
#[allow(clippy::all)]
#[allow(clippy::all, non_snake_case, unused_parens)]
pub(crate) fn lift_Types_accessor(p0: &&str, p1: &&str) -> Option<std::string::String> {
Some(
uorust_certified::types_accessor::run(
Expand All @@ -93,7 +93,7 @@ pub(crate) fn lift_Types_accessor(p0: &&str, p1: &&str) -> Option<std::string::S
}

/// `uorust::lift::equality_name`, certified as `Behavior::equalityName`.
#[allow(clippy::all)]
#[allow(clippy::all, non_snake_case, unused_parens)]
pub(crate) fn lift_equality_name(p0: &&str) -> Option<std::string::String> {
Some(
uorust_certified::equality_name::run(uorust_certified::equality_name::Str::lit((*p0)))
Expand All @@ -103,7 +103,7 @@ pub(crate) fn lift_equality_name(p0: &&str) -> Option<std::string::String> {
}

/// `uorust::lift::evidence_axioms`, certified as `Behavior::evidenceAxioms`.
#[allow(clippy::all)]
#[allow(clippy::all, non_snake_case, unused_parens)]
pub(crate) fn lift_evidence_axioms() -> Option<std::vec::Vec<std::string::String>> {
Some({
let mut v = Vec::new();
Expand All @@ -117,7 +117,7 @@ pub(crate) fn lift_evidence_axioms() -> Option<std::vec::Vec<std::string::String
}

/// `uorust::lift::evidence_proof`, certified as `Behavior::evidenceProof`.
#[allow(clippy::all)]
#[allow(clippy::all, non_snake_case, unused_parens)]
pub(crate) fn lift_evidence_proof(p0: &&[std::string::String]) -> Option<std::string::String> {
Some(
uorust_certified::evidence_proof::run({
Expand All @@ -136,7 +136,7 @@ pub(crate) fn lift_evidence_proof(p0: &&[std::string::String]) -> Option<std::st
}

/// `uorust::lift::first_free`, certified as `Behavior::firstFree`.
#[allow(clippy::all)]
#[allow(clippy::all, non_snake_case, unused_parens)]
pub(crate) fn lift_first_free(
p0: &&str,
p1: &&[std::string::String],
Expand All @@ -161,7 +161,7 @@ pub(crate) fn lift_first_free(
}

/// `uorust::lift::mentions_word`, certified as `Behavior::mentionsWord`.
#[allow(clippy::all)]
#[allow(clippy::all, non_snake_case, unused_parens)]
pub(crate) fn lift_mentions_word(p0: &&str, p1: &&str) -> Option<bool> {
Some(
match uorust_certified::mentions_word::run(
Expand All @@ -175,13 +175,13 @@ pub(crate) fn lift_mentions_word(p0: &&str, p1: &&str) -> Option<bool> {
}

/// `uorust::lift::pointer_width`, certified as `Behavior::pointerWidth`.
#[allow(clippy::all)]
#[allow(clippy::all, non_snake_case, unused_parens)]
pub(crate) fn lift_pointer_width(p0: &&str) -> Option<std::option::Option<u32>> {
Some(match uorust_certified::pointer_width::run(uorust_certified::pointer_width::Str::lit((*p0))) { Ok(v) => v, Err(_) => panic!("uorust::lift::pointer_width: the certified root overflowed") }.map(|x| u32::try_from(x).expect("a natural the hand-written type holds")))
}

/// `uorust::lift::unicode_property`, certified as `Behavior::unicodeProperty`.
#[allow(clippy::all)]
#[allow(clippy::all, non_snake_case, unused_parens)]
pub(crate) fn lift_unicode_property(p0: &&str) -> Option<std::option::Option<std::string::String>> {
Some(
uorust_certified::unicode_property::run(uorust_certified::unicode_property::Str::lit(
Expand All @@ -192,7 +192,7 @@ pub(crate) fn lift_unicode_property(p0: &&str) -> Option<std::option::Option<std
}

/// `uorust::mir::lower::address`, certified as `Behavior::address`.
#[allow(clippy::all)]
#[allow(clippy::all, non_snake_case, unused_parens)]
pub(crate) fn mir_lower_address(p0: &&str) -> Option<std::string::String> {
Some(
uorust_certified::address::run(uorust_certified::address::Str::lit((*p0)))
Expand All @@ -202,7 +202,7 @@ pub(crate) fn mir_lower_address(p0: &&str) -> Option<std::string::String> {
}

/// `uorust::mir::lower::decoded`, certified as `Behavior::decoded`.
#[allow(clippy::all)]
#[allow(clippy::all, non_snake_case, unused_parens)]
pub(crate) fn mir_lower_decoded(p0: &&str) -> Option<std::string::String> {
Some(
uorust_certified::decoded::run(uorust_certified::decoded::Str::lit((*p0)))
Expand All @@ -212,7 +212,7 @@ pub(crate) fn mir_lower_decoded(p0: &&str) -> Option<std::string::String> {
}

/// `uorust::mir::lower::implication`, certified as `Behavior::implication`.
#[allow(clippy::all)]
#[allow(clippy::all, non_snake_case, unused_parens)]
pub(crate) fn mir_lower_implication(
p0: &&[std::string::String],
p1: &&str,
Expand All @@ -237,7 +237,7 @@ pub(crate) fn mir_lower_implication(
}

/// `uorust::mir::lower::is_const_argument`, certified as `Behavior::isConstArgument`.
#[allow(clippy::all)]
#[allow(clippy::all, non_snake_case, unused_parens)]
pub(crate) fn mir_lower_is_const_argument(p0: &&str) -> Option<bool> {
Some(
match uorust_certified::is_const_argument::run(
Expand All @@ -252,7 +252,7 @@ pub(crate) fn mir_lower_is_const_argument(p0: &&str) -> Option<bool> {
}

/// `uorust::mir::lower::pointer_value`, certified as `Behavior::pointerValue`.
#[allow(clippy::all)]
#[allow(clippy::all, non_snake_case, unused_parens)]
pub(crate) fn mir_lower_pointer_value(
p0: &&str,
p1: &&str,
Expand All @@ -270,7 +270,7 @@ pub(crate) fn mir_lower_pointer_value(
}

/// `uorust::mir::lower::referent`, certified as `Behavior::referent`.
#[allow(clippy::all)]
#[allow(clippy::all, non_snake_case, unused_parens)]
pub(crate) fn mir_lower_referent(p0: &&str) -> Option<std::option::Option<std::string::String>> {
Some(
match uorust_certified::referent::run(uorust_certified::referent::Str::lit((*p0))) {
Expand All @@ -282,7 +282,7 @@ pub(crate) fn mir_lower_referent(p0: &&str) -> Option<std::option::Option<std::s
}

/// `uorust::mir::lower::scalar_value`, certified as `Behavior::scalarValue`.
#[allow(clippy::all)]
#[allow(clippy::all, non_snake_case, unused_parens)]
pub(crate) fn mir_lower_scalar_value(p0: &&str) -> Option<std::string::String> {
Some(
uorust_certified::scalar_value::run(uorust_certified::scalar_value::Str::lit((*p0)))
Expand All @@ -292,7 +292,7 @@ pub(crate) fn mir_lower_scalar_value(p0: &&str) -> Option<std::string::String> {
}

/// `uorust::mir::lower::uninhabited`, certified as `Behavior::uninhabited`.
#[allow(clippy::all)]
#[allow(clippy::all, non_snake_case, unused_parens)]
pub(crate) fn mir_lower_uninhabited(p0: &&str) -> Option<bool> {
Some(
match uorust_certified::uninhabited::run(uorust_certified::uninhabited::Str::lit((*p0))) {
Expand All @@ -303,7 +303,7 @@ pub(crate) fn mir_lower_uninhabited(p0: &&str) -> Option<bool> {
}

/// `uorust::mir::memory::axioms`, certified as `Behavior::mirMemoryAxioms`.
#[allow(clippy::all)]
#[allow(clippy::all, non_snake_case, unused_parens)]
pub(crate) fn mir_memory_axioms() -> Option<std::vec::Vec<std::string::String>> {
Some({
let mut v = Vec::new();
Expand All @@ -317,7 +317,7 @@ pub(crate) fn mir_memory_axioms() -> Option<std::vec::Vec<std::string::String>>
}

/// `uorust::mir::memory::of`, certified as `Behavior::of`.
#[allow(clippy::all)]
#[allow(clippy::all, non_snake_case, unused_parens)]
pub(crate) fn mir_memory_of(p0: &&str) -> Option<std::string::String> {
Some(
uorust_certified::of::run(uorust_certified::of::Str::lit((*p0)))
Expand Down
2 changes: 1 addition & 1 deletion crates/uorust/src/certify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1679,7 +1679,7 @@ pub(crate) fn adapter(root: &Certified, body: &IrBody, source: &str) -> Option<(
.unwrap_or(&root.function)
.replace("::", "_");
let code = format!(
"/// `{}`, certified as `Behavior::{}`.\n#[allow(clippy::all)]\npub(crate) fn {name}({}) -> Option<{rust_result}> {{\n Some({value})\n}}\n",
"/// `{}`, certified as `Behavior::{}`.\n#[allow(clippy::all, non_snake_case, unused_parens)]\npub(crate) fn {name}({}) -> Option<{rust_result}> {{\n Some({value})\n}}\n",
root.function,
root.definition,
args.join(", ")
Expand Down
16 changes: 15 additions & 1 deletion crates/uorust/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,12 @@ pub(crate) fn project(
let toolchain = files.get("lean-toolchain").cloned().unwrap_or_default();
let lock = format!(
"spec = \"lexlean/lock/2\"\nlanguage = \"1.2\"\n\
compiler_semantics = \"1427f8b629013648a480454d67202788f2303f5396f1d7c70a7c350ddab6f694\"\n\
compiler_semantics = \"{}\"\n\
project_config_sha256 = \"{}\"\nlean_toolchain = \"leanprover/lean4:v4.32.1\"\n\n\
[[workspace_file]]\npath = \"lake-manifest.json\"\nsha256 = \"{}\"\n\n\
[[workspace_file]]\npath = \"lakefile.toml\"\nsha256 = \"{}\"\n\n\
[[workspace_file]]\npath = \"lean-toolchain\"\nsha256 = \"{}\"\n\n{}",
compiler_semantics(),
sha(lexlean.as_bytes()),
sha(manifest.as_bytes()),
sha(lakefile.as_bytes()),
Expand Down Expand Up @@ -417,6 +418,19 @@ pub(crate) fn project(
files
}

/// The LexLean compiler semantics a projection locks to: the one UORust's own
/// self model is locked to (`app/lexlean.lock`, which `lexlean lock` in the
/// locked SDK rewrites), so a projection follows the SDK's compiler without a
/// copied identity.
fn compiler_semantics() -> &'static str {
const SELF_LOCK: &str = include_str!("../../../app/lexlean.lock");
SELF_LOCK
.lines()
.find_map(|line| line.strip_prefix("compiler_semantics = \""))
.and_then(|rest| rest.strip_suffix('"'))
.expect("app/lexlean.lock names its compiler semantics")
}

pub(crate) fn sha(bytes: &[u8]) -> String {
Sha256::digest(bytes)
.iter()
Expand Down
2 changes: 1 addition & 1 deletion crates/uorust/tests/fixtures/thermostat-prism/lexlean.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
spec = "lexlean/lock/2"
language = "1.2"
compiler_semantics = "1427f8b629013648a480454d67202788f2303f5396f1d7c70a7c350ddab6f694"
compiler_semantics = "e1b2447a28c98f87a7782a4fd4786044db3fff53fd2a76dbd5e4071fd6a6721d"
project_config_sha256 = "b5491d53209ee64cb290cc20f80588374c50ef00a8d8b5b071b73d8494080c57"
lean_toolchain = "leanprover/lean4:v4.32.1"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ da71d931a70afde8f4702287d7f72263963bab01058d1051cc575d72a0015aa2 language/uorus
a5e11937a3f7acc79ddc3fb6f14c61fe8925efdf998cbc40bcdd20357b4395ff language/uorust.titles/entries/text.toml
3ce4bd0428b226fd05157df29987cf51819d391756100788501058df2701772b language/uorust.titles/lexicon.toml
8e3538e0ab5f81a3ee04927d8838c8c674e0e112838b4b3ce87ec218143276af lean-toolchain
41ea6a2e8ff24c75302348642e64743649208392c10c49026704b5e1c697c4b1 lexlean.lock
4fb39cdd258a383b3f8c187da49d406debca03cb64268eeb8d68d4fa7484d3b7 lexlean.lock
b5491d53209ee64cb290cc20f80588374c50ef00a8d8b5b071b73d8494080c57 lexlean.toml
f5a09b3ecec28ffcd8e2d7a296e2bdf13502b9e6e57df8faaabc3de7c56b4070 model/ids.toml
701c4d5db2a7e4a9009bc5ce97c9f83c99b7b18020a5792d018141cdf79536fc prismpm.toml
Expand Down
Loading
Loading