Org.alloytools.alloy
Alloy is a language for describing structures and a tool for exploring them. It has been used in a wide range of applications from finding holes in security mechanisms to designing telephone switching networks. This repository contains the code for the tool.
Install / Use
/learn @AlloyTools/Org.alloytools.alloyREADME
Alloy
Alloy 6 is a self-contained executable, which includes an extended version of the Kodkod model finder and a variety of SAT solvers, as well as the standard Alloy library and a collection of tutorial examples. The same jar file can be incorporated into other applications to use Alloy as an API, and includes the source code. See the release notes for details of new features.
Alloy 6 is a major new release More documentation can be found at: http://alloytools.org/documentation.html.
Requirements
Alloy runs on all operating systems with a recent JVM (Java 17 or later). It is made available as a runnable jar file with both a cross-platform SAT solver (Sat4j and more efficient native SAT solvers (minisat, lingeling/plingeling, glucose).
TL;DR
Checkout the project and type ./gradlew build. You find the executable JAR in org.alloytools.alloy.dist/target/org.alloytools.alloy.dist.jar after the build has finished.
$ java -version # requires Java 17
openjdk version "17.0.9" 2023-10-17 LTS
OpenJDK Runtime Environment (build 17.0.9+11-LTS)
OpenJDK 64-Bit Server VM (build 17.0.9+11-LTS, mixed mode, sharing)
$ git clone --recursive https://github.com/AlloyTools/org.alloytools.alloy.git
$ cd org.alloytools.alloy
$ ./gradlew build
$ java -jar org.alloytools.alloy.dist/target/org.alloytools.alloy.dist.jar
# opens GUI
Note: if you are behind a proxy, the call to gradlew is likely to fail, unless you pass it further options about the http and https proxies (and possibly your login and password on this proxy). There are several ways to pass these options, a simple one is to type (replace the XXXXX's by the adequate settings):
$ ./gradlew -Dhttps.proxyHost=XXXXX -Dhttp.proxyHost=XXXXX -Dhttp.proxyPort=XXXXX \
-Dhttps.proxyPort=XXXXX -Dhttp.proxyUser=XXXXX -Dhttp.proxyPassword=XXXXX \
-Dhttps.proxyUser=XXXXX -Dhttps.proxyPassword=XXXXX \
build
Building Alloy
The Alloy build is using a bnd workspace setup using a maven layout. This means it can be build with Gradle and the Eclipse IDE for interactive development. Projects are setup to continuously deliver the executable.
Projects
The workspace is divided into a number of projects:
- cnf – Setup directory. Dependencies are specified in [cnf/central.xml] using the maven POM layout
- org.alloytools.alloy.application – Main application code includes the parser, ast, visualiser, and application code
- org.alloytools.alloy.dist – Project to create the distribution executable JAR
- org.alloytools.alloy.extra – Models and examples
- org.alloytools.pardinus – A Kodkod extension without native code
- org.alloytools.kodkod.nativesat – The native code libraries for Kodkod
Relevant Project files
This workspace uses bnd. This means that the following have special meaning:
- cnf/build.bnd – Settings shared between projects
- ./bnd.bnd – Settings for a project. This file will drag in code in a JAR.
- cnf/central.mvn – Dependencies from maven central
Eclipse
The workspace is setup for interactive development in Eclipse with the Bndtools plugin. Download Eclipse and install it. You can then Import existing projects from the Git workspace. You should be asked to install Bndtools from the market place. You can also install Bndtools directly from the Eclipse Market place (see Help/Marketplace and search for Bndtools).
Bndtools will continuously create the final executable. The projects are setup to automatically update when a downstream project changes.
IntelliJ IDEA (Ultimate Edition only)
Ensure you have the Osmorc plugin is enabled, as this plugin is needed for Bndtools support. It should be enabled by default.
- Choose
Import project from existing Sourcesby usingCtrl + Shift + a. - Select the root folder (default folder name is
org.alloytools.alloy). - Choose "Import project from external model: Bnd/Bndtools" and click "Next"
- For "Select Bnd/Bndtools project to import", all projects should be checked by default, click "Next"
- For project SDK, Choose "17", Click Finish
- Select folder
org/alloytools/kodkod/nativesat/jniasResource Folderby selecting moduleorg.alloytools.kodkod.nativesat, selecting folderjni->right click->Mark Directory As->Resource Root.
Note: do not link the Gradle project, as this will prevent you from running Alloy within IDEA.
To run the Alloy GUI within IDEA, navigate to org.alloytools.alloy.application/src/main/java/edu/mit/csail/sdg/alloy4whole/SimpleGUI and run the SimpleGUI class.
Gradle
In the root of this workspace type ./gradlew. This is a script that will download the correct version of gradle and run the build scripts. For settings look at [gradle.properties] and [settings.gradle].
Continuous Integration
The workspace is setup to build after every commit using Github Actions, see workflows.
It releases snapshots to https://oss.sonatype.org/content/repositories/snapshots/org/alloytools/ for every CI build.
Building the DMG file for OSX systems
Currently only the executable jar in org.alloytools.alloy.dist/target/org.alloytools.alloy.dist.jar is build. See the conveyor directory for the release executables.
CONTRIBUTIONS
Please read the CONTRIBUTING to understand how you can contribute.
Related Skills
diffs
342.5kUse the diffs tool to produce real, shareable diffs (viewer URL, file artifact, or both) instead of manual edit summaries.
clearshot
Structured screenshot analysis for UI implementation and critique. Analyzes every UI screenshot with a 5×5 spatial grid, full element inventory, and design system extraction — facts and taste together, every time. Escalates to full implementation blueprint when building. Trigger on any digital interface image file (png, jpg, gif, webp — websites, apps, dashboards, mockups, wireframes) or commands like 'analyse this screenshot,' 'rebuild this,' 'match this design,' 'clone this.' Skip for non-UI images (photos, memes, charts) unless the user explicitly wants to build a UI from them. Does NOT trigger on HTML source code, CSS, SVGs, or any code pasted as text.
openpencil
1.9kThe world's first open-source AI-native vector design tool and the first to feature concurrent Agent Teams. Design-as-Code. Turn prompts into UI directly on the live canvas. A modern alternative to Pencil.
ui-ux-pro-max-skill
55.6kAn AI SKILL that provide design intelligence for building professional UI/UX multiple platforms
