Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support module semantics #14

Open
will62794 opened this issue Jun 29, 2022 · 5 comments
Open

Support module semantics #14

will62794 opened this issue Jun 29, 2022 · 5 comments

Comments

@will62794
Copy link
Owner

will62794 commented Jun 29, 2022

For the use cases I envision, I was not planning to implement full blown semantics of modules and module imports e.g. EXTENDS, etc. For example, for now I'm just considering operators from the standard modules to be globally available at all times, even without being explicitly imported. This behavior could be re-considered in the future, though, if necessary.

@will62794
Copy link
Owner Author

See module notes: http://lamport.azurewebsites.net/tla/newmodule.html.

@will62794
Copy link
Owner Author

will62794 commented Sep 16, 2023

Preliminary implementation in 6c12345, starting with limited support of EXTENDS based imports.

Handling INSTANCE based imports is a remaining task. Will also need to handle LOCAL INSTANCE semantics.

@lemmy
Copy link
Contributor

lemmy commented May 6, 2024

Can the CommunityModules be added to the default search path? The root modules of both the CCF Consistency spec and the Azure CosmosDB spec extend them.

@lemmy
Copy link
Contributor

lemmy commented May 6, 2024

Confirmed that the below doesn't work for CCF's consistency spec because resolving the CommunityModule's Functions and Folds from the CCF repo obviously results in a 404.

tla-web/js/eval.js

Lines 24 to 30 in aeaf642

// https://github.com/tlaplus/CommunityModules/blob/master/modules
const TLA_COMMUNITY_MODULES = [
"SequencesExt",
"FiniteSetsExt"
]
const TLA_COMMUNITY_MODULES_BASE_URL = "https://raw.githubusercontent.com/tlaplus/CommunityModules/master/modules";

tla-web/js/eval.js

Lines 1290 to 1297 in aeaf642

// Look up CommunityModule imports from hard-coded repo.
// TODO: This will likely not work properly unitl we handle LOCAL INSTANCE
// semantics correctly for modules.
if (TLA_COMMUNITY_MODULES.includes(modName)) {
return fetch(`${TLA_COMMUNITY_MODULES_BASE_URL}/${modName}.tla`).then(response => response.text());
}
return fetch(`${baseSpecPath}/${modName}.tla`).then(response => response.text());

@will62794
Copy link
Owner Author

See 538d398.

@will62794 will62794 changed the title Consider how to handle module semantics Support module semantics May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants