Skip to content
Back to skills

Py Acsets Rewriting

ASecurity

Python bridge to AlgebraicRewriting.jl for DPO/SPO/SqPO graph rewriting over ACSets.

  • 61 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 6, 2026
developmentpython

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 2 files and shows the line behind each finding

Scanned September 6, 2026

npx -y skills add plurigrid/asi --skill py-acsets-rewriting --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Py Acsets Rewriting?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Py Acsets Rewriting
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/plurigrid-py-acsets-rewriting/badge)](https://www.skillsdirectory.com/skills/plurigrid-py-acsets-rewriting)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: py-acsets-rewriting
description: Python bridge to AlgebraicRewriting.jl for DPO/SPO/SqPO graph rewriting over ACSets.
---
# py-acsets-rewriting

Python bridge to AlgebraicRewriting.jl for DPO/SPO/SqPO graph rewriting over ACSets.

## GF(3) Assignment

**Trit: -1 (MINUS)** - Validator/constraint role

Triad: `algebraic-rewriting(-1) ⊗ acsets-hatchery(0) ⊗ zulip-cogen(+1) = 0`

## Core Components

```python
from py_acsets_rewriting import (
    PyACSet, ACSetSchema, ACSetMorphism, RewriteRule,
    RewriteType, find_homomorphisms, rewrite,
    GraphSchema, LabeledGraphSchema,
    make_edge_contraction_rule, make_vertex_duplication_rule
)
```

## Rewrite Types

| Type | Description | Gluing Condition |
|------|-------------|------------------|
| DPO  | Double Pushout - safe deletion | Required |
| SPO  | Single Pushout - greedy deletion | Not checked |
| SqPO | Sesqui-Pushout - cloning + deletion | Extended |

## Usage Pattern

```python
# Create graph
G = PyACSet(GraphSchema)
vs = G.add_parts("V", 4)
for i in range(3):
    e = G.add_part("E")
    G.set_subpart(e, "src", i)
    G.set_subpart(e, "tgt", i + 1)

# Create rewriter and apply rule
rewriter = PyACSetRewriter()
rewriter.add_rule(make_edge_contraction_rule())
H = rewriter.apply("edge_contraction", G)
```

## Rule Structure (L ← K → R)

- **L**: Pattern to match (left-hand side)
- **K**: Interface to preserve
- **R**: Replacement (right-hand side)
- **l**: K → L morphism
- **r**: K → R morphism

## Color Integration

All ACSets receive deterministic Gay.jl colors via SplitMix64:
```python
GAY_SEED = 0x6761795f636f6c6f
color = seed_to_color(hash(str(acset.parts)) ^ GAY_SEED)
```

## File Location

`/Users/bob/ies/py_acsets_rewriting.py`

## Dependencies

- `py-acsets` (pip install)
- Python 3.10+


---

## Autopoietic Marginalia

> **The interaction IS the skill improving itself.**

Every use of this skill is an opportunity for worlding:
- **MEMORY** (-1): Record what was learned
- **REMEMBERING** (0): Connect patterns to other skills  
- **WORLDING** (+1): Evolve the skill based on use



*Add Interaction Exemplars here as the skill is used.*

Files in this skill

  • CONCOMITANT_SKILLS.md1.2 KB
  • SKILL.md2.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.