A knowledge-based reasoning system for analyzing proposed Python syntax and identifying related prior Python Enhancement Proposals (PEPs).
This project builds a structured knowledge graph from selected Python PEPs and uses rule-based reasoning to compare a new syntax proposal against existing Python language proposals.
The system can identify:
- Related Python Enhancement Proposals
- Matching language concepts
- Alternatives considered by previous proposals
- Objections raised during proposal discussions
- Examples associated with previous proposals
- Historical relationships between PEPs
- Direct, related, and weak matches
The project follows a simple pipeline:
PEP Dataset ↓ PEP Collection ↓ PEP Parsing ↓ Knowledge Graph Construction ↓ Concept Mapping ↓ Reasoning Engine ↓ Prior-Art Analysis
Contains the selected PEP dataset and manually defined concept mappings.
Collects PEP source documents.
Parses individual PEP documents and extracts structured information.
Builds the knowledge graph containing entities and relationships.
Accepts a proposed Python syntax and searches the knowledge graph for relevant prior art.
The reasoning engine uses:
- Token matching
- Manually defined concept aliases
- Relevance scoring
- Match classification
- Graph traversal
- Historical relationship traversal
- Rule-based reasoning explanations
The reasoning system classifies matches using relevance scores:
| Score | Classification |
|---|---|
| ≥ 0.70 | DIRECT |
| ≥ 0.40 | RELATED |
| ≥ 0.20 | WEAK |
| < 0.20 | NONE |
Input:
I want to introduce syntax that allows assignment inside an expression.
Output:
PEP 572: PEP 572 – Assignment Expressions
Feature: Assignment Expressions
Relevance score: 1.0
Match type: DIRECT