Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mheiber/lsbsteak
https://github.com/mheiber/lsbsteak
Last synced: 21 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/mheiber/lsbsteak
- Owner: mheiber
- Created: 2024-08-03T20:43:33.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-29T14:58:42.000Z (4 months ago)
- Last Synced: 2024-10-16T01:44:13.254Z (2 months ago)
- Language: Alloy
- Size: 100 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Alloy modelling for sound late static bindings
![screnshot](./screenshot.png)
This repo models potential Hack language feautures for sound
[Late Static Bindings](https://www.php.net/manual/en/language.oop5.late-static-bindings.php).You can ask the Alloy model for examples of valid Hack programs and ask it to check safety properties for you.
Here's an example of a generated Hack program:
```
>abstract class AbstractClass0 {
public static abstract function m1(): void /* AbstractMethod$1*/;
public static function m0(): void /* ConcreteMethod$0*/ {}
}abstract class AbstractClass1 extends AbstractClass0 {
public static abstract function m1(): void /* AbstractMethod$2*/;
// type errors: CantOverrideNonConcreteClassMethodWithConcreteClassMethod<<__ConcreteClass>>
public static function m0(): void /* ConcreteMethod$1*/ {
// Runtime fatal!
static::m1(); // Call$0 resolves to AbstractMethod$2
}
}<<__EntryPoint>>
function main(): void {
let $v0 : classname = AbstractClass1::class;
let $v1 : classname = $v0;
$v1::m0(); // Call$1 resolves to ConcreteMethod$1}
```which can be easier to digest than [a graph representation](./analyzer.png).
Demo: [./demo.mov](./demo.mov)
## How to Run
Use with this custom build of Alloy that understands how to use custom visualizations: [mheiber/org.alloytools.alloy](https://github.com/mheiber/org.alloytools.alloy/). See instructions there, which use the examples from this repo.