Skip to content

Instantly share code, notes, and snippets.

View stackdump's full-sized avatar

stackdump stackdump

View GitHub Profile
@stackdump
stackdump / pflow.html
Last active February 10, 2024 20:58
Run pflow.dev app from CDN
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<title>pflow.dev | metamodel editor</title>
<script defer="defer" src="https://cdn.jsdelivr.net/gh/pflow-dev/pflow-js@1.1.0/p/static/js/main.4602f11c.js"> </script>
<link href="https://cdn.jsdelivr.net/gh/pflow-dev/pflow-js@1.1.0/p/static/css/main.63d515f3.css" rel="stylesheet">
</head>
@stackdump
stackdump / Metamodel.sol
Last active July 14, 2023 14:39
Metamodel-v3
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import "@openzeppelin/contracts/access/AccessControl.sol";
// import "hardhat/console.sol";
library Uint8Model {
event Action(uint256 indexed session, uint8 indexed sequence, uint8 actionId, uint8 role, uint256 when);
struct PetriNet {
@stackdump
stackdump / tic-tac-toe-dependent-types.md
Last active June 20, 2023 12:43
Describing Tic-Tac-Toe Using Dependent Sum Types
// REVIEW visual model design in JS:
// https://pflow.dev/chainlink2023/tictactoe/
contract TicTacToeModel is MetamodelUint8, Uint8ModelFactory {
enum Roles{ X, O, HALT }
enum Properties {
_00, _01, _02,
_10, _11, _12,
_20, _21, _22,
@stackdump
stackdump / Metamodel.sol
Created June 2, 2023 00:42
Metamodel implementation in solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import "@openzeppelin/contracts/access/AccessControl.sol";
contract MetamodelUint8 {
Place[] internal places;
Transition[] internal transitions;
struct PetriNet {
@stackdump
stackdump / Metamodel.sol
Created May 25, 2023 15:04
metamodel POC (WIP)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
// Uncomment this line to use console.log
// import "hardhat/console.sol";
// see also: bitwrap.io: where we are developing a generalized state channel for web3
contract Metamodel {
address payable public owner;
@stackdump
stackdump / generate_data.py
Created February 11, 2023 19:51
pflow-tensors
import math
import random
import torchflow
import torch
import examples.tictactoe
win_moves = [
["00", "01", "02"],
@stackdump
stackdump / finite.py
Last active September 15, 2022 15:25
Finite is a - Rank 1 Constraint System: (R1CS) That uses Petri-Nets as a means to construct Zero Knowledge Proofs.
"""
MIT License https://github.com/FactomProject/ptnet-eventstore/blob/master/LICENSE
Finite is a - Rank 1 Constraint System: (R1CS)
That uses Petri-Nets as a means to construct Zero Knowledge Proofs.
The author is planning to deploy using The Factom Blockchain https://www.factom.com/factom-blockchain/
with the notion that this protocol is useful as an addressing system to index other forms of proofs.
Because Factom can isolate users from the need to own cryptocurrency, it is hoped that adoption can reach outside of
@stackdump
stackdump / backup_world.sh
Created March 8, 2022 16:09
snapshot Minetest world with IPFS
#!/usr/bin/env bash
# backup world in IPFS
cd "${BASH_SOURCE%/*}" || exit
ROOT='vevr.se'
WORLD="foo7"
TS=$(date +%s)