HEG v2 article assets and legacy comparison bundle
Electron Graph Figure Bundle
The default tab shows the ownership-structured HEG v2 Diazomethane results used by the article. Older EFG/native-HEG resonance, coalescing, and partial-composition assets are kept as comparison material in separate tabs.
Images labelled Molecule, Lewis-EFG, HEG, RDKit, or Fragment are clickable: click the image panel to switch representation when multiple views are available.
Article HEG v2 Results
Ownership-structured native HEG version of the Diazomethane mechanism used in the article. Cards cycle through Molecule, Lewis / EFG, and HEG views when those projections are chemically complete.
What is v2 already?
| Feature | Status | Meaning |
|---|---|---|
| Ownership-structured HEG category | v2 implemented | OwnedHalfEdgeMol uses HalfEdge, Edge, Incidence, and rewritable Ownership objects. |
| Diazomethane proton-transfer rule | v2 implemented | HalfEdges and pair objects are preserved across K; ownership objects carry the resource movement. |
| Diazomethane methyl-transfer rule | v2 implemented | Same v2 rule style as above. |
| Diazomethane composed macro rule | v2 implemented | Direct v2 macro rule exists; generated product is checked against the explicit two-step product. |
| General v2 rule-composition API | not yet in v2 | The old partial-composition witness machinery is not yet ported to ownership-structured HEG v2. |
| Weighted resonance coalescing | legacy layer | Available in the EFG/native-HEG resonance experiments, but not yet as a v2 weighted-family API. |
| Partial-overlap radical-chain composition | legacy layer | Available in older DPO/native-HEG assets and shown in the Composition tab; not yet v2. |
Minimal Julia: HEG v2
Run the v2 Diazomethane sequence
include("ElectronGraphsV2.jl")
using .ElectronGraphsV2
system = diazomethane_esterification_system()
steps = diazomethane_mechanism()
trace = run_mechanism(system, steps)
Check two-step product against macro product
include("ElectronGraphsV2.jl")
using .ElectronGraphsV2
system = diazomethane_esterification_system()
steps = diazomethane_mechanism()
trace = run_mechanism(system, steps)
macro_rule = compose_mechanism(steps)
macro_product = apply(macro_rule, system)
compare_products(trace, macro_product).equal_as_v2_coarsening
Export the v2 mechanism report
include("ElectronGraphsV2.jl")
using .ElectronGraphsV2
system = diazomethane_esterification_system()
steps = diazomethane_mechanism()
trace = run_mechanism(system, steps)
macro_rule = compose_mechanism(steps)
macro_product = apply(macro_rule, system)
check = compare_products(trace, macro_product)
report = explain(trace, macro_rule, macro_product, check)
export_mechanism_report(report; outdir="out/simple/v2/diazomethane")
| Rule | HalfEdges L/K/R | Pairs L/K/R | Ownership L/K/R |
|---|---|---|---|
| Proton transfer | 12/12/12 | 6/6/6 | 12/10/12 |
| Methyl transfer | 10/10/10 | 5/5/5 | 10/8/10 |
| Macro rule | 12/12/12 | 6/6/6 | 12/9/12 |
v2 proton transfer
| L | K | R |
|---|---|---|
Molecule viewclick image to switch: Molecule / Lewis-EFG / HEG
|
HEG viewclick image to switch: HEG
K is an interface: changed ownership objects are intentionally absent, so this panel is HEG-only when no complete molecule projection exists. |
Molecule viewclick image to switch: Molecule / Lewis-EFG / HEG
|
v2 methyl transfer
| L | K | R |
|---|---|---|
Molecule viewclick image to switch: Molecule / Lewis-EFG / HEG
|
HEG viewclick image to switch: HEG
K is an interface: changed ownership objects are intentionally absent, so this panel is HEG-only when no complete molecule projection exists. |
Molecule viewclick image to switch: Molecule / Lewis-EFG / HEG
|
v2 composed macro rule
| L | K | R |
|---|---|---|
Molecule viewclick image to switch: Molecule / Lewis-EFG / HEG
|
HEG viewclick image to switch: HEG
K is an interface: changed ownership objects are intentionally absent, so this panel is HEG-only when no complete molecule projection exists. |
Molecule viewclick image to switch: Molecule / Lewis-EFG / HEG
|
Executable State Sequence
| Start | After proton transfer | After methyl transfer | Direct macro product |
|---|---|---|---|
Molecule viewclick image to switch: Molecule / Lewis-EFG / HEG
|
Molecule viewclick image to switch: Molecule / Lewis-EFG / HEG
|
Molecule viewclick image to switch: Molecule / Lewis-EFG / HEG
|
Molecule viewclick image to switch: Molecule / Lewis-EFG / HEG
|
HEG v2 Named-Reaction Routes
Five ownership-structured HEG v2 mechanism reports now include an interactive spring-layout route player plus DPO-like L/K/R panels for each primitive route snapshot. Use the route buttons to step through alternatives; drag a node to pin it, double-click to release it.
Rule Composition
Composed rules and their concrete applications. The Diazomethane macro rule in the HEG v2 tab is ownership-structured v2. The partial-overlap radical-chain construction shown here is the older DPO/native-HEG/EFG composition asset and has not yet been ported to v2.
Partial DPO Composition Detail
chlorine_h_abstraction then radical_recombination_methyl, with only the produced methyl radical identified with one radical input of recombination.
- Composition record:
exchange/compositions/radical_abstraction_recombination_partial_composeV.egml - Composed rule:
exchange/rules/radical_abstraction_recombination_partial_macro.egml - Direct application:
exchange/applications/radical_abstraction_recombination_partial_macro_on_host.egml
Minimal Julia: compose and apply this rule
using AlgebraicRewriting
include("ElectronDPO.jl")
const D = ElectronDPO
first = D.open_rule_from_span(D.chlorine_h_abstraction_with_external_methyl_span_parts()...)
second = D.open_rule_from_span(D.radical_recombination_with_hcl_context_span_parts()...)
macro_open = composeV_(first, second)
macro_rule, _, L, _ = D.closed_rule_from_open_rule(macro_open)
host = D.radical_abstraction_recombination_host()
m = D.radical_abstraction_recombination_match(L, host)
product = rewrite_match(macro_rule, m; cat=D.EG.electron_cat())
Original rules before adding identity context
| Rule | L | K | R |
|---|---|---|---|
| Rule 1: chlorine_h_abstraction | Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
| Rule 2: radical_recombination_methyl | Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
Partial overlap
| Overlap graph | Meaning |
|---|---|
Fragment viewDOT viewclick image to switch representation |
The methyl radical produced by chlorine_h_abstraction is identified with one radical input of radical_recombination_methyl. The other methyl radical is carried as external context. |
Context-complete open-rule inputs passed to composeV_
| Rule | L | K | R |
|---|---|---|---|
| Rule 1 with external methyl context | Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
| Rule 2 with HCl context | Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
Composed macro rule
| Rule | L | K | R |
|---|---|---|---|
| Composed macro rule | Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
Partial radical-chain DPO composition
RDKit molecule quick view
| Host | Product |
|---|---|
RDKit viewDOT viewclick image to switch representation |
RDKit viewDOT viewclick image to switch representation |
Chemistry: Cl radical + methane + methyl radical -> HCl + ethane
The first rule creates a methyl radical; the second overlaps only that produced methyl radical with one radical input of recombination.
Atom map: L1->H1, L2->H2, L3->H3, L4->H4, L5->H5, L6->H6, L7->H7, L8->H8, L9->H9, L10->H10
Feature map: L1->H1, L2->H2, L3->H3, L4->H6, L5->H7, L6->H8, L7->H4, L8->H5, L9->H9, L10->H10, L11->H11, L12->H12
Atom/H counts: L: atoms=10, H=7; K: atoms=10, H=7; R: atoms=10, H=7; H: atoms=10, H=7; D: atoms=10, H=7; H': atoms=10, H=7
Scope: L/K/R are rule fragments. H/D/H' are full application graphs, so hydrogens not shown in a rule fragment are preserved context atoms there.
Formal electron-feature DPO view
| L rule fragment | K interface | R rule fragment |
|---|---|---|
| H full host | D pushout complement | H' full product |
Chemical/DOT companion view
| L rule fragment | K interface | R rule fragment |
|---|---|---|
Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
| H full host | D pushout complement | H' full product |
RDKit viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
RDKit viewDOT viewclick image to switch representation |
RDKit host/product views
| Host | Product |
|---|---|
RDKit viewDOT viewclick image to switch representation |
RDKit viewDOT viewclick image to switch representation |
Diazomethane composed macro DPO
RDKit molecule quick view
| Host | Product |
|---|---|
RDKit viewDOT viewclick image to switch representation |
RDKit viewDOT viewclick image to switch representation |
Chemistry: CH2N2 + RCO2H -> RCO2CH3 + N2
This macro rule is generated by vertical DPO composition of proton transfer and methyl transfer.
Atom map: L1->H1, L2->H2, L3->H3, L4->H12, L5->H13
Feature map: L1->H1, L2->H2, L3->H3, L4->H4, L5->H7, L6->H16
Atom/H counts: L: atoms=5, H=1; K: atoms=5, H=1; R: atoms=5, H=1; H: atoms=13, H=6; D: atoms=13, H=6; H': atoms=13, H=6
Scope: L/K/R are rule fragments. H/D/H' are full application graphs, so hydrogens not shown in a rule fragment are preserved context atoms there.
Formal electron-feature DPO view
| L rule fragment | K interface | R rule fragment |
|---|---|---|
| H full host | D pushout complement | H' full product |
Chemical/DOT companion view
| L rule fragment | K interface | R rule fragment |
|---|---|---|
Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
| H full host | D pushout complement | H' full product |
RDKit viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
RDKit viewDOT viewclick image to switch representation |
RDKit host/product views
| Host | Product |
|---|---|
RDKit viewDOT viewclick image to switch representation |
RDKit viewDOT viewclick image to switch representation |
Diazomethane exact-azo composed macro DPO
RDKit molecule quick view
| Host | Product |
|---|---|
RDKit viewDOT viewclick image to switch representation |
RDKit viewDOT viewclick image to switch representation |
Chemistry: H2C=N+=N- + RCO2H -> RCO2CH3 + N2
This exact-resonance macro rule is generated by composing the azo-form proton-transfer step with context-complete methyl transfer.
Atom map: L1->H1, L2->H2, L3->H3, L4->H12, L5->H13
Feature map: L1->H1, L2->H3, L3->H4, L4->H7, L5->H2, L6->H8, L7->H16
Atom/H counts: L: atoms=5, H=1; K: atoms=5, H=1; R: atoms=5, H=1; H: atoms=13, H=6; D: atoms=13, H=6; H': atoms=13, H=6
Scope: L/K/R are rule fragments. H/D/H' are full application graphs, so hydrogens not shown in a rule fragment are preserved context atoms there.
Formal electron-feature DPO view
| L rule fragment | K interface | R rule fragment |
|---|---|---|
| H full host | D pushout complement | H' full product |
Chemical/DOT companion view
| L rule fragment | K interface | R rule fragment |
|---|---|---|
Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
| H full host | D pushout complement | H' full product |
RDKit viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
RDKit viewDOT viewclick image to switch representation |
RDKit host/product views
| Host | Product |
|---|---|
RDKit viewDOT viewclick image to switch representation |
RDKit viewDOT viewclick image to switch representation |
Rules
Generated EGML rule spans. The visual rule panels below use clickable Fragment/DOT images where available; raw rule files remain in the appendix.
Weighted Resonance Coalescing
This is the completed v1/legacy weighted-family layer: localized contributors carry external weights, rules are applied contributor-wise, and isomorphic products are coalesced while preserving route provenance. It is not yet the ownership-structured HEG v2 API.
Core result: averaging a molecule can hide reactive branches. Weighted push-forward keeps those branches executable; coalescing then tells whether different localized routes produce the same graph class or distinct product classes.
| Example | Layer | Input weights | Rules/routes | Available | Unavailable | Raw branches | Classes | Class weights | Provenance | Conclusion |
|---|---|---|---|---|---|---|---|---|---|---|
| Charge-shift H2 toy | EFG weighted family | covalent 0.5; ionic 0.25 + 0.25 | ionic_pair_recombination | 0.5 | 0.5 | 2 | 1 | 0.5 | w=0.5 from ionic_h1_minus_h2_plus+ionic_h1_plus_h2_minus via ionic_pair_recombination | The averaged charges vanish, but only the ionic weight 0.5 is reactive; both ionic branches coalesce to one covalent product class. |
| Diazomethane protonation | EFG/DPO resonance | diazo ylide 0.5; azo form 0.5 | ylide proton-transfer + azo proton-transfer | 1 | 0 | 14 | 1 | 1 | w=1 from azo_form+diazo_ylide via diazomethane_azo_proton_transfer+diazomethane_proton_transfer | Two distinct localized DPO rules become one protonated intermediate product class after isomorphism coalescing. |
| Substituted allyl methyl trap | native HEG v1 | left radical 0.5; right radical 0.5 | radical_recombination | 1 | 0 | 4 | 2 | 0.5, 0.5 | w=0.5 from left_radical via native_radical_recombination; w=0.5 from right_radical via native_radical_recombination | Radical density is converted into two non-isomorphic regioisomeric product classes with weights 0.5 and 0.5. |
| Singlet/triplet carbene routes | native HEG v1 | singlet 0.6; triplet 0.4 | direct singlet rule vs triplet two-step diradical route | 1 | 0 | 5 | 1 | 1 | w=1 from singlet+triplet via native_singlet_carbene_cyclopropanation+triplet_diradical_route | Direct concerted availability is 0.6; the triplet weight 0.4 is productive only through the two-step diradical route. Both routes coalesce to one cyclopropane class. |
Detailed visual proof page
The table above is the compact summary. The full generated resonance page contains clickable graph cards, rule panels, product-class galleries, and minimal code fragments for charge-shift, allyl, native HEG trapping, and Diazomethane push-forward.
Open weighted resonance visual demoMinimal Julia: weighted push-forward and coalescing
include("ElectronResonance.jl")
include("ElectronHEGResonance.jl")
using .ElectronResonance
using .ElectronHEGResonance
p = diazomethane_acid_presentation()
rules = [ER.diazomethane_proton_transfer_rule(),
ER.diazomethane_azo_proton_transfer_rule()]
push = product_pushforward(p, rules; branch_policy=:uniform_matches)
classes = coalesce_products(push.raw_products)
native_p = native_substituted_allyl_methyl_trap_presentation()
native_rule = HEG.native_radical_recombination_rule()
native_push = native_product_pushforward(native_p, native_rule)
native_classes = native_coalesce_products(native_push.raw_products)
References: charge-shift/VB motivation from Shaik, Danovich, and Hiberty, Valence Bond Theory, DOI 10.3390/molecules26061624; allyl sanity examples from Linares, Humbel, and Braida, The Nature of Resonance in Allyl Ions and Radical, DOI 10.1021/jp8038169.
Defect Audit
Rule defects are computed as right - left. DeltaE = 2*DeltaPairs + 2*DeltaLonePairs + DeltaRadicals; radical parity is DeltaRadicals mod 2.
Named Rules
| Rule | Source | DeltaV | DeltaPairs | DeltaLonePairs | DeltaRadicals | DeltaE | DeltaQ | Radical parity |
|---|---|---|---|---|---|---|---|---|
carbene_singlet_to_triplet | examples/rules/carbene_singlet_to_triplet.egml | 0 | 0 | -1 | +2 | 0 | 0 | even (0) |
carbene_triplet_to_singlet | examples/rules/carbene_triplet_to_singlet.egml | 0 | 0 | +1 | -2 | 0 | 0 | even (0) |
chlorine_h_abstraction | exchange/rules/chlorine_h_abstraction.egml | 0 | 0 | 0 | 0 | 0 | 0 | even (0) |
chlorine_h_abstraction_with_external_methyl | exchange/rules/chlorine_h_abstraction_with_external_methyl.egml | 0 | 0 | 0 | 0 | 0 | 0 | even (0) |
diazomethane_azo_esterification_macro | exchange/rules/diazomethane_azo_esterification_macro.egml | 0 | 0 | 0 | 0 | 0 | 0 | even (0) |
diazomethane_azo_proton_transfer | exchange/rules/diazomethane_azo_proton_transfer.egml | 0 | 0 | 0 | 0 | 0 | 0 | even (0) |
diazomethane_esterification_macro | exchange/rules/diazomethane_esterification_macro.egml | 0 | 0 | 0 | 0 | 0 | 0 | even (0) |
diazomethane_methyl_transfer | exchange/rules/diazomethane_methyl_transfer.egml | 0 | 0 | 0 | 0 | 0 | 0 | even (0) |
diazomethane_methyl_transfer_after_azo_context | exchange/rules/diazomethane_methyl_transfer_after_azo_context.egml | 0 | 0 | 0 | 0 | 0 | 0 | even (0) |
diazomethane_methyl_transfer_after_proton_context | exchange/rules/diazomethane_methyl_transfer_after_proton_context.egml | 0 | 0 | 0 | 0 | 0 | 0 | even (0) |
diazomethane_proton_transfer | exchange/rules/diazomethane_proton_transfer.egml | 0 | 0 | 0 | 0 | 0 | 0 | even (0) |
radical_abstraction_recombination_partial_macro | exchange/rules/radical_abstraction_recombination_partial_macro.egml | 0 | +1 | 0 | -2 | 0 | 0 | even (0) |
radical_recombination | examples/rules/radical_recombination.egml | 0 | +1 | 0 | -2 | 0 | 0 | even (0) |
radical_recombination_methyl | exchange/rules/radical_recombination_methyl.egml | 0 | +1 | 0 | -2 | 0 | 0 | even (0) |
radical_recombination_with_hcl_context | exchange/rules/radical_recombination_with_hcl_context.egml | 0 | +1 | 0 | -2 | 0 | 0 | even (0) |
Named Compositions
| Composition | Source | Rule equation | First+second defect | Result defect | Defects add? |
|---|---|---|---|---|---|
diazomethane_azo_esterification_composeV | exchange/compositions/diazomethane_azo_esterification_composeV.egml | diazomethane_azo_proton_transfer + diazomethane_methyl_transfer_after_azo_context -> diazomethane_azo_esterification_macro | DeltaV=0; DeltaPairs=0; DeltaLonePairs=0; DeltaRadicals=0; DeltaE=0; DeltaQ=0; radical parity=0 | DeltaV=0; DeltaPairs=0; DeltaLonePairs=0; DeltaRadicals=0; DeltaE=0; DeltaQ=0; radical parity=0 | yes |
diazomethane_esterification_composeV | exchange/compositions/diazomethane_esterification_composeV.egml | diazomethane_proton_transfer + diazomethane_methyl_transfer_after_proton_context -> diazomethane_esterification_macro | DeltaV=0; DeltaPairs=0; DeltaLonePairs=0; DeltaRadicals=0; DeltaE=0; DeltaQ=0; radical parity=0 | DeltaV=0; DeltaPairs=0; DeltaLonePairs=0; DeltaRadicals=0; DeltaE=0; DeltaQ=0; radical parity=0 | yes |
radical_abstraction_recombination_partial_composeV | exchange/compositions/radical_abstraction_recombination_partial_composeV.egml | chlorine_h_abstraction_with_external_methyl + radical_recombination_with_hcl_context -> radical_abstraction_recombination_partial_macro | DeltaV=0; DeltaPairs=+1; DeltaLonePairs=0; DeltaRadicals=-2; DeltaE=0; DeltaQ=0; radical parity=0 | DeltaV=0; DeltaPairs=+1; DeltaLonePairs=0; DeltaRadicals=-2; DeltaE=0; DeltaQ=0; radical parity=0 | yes |
Specific Chemical Examples
Elementary DPO applications over concrete chemical hosts.
Cyclopropanation DPO
RDKit molecule quick view
| Host | Product |
|---|---|
RDKit viewDOT viewclick image to switch representation |
RDKit viewDOT viewclick image to switch representation |
Chemistry: Cl2C: + C=C -> dichlorocyclopropane
The rule requires the singlet carbene lone-pair loop and consumes one alkene shared pair.
Atom map: L1->H1, L2->H2, L3->H3, L4->H4, L5->H5
Feature map: L1->H1, L2->H2, L3->H10, L4->H3, L5->H11
Atom/H counts: L: atoms=5, H=0; K: atoms=5, H=0; R: atoms=5, H=0; H: atoms=9, H=4; D: atoms=9, H=4; H': atoms=9, H=4
Scope: L/K/R are rule fragments. H/D/H' are full application graphs, so hydrogens not shown in a rule fragment are preserved context atoms there.
Formal electron-feature DPO view
| L rule fragment | K interface | R rule fragment |
|---|---|---|
| H full host | D pushout complement | H' full product |
Chemical/DOT companion view
| L rule fragment | K interface | R rule fragment |
|---|---|---|
Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
| H full host | D pushout complement | H' full product |
RDKit viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
RDKit viewDOT viewclick image to switch representation |
RDKit host/product views
| Host | Product |
|---|---|
RDKit viewDOT viewclick image to switch representation |
RDKit viewDOT viewclick image to switch representation |
Diazomethane proton-transfer DPO
RDKit molecule quick view
| Host | Product |
|---|---|
RDKit viewDOT viewclick image to switch representation |
RDKit viewDOT viewclick image to switch representation |
Chemistry: CH2N2 + RCO2H -> [CH3N2+][RCO2-]
The rule consumes the diazomethane carbon lone-pair loop and the acid O-H shared pair.
Atom map: L1->H1, L2->H2, L3->H3, L4->H12, L5->H13
Feature map: L1->H1, L2->H2, L3->H3, L4->H4, L5->H7, L6->H16
Atom/H counts: L: atoms=5, H=1; K: atoms=5, H=1; R: atoms=5, H=1; H: atoms=13, H=6; D: atoms=13, H=6; H': atoms=13, H=6
Scope: L/K/R are rule fragments. H/D/H' are full application graphs, so hydrogens not shown in a rule fragment are preserved context atoms there.
Formal electron-feature DPO view
| L rule fragment | K interface | R rule fragment |
|---|---|---|
| H full host | D pushout complement | H' full product |
Chemical/DOT companion view
| L rule fragment | K interface | R rule fragment |
|---|---|---|
Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
| H full host | D pushout complement | H' full product |
RDKit viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
RDKit viewDOT viewclick image to switch representation |
RDKit host/product views
| Host | Product |
|---|---|
RDKit viewDOT viewclick image to switch representation |
RDKit viewDOT viewclick image to switch representation |
Diazomethane azo-form proton-transfer DPO
RDKit molecule quick view
| Host | Product |
|---|---|
RDKit viewDOT viewclick image to switch representation |
RDKit viewDOT viewclick image to switch representation |
Chemistry: H2C=N+=N- + RCO2H -> CH3-N+=N + RCO2-
The exact azo-form rule deletes one C=N shared pair, one terminal-N lone-pair loop, and the acid O-H pair.
Atom map: L1->H1, L2->H2, L3->H3, L4->H12, L5->H13
Feature map: L1->H1, L2->H3, L3->H4, L4->H7, L5->H2, L6->H8, L7->H16
Atom/H counts: L: atoms=5, H=1; K: atoms=5, H=1; R: atoms=5, H=1; H: atoms=13, H=6; D: atoms=13, H=6; H': atoms=13, H=6
Scope: L/K/R are rule fragments. H/D/H' are full application graphs, so hydrogens not shown in a rule fragment are preserved context atoms there.
Formal electron-feature DPO view
| L rule fragment | K interface | R rule fragment |
|---|---|---|
| H full host | D pushout complement | H' full product |
Chemical/DOT companion view
| L rule fragment | K interface | R rule fragment |
|---|---|---|
Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
| H full host | D pushout complement | H' full product |
RDKit viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
RDKit viewDOT viewclick image to switch representation |
RDKit host/product views
| Host | Product |
|---|---|
RDKit viewDOT viewclick image to switch representation |
RDKit viewDOT viewclick image to switch representation |
Diazomethane methyl-transfer DPO
RDKit molecule quick view
| Host | Product |
|---|---|
RDKit viewDOT viewclick image to switch representation |
RDKit viewDOT viewclick image to switch representation |
Chemistry: [CH3N2+][RCO2-] -> RCO2CH3 + N2
The rule consumes one carboxylate oxygen lone pair and the C-N shared pair, then restores a lone pair on the departing inner nitrogen.
Atom map: L1->H4, L2->H1, L3->H2, L4->H3
Feature map: L1->H2, L2->H3, L3->H4, L4->H5, L5->H1
Atom/H counts: L: atoms=4, H=0; K: atoms=4, H=0; R: atoms=4, H=0; H: atoms=13, H=6; D: atoms=13, H=6; H': atoms=13, H=6
Scope: L/K/R are rule fragments. H/D/H' are full application graphs, so hydrogens not shown in a rule fragment are preserved context atoms there.
Formal electron-feature DPO view
| L rule fragment | K interface | R rule fragment |
|---|---|---|
| H full host | D pushout complement | H' full product |
Chemical/DOT companion view
| L rule fragment | K interface | R rule fragment |
|---|---|---|
Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
| H full host | D pushout complement | H' full product |
RDKit viewDOT viewclick image to switch representation |
Fragment viewDOT viewclick image to switch representation |
RDKit viewDOT viewclick image to switch representation |
RDKit host/product views
| Host | Product |
|---|---|
RDKit viewDOT viewclick image to switch representation |
RDKit viewDOT viewclick image to switch representation |
Molecules And States
Each molecule/state panel is clickable and switches between the chemical depiction and the electron-feature DOT graph.
Diazomethane Pathway
Substrate, ion-pair intermediates, and esterification products.
After diazomethane proton transfer
After diazomethane methyl transfer
Exact azo-form diazomethane plus acid
Radicals And Carbenes
Open-shell and carbene states used by the local and DPO rules.
Methylene singlet
Methylene triplet from rule
Chlorine radical plus methane
HCl plus methyl radical
Chlorine radical plus methane plus methyl radical
Radical chain after H abstraction
HCl plus ethane
Allyl radical start
Methyl radical pair
Ethane from radical recombination
Reference And Verification States
Closed-shell and charge-transfer examples used as sanity checks.
Formose host start
Formose after keto-enol step
Formose after aldol step
Hydronium/hydroxide ion pair
Two waters after neutralization
Other Molecule States
Additional generated states in the figure bundle.
Allyl radical shifted
Minimal Julia Snippets
Minimal Julia: apply an EGML rule
include("ElectronGraphs.jl")
using .ElectronGraphs
host = load_graph_egml("examples/graphs/methyl_radical_pair.egml")
rule = load_rule_egml("examples/rules/radical_recombination.egml")
app = apply_egml_rule(rule, host)
product = app.product
Minimal Julia: compose partial DPO rules
using AlgebraicRewriting
include("ElectronDPO.jl")
const D = ElectronDPO
first = D.open_rule_from_span(D.chlorine_h_abstraction_with_external_methyl_span_parts()...)
second = D.open_rule_from_span(D.radical_recombination_with_hcl_context_span_parts()...)
macro_open = composeV_(first, second)
macro_rule, _, L, _ = D.closed_rule_from_open_rule(macro_open)
host = D.radical_abstraction_recombination_host()
m = D.radical_abstraction_recombination_match(L, host)
product = rewrite_match(macro_rule, m; cat=D.EG.electron_cat())
Generated Exchange Files
Raw EGML Appendix
Graphs
exchange/graphs/diazomethane_after_methyl_transfer.egml
graph [
graphID "diazomethane_after_methyl_transfer"
node [ id 1 label "O" ]
node [ id 2 label "C" ]
node [ id 3 label "N" ]
node [ id 4 label "N" ]
node [ id 5 label "H" ]
node [ id 6 label "H" ]
node [ id 7 label "H" ]
node [ id 8 label "C" ]
node [ id 9 label "H" ]
node [ id 10 label "H" ]
node [ id 11 label "H" ]
node [ id 12 label "C" ]
node [ id 13 label "O" ]
edge [ id 1 source 3 target 4 label "pair" ]
edge [ id 2 source 3 target 4 label "pair" ]
edge [ id 3 source 3 target 4 label "pair" ]
edge [ id 4 source 1 target 2 label "pair" ]
loop [ id 5 node 3 label "lp" ]
edge [ id 6 source 2 target 5 label "pair" ]
edge [ id 7 source 2 target 6 label "pair" ]
edge [ id 8 source 2 target 7 label "pair" ]
loop [ id 9 node 4 label "lp" ]
edge [ id 10 source 8 target 9 label "pair" ]
edge [ id 11 source 8 target 10 label "pair" ]
edge [ id 12 source 8 target 11 label "pair" ]
edge [ id 13 source 8 target 12 label "pair" ]
edge [ id 14 source 12 target 13 label "pair" ]
edge [ id 15 source 12 target 13 label "pair" ]
edge [ id 16 source 12 target 1 label "pair" ]
loop [ id 17 node 13 label "lp" ]
loop [ id 18 node 13 label "lp" ]
loop [ id 19 node 1 label "lp" ]
loop [ id 20 node 1 label "lp" ]
]
exchange/graphs/diazomethane_after_proton_transfer.egml
graph [
graphID "diazomethane_after_proton_transfer"
node [ id 1 label "C" ]
node [ id 2 label "N" ]
node [ id 3 label "N" ]
node [ id 4 label "O" ]
node [ id 5 label "H" ]
node [ id 6 label "H" ]
node [ id 7 label "H" ]
node [ id 8 label "C" ]
node [ id 9 label "H" ]
node [ id 10 label "H" ]
node [ id 11 label "H" ]
node [ id 12 label "C" ]
node [ id 13 label "O" ]
edge [ id 1 source 1 target 2 label "pair" ]
edge [ id 2 source 2 target 3 label "pair" ]
edge [ id 3 source 2 target 3 label "pair" ]
edge [ id 4 source 2 target 3 label "pair" ]
loop [ id 5 node 4 label "lp" ]
edge [ id 6 source 1 target 5 label "pair" ]
edge [ id 7 source 1 target 6 label "pair" ]
edge [ id 8 source 1 target 7 label "pair" ]
loop [ id 9 node 3 label "lp" ]
edge [ id 10 source 8 target 9 label "pair" ]
edge [ id 11 source 8 target 10 label "pair" ]
edge [ id 12 source 8 target 11 label "pair" ]
edge [ id 13 source 8 target 12 label "pair" ]
edge [ id 14 source 12 target 13 label "pair" ]
edge [ id 15 source 12 target 13 label "pair" ]
edge [ id 16 source 12 target 4 label "pair" ]
loop [ id 17 node 13 label "lp" ]
loop [ id 18 node 13 label "lp" ]
loop [ id 19 node 4 label "lp" ]
loop [ id 20 node 4 label "lp" ]
]
exchange/graphs/diazomethane_azo_after_proton_transfer.egml
graph [
graphID "diazomethane_azo_after_proton_transfer"
node [ id 1 label "C" ]
node [ id 2 label "N" ]
node [ id 3 label "N" ]
node [ id 4 label "O" ]
node [ id 5 label "H" ]
node [ id 6 label "H" ]
node [ id 7 label "H" ]
node [ id 8 label "C" ]
node [ id 9 label "H" ]
node [ id 10 label "H" ]
node [ id 11 label "H" ]
node [ id 12 label "C" ]
node [ id 13 label "O" ]
edge [ id 1 source 1 target 2 label "pair" ]
edge [ id 2 source 2 target 3 label "pair" ]
edge [ id 3 source 2 target 3 label "pair" ]
loop [ id 4 node 3 label "lp" ]
edge [ id 5 source 2 target 3 label "pair" ]
loop [ id 6 node 4 label "lp" ]
edge [ id 7 source 1 target 5 label "pair" ]
edge [ id 8 source 1 target 6 label "pair" ]
edge [ id 9 source 1 target 7 label "pair" ]
edge [ id 10 source 8 target 9 label "pair" ]
edge [ id 11 source 8 target 10 label "pair" ]
edge [ id 12 source 8 target 11 label "pair" ]
edge [ id 13 source 8 target 12 label "pair" ]
edge [ id 14 source 12 target 13 label "pair" ]
edge [ id 15 source 12 target 13 label "pair" ]
edge [ id 16 source 12 target 4 label "pair" ]
loop [ id 17 node 13 label "lp" ]
loop [ id 18 node 13 label "lp" ]
loop [ id 19 node 4 label "lp" ]
loop [ id 20 node 4 label "lp" ]
]
exchange/graphs/diazomethane_azo_esterification_host.egml
graph [
graphID "diazomethane_azo_esterification_host"
node [ id 1 label "C" ]
node [ id 2 label "N" ]
node [ id 3 label "N" ]
node [ id 4 label "H" ]
node [ id 5 label "H" ]
node [ id 6 label "C" ]
node [ id 7 label "H" ]
node [ id 8 label "H" ]
node [ id 9 label "H" ]
node [ id 10 label "C" ]
node [ id 11 label "O" ]
node [ id 12 label "O" ]
node [ id 13 label "H" ]
edge [ id 1 source 1 target 2 label "pair" ]
edge [ id 2 source 1 target 2 label "pair" ]
edge [ id 3 source 2 target 3 label "pair" ]
edge [ id 4 source 2 target 3 label "pair" ]
edge [ id 5 source 1 target 4 label "pair" ]
edge [ id 6 source 1 target 5 label "pair" ]
loop [ id 7 node 3 label "lp" ]
loop [ id 8 node 3 label "lp" ]
edge [ id 9 source 6 target 7 label "pair" ]
edge [ id 10 source 6 target 8 label "pair" ]
edge [ id 11 source 6 target 9 label "pair" ]
edge [ id 12 source 6 target 10 label "pair" ]
edge [ id 13 source 10 target 11 label "pair" ]
edge [ id 14 source 10 target 11 label "pair" ]
edge [ id 15 source 10 target 12 label "pair" ]
edge [ id 16 source 12 target 13 label "pair" ]
loop [ id 17 node 11 label "lp" ]
loop [ id 18 node 11 label "lp" ]
loop [ id 19 node 12 label "lp" ]
loop [ id 20 node 12 label "lp" ]
]
exchange/graphs/diazomethane_esterification_host.egml
graph [
graphID "diazomethane_esterification_host"
node [ id 1 label "C" ]
node [ id 2 label "N" ]
node [ id 3 label "N" ]
node [ id 4 label "H" ]
node [ id 5 label "H" ]
node [ id 6 label "C" ]
node [ id 7 label "H" ]
node [ id 8 label "H" ]
node [ id 9 label "H" ]
node [ id 10 label "C" ]
node [ id 11 label "O" ]
node [ id 12 label "O" ]
node [ id 13 label "H" ]
edge [ id 1 source 1 target 2 label "pair" ]
edge [ id 2 source 2 target 3 label "pair" ]
edge [ id 3 source 2 target 3 label "pair" ]
edge [ id 4 source 2 target 3 label "pair" ]
edge [ id 5 source 1 target 4 label "pair" ]
edge [ id 6 source 1 target 5 label "pair" ]
loop [ id 7 node 1 label "lp" ]
loop [ id 8 node 3 label "lp" ]
edge [ id 9 source 6 target 7 label "pair" ]
edge [ id 10 source 6 target 8 label "pair" ]
edge [ id 11 source 6 target 9 label "pair" ]
edge [ id 12 source 6 target 10 label "pair" ]
edge [ id 13 source 10 target 11 label "pair" ]
edge [ id 14 source 10 target 11 label "pair" ]
edge [ id 15 source 10 target 12 label "pair" ]
edge [ id 16 source 12 target 13 label "pair" ]
loop [ id 17 node 11 label "lp" ]
loop [ id 18 node 11 label "lp" ]
loop [ id 19 node 12 label "lp" ]
loop [ id 20 node 12 label "lp" ]
]
exchange/graphs/radical_chain_after_abstraction.egml
graph [
graphID "radical_chain_after_abstraction"
node [ id 1 label "Cl" ]
node [ id 2 label "C" ]
node [ id 3 label "H" ]
node [ id 4 label "H" ]
node [ id 5 label "H" ]
node [ id 6 label "H" ]
node [ id 7 label "C" ]
node [ id 8 label "H" ]
node [ id 9 label "H" ]
node [ id 10 label "H" ]
loop [ id 1 node 1 label "lp" ]
loop [ id 2 node 1 label "lp" ]
loop [ id 3 node 1 label "lp" ]
edge [ id 4 source 2 target 4 label "pair" ]
edge [ id 5 source 2 target 5 label "pair" ]
edge [ id 6 source 2 target 6 label "pair" ]
edge [ id 7 source 7 target 8 label "pair" ]
edge [ id 8 source 7 target 9 label "pair" ]
edge [ id 9 source 7 target 10 label "pair" ]
halfedge [ id 10 node 7 label "rad" ]
edge [ id 11 source 1 target 3 label "pair" ]
halfedge [ id 12 node 2 label "rad" ]
]
exchange/graphs/radical_chain_host.egml
graph [
graphID "radical_chain_host"
node [ id 1 label "Cl" ]
node [ id 2 label "C" ]
node [ id 3 label "H" ]
node [ id 4 label "H" ]
node [ id 5 label "H" ]
node [ id 6 label "H" ]
node [ id 7 label "C" ]
node [ id 8 label "H" ]
node [ id 9 label "H" ]
node [ id 10 label "H" ]
loop [ id 1 node 1 label "lp" ]
loop [ id 2 node 1 label "lp" ]
loop [ id 3 node 1 label "lp" ]
halfedge [ id 4 node 1 label "rad" ]
edge [ id 5 source 2 target 3 label "pair" ]
edge [ id 6 source 2 target 4 label "pair" ]
edge [ id 7 source 2 target 5 label "pair" ]
edge [ id 8 source 2 target 6 label "pair" ]
edge [ id 9 source 7 target 8 label "pair" ]
edge [ id 10 source 7 target 9 label "pair" ]
edge [ id 11 source 7 target 10 label "pair" ]
halfedge [ id 12 node 7 label "rad" ]
]
exchange/graphs/radical_chain_product.egml
graph [
graphID "radical_chain_product"
node [ id 1 label "Cl" ]
node [ id 2 label "C" ]
node [ id 3 label "H" ]
node [ id 4 label "H" ]
node [ id 5 label "H" ]
node [ id 6 label "H" ]
node [ id 7 label "C" ]
node [ id 8 label "H" ]
node [ id 9 label "H" ]
node [ id 10 label "H" ]
loop [ id 1 node 1 label "lp" ]
loop [ id 2 node 1 label "lp" ]
loop [ id 3 node 1 label "lp" ]
edge [ id 4 source 2 target 4 label "pair" ]
edge [ id 5 source 2 target 5 label "pair" ]
edge [ id 6 source 2 target 6 label "pair" ]
edge [ id 7 source 7 target 8 label "pair" ]
edge [ id 8 source 7 target 9 label "pair" ]
edge [ id 9 source 7 target 10 label "pair" ]
edge [ id 10 source 1 target 3 label "pair" ]
edge [ id 11 source 2 target 7 label "pair" ]
]
Rules
exchange/rules/chlorine_h_abstraction.egml
rule [
ruleID "chlorine_h_abstraction"
note "Consumes the chlorine radical halfedge and one methane C-H shared pair; creates H-Cl and a methyl radical halfedge."
extension "loops encode lone pairs; halfedges encode radicals"
interface [
node [ id 1 label "Cl" ]
node [ id 2 label "C" ]
node [ id 3 label "H" ]
node [ id 4 label "H" ]
node [ id 5 label "H" ]
node [ id 6 label "H" ]
loop [ id 1 node 1 label "lp" ]
loop [ id 2 node 1 label "lp" ]
loop [ id 3 node 1 label "lp" ]
edge [ id 4 source 2 target 4 label "pair" ]
edge [ id 5 source 2 target 5 label "pair" ]
edge [ id 6 source 2 target 6 label "pair" ]
]
left [
node [ id 1 label "Cl" ]
node [ id 2 label "C" ]
node [ id 3 label "H" ]
node [ id 4 label "H" ]
node [ id 5 label "H" ]
node [ id 6 label "H" ]
loop [ id 1 node 1 label "lp" ]
loop [ id 2 node 1 label "lp" ]
loop [ id 3 node 1 label "lp" ]
edge [ id 4 source 2 target 4 label "pair" ]
edge [ id 5 source 2 target 5 label "pair" ]
edge [ id 6 source 2 target 6 label "pair" ]
halfedge [ id 7 node 1 label "rad" ]
edge [ id 8 source 2 target 3 label "pair" ]
]
right [
node [ id 1 label "Cl" ]
node [ id 2 label "H" ]
node [ id 3 label "C" ]
node [ id 4 label "H" ]
node [ id 5 label "H" ]
node [ id 6 label "H" ]
edge [ id 1 source 1 target 2 label "pair" ]
loop [ id 2 node 1 label "lp" ]
loop [ id 3 node 1 label "lp" ]
loop [ id 4 node 1 label "lp" ]
edge [ id 5 source 3 target 4 label "pair" ]
edge [ id 6 source 3 target 5 label "pair" ]
edge [ id 7 source 3 target 6 label "pair" ]
halfedge [ id 8 node 3 label "rad" ]
]
interfaceToLeft [
atom [ interface 1 target 1 ]
atom [ interface 2 target 2 ]
atom [ interface 3 target 3 ]
atom [ interface 4 target 4 ]
atom [ interface 5 target 5 ]
atom [ interface 6 target 6 ]
feature [ interface 1 target 1 ]
feature [ interface 2 target 2 ]
feature [ interface 3 target 3 ]
feature [ interface 4 target 4 ]
feature [ interface 5 target 5 ]
feature [ interface 6 target 6 ]
attachment [ interface 1 target 1 ]
attachment [ interface 2 target 2 ]
attachment [ interface 3 target 3 ]
attachment [ interface 4 target 4 ]
attachment [ interface 5 target 5 ]
attachment [ interface 6 target 6 ]
attachment [ interface 7 target 7 ]
attachment [ interface 8 target 8 ]
attachment [ interface 9 target 9 ]
]
interfaceToRight [
atom [ interface 1 target 1 ]
atom [ interface 2 target 3 ]
atom [ interface 3 target 2 ]
atom [ interface 4 target 4 ]
atom [ interface 5 target 5 ]
atom [ interface 6 target 6 ]
feature [ interface 1 target 2 ]
feature [ interface 2 target 3 ]
feature [ interface 3 target 4 ]
feature [ interface 4 target 5 ]
feature [ interface 5 target 6 ]
feature [ interface 6 target 7 ]
attachment [ interface 1 target 3 ]
attachment [ interface 2 target 4 ]
attachment [ interface 3 target 5 ]
attachment [ interface 4 target 6 ]
attachment [ interface 5 target 7 ]
attachment [ interface 6 target 8 ]
attachment [ interface 7 target 9 ]
attachment [ interface 8 target 10 ]
attachment [ interface 9 target 11 ]
]
]
exchange/rules/chlorine_h_abstraction_with_external_methyl.egml
rule [
ruleID "chlorine_h_abstraction_with_external_methyl"
note "Chlorine abstraction rule with an external methyl radical carried as identity context for partial composition."
extension "loops encode lone pairs; halfedges encode radicals"
interface [
node [ id 1 label "Cl" ]
node [ id 2 label "C" ]
node [ id 3 label "H" ]
node [ id 4 label "H" ]
node [ id 5 label "H" ]
node [ id 6 label "H" ]
node [ id 7 label "C" ]
node [ id 8 label "H" ]
node [ id 9 label "H" ]
node [ id 10 label "H" ]
loop [ id 1 node 1 label "lp" ]
loop [ id 2 node 1 label "lp" ]
loop [ id 3 node 1 label "lp" ]
edge [ id 4 source 2 target 4 label "pair" ]
edge [ id 5 source 2 target 5 label "pair" ]
edge [ id 6 source 2 target 6 label "pair" ]
edge [ id 7 source 7 target 8 label "pair" ]
edge [ id 8 source 7 target 9 label "pair" ]
edge [ id 9 source 7 target 10 label "pair" ]
halfedge [ id 10 node 7 label "rad" ]
]
left [
node [ id 1 label "Cl" ]
node [ id 2 label "C" ]
node [ id 3 label "H" ]
node [ id 4 label "H" ]
node [ id 5 label "H" ]
node [ id 6 label "H" ]
node [ id 7 label "C" ]
node [ id 8 label "H" ]
node [ id 9 label "H" ]
node [ id 10 label "H" ]
loop [ id 1 node 1 label "lp" ]
loop [ id 2 node 1 label "lp" ]
loop [ id 3 node 1 label "lp" ]
edge [ id 4 source 2 target 4 label "pair" ]
edge [ id 5 source 2 target 5 label "pair" ]
edge [ id 6 source 2 target 6 label "pair" ]
halfedge [ id 7 node 1 label "rad" ]
edge [ id 8 source 2 target 3 label "pair" ]
edge [ id 9 source 7 target 8 label "pair" ]
edge [ id 10 source 7 target 9 label "pair" ]
edge [ id 11 source 7 target 10 label "pair" ]
halfedge [ id 12 node 7 label "rad" ]
]
right [
node [ id 1 label "Cl" ]
node [ id 2 label "H" ]
node [ id 3 label "C" ]
node [ id 4 label "H" ]
node [ id 5 label "H" ]
node [ id 6 label "H" ]
node [ id 7 label "C" ]
node [ id 8 label "H" ]
node [ id 9 label "H" ]
node [ id 10 label "H" ]
edge [ id 1 source 1 target 2 label "pair" ]
loop [ id 2 node 1 label "lp" ]
loop [ id 3 node 1 label "lp" ]
loop [ id 4 node 1 label "lp" ]
edge [ id 5 source 3 target 4 label "pair" ]
edge [ id 6 source 3 target 5 label "pair" ]
edge [ id 7 source 3 target 6 label "pair" ]
halfedge [ id 8 node 3 label "rad" ]
edge [ id 9 source 7 target 8 label "pair" ]
edge [ id 10 source 7 target 9 label "pair" ]
edge [ id 11 source 7 target 10 label "pair" ]
halfedge [ id 12 node 7 label "rad" ]
]
interfaceToLeft [
atom [ interface 1 target 1 ]
atom [ interface 2 target 2 ]
atom [ interface 3 target 3 ]
atom [ interface 4 target 4 ]
atom [ interface 5 target 5 ]
atom [ interface 6 target 6 ]
atom [ interface 7 target 7 ]
atom [ interface 8 target 8 ]
atom [ interface 9 target 9 ]
atom [ interface 10 target 10 ]
feature [ interface 1 target 1 ]
feature [ interface 2 target 2 ]
feature [ interface 3 target 3 ]
feature [ interface 4 target 4 ]
feature [ interface 5 target 5 ]
feature [ interface 6 target 6 ]
feature [ interface 7 target 9 ]
feature [ interface 8 target 10 ]
feature [ interface 9 target 11 ]
feature [ interface 10 target 12 ]
attachment [ interface 1 target 1 ]
attachment [ interface 2 target 2 ]
attachment [ interface 3 target 3 ]
attachment [ interface 4 target 4 ]
attachment [ interface 5 target 5 ]
attachment [ interface 6 target 6 ]
attachment [ interface 7 target 7 ]
attachment [ interface 8 target 8 ]
attachment [ interface 9 target 9 ]
attachment [ interface 10 target 13 ]
attachment [ interface 11 target 14 ]
attachment [ interface 12 target 15 ]
attachment [ interface 13 target 16 ]
attachment [ interface 14 target 17 ]
attachment [ interface 15 target 18 ]
attachment [ interface 16 target 19 ]
]
interfaceToRight [
atom [ interface 1 target 1 ]
atom [ interface 2 target 3 ]
atom [ interface 3 target 2 ]
atom [ interface 4 target 4 ]
atom [ interface 5 target 5 ]
atom [ interface 6 target 6 ]
atom [ interface 7 target 7 ]
atom [ interface 8 target 8 ]
atom [ interface 9 target 9 ]
atom [ interface 10 target 10 ]
feature [ interface 1 target 2 ]
feature [ interface 2 target 3 ]
feature [ interface 3 target 4 ]
feature [ interface 4 target 5 ]
feature [ interface 5 target 6 ]
feature [ interface 6 target 7 ]
feature [ interface 7 target 9 ]
feature [ interface 8 target 10 ]
feature [ interface 9 target 11 ]
feature [ interface 10 target 12 ]
attachment [ interface 1 target 3 ]
attachment [ interface 2 target 4 ]
attachment [ interface 3 target 5 ]
attachment [ interface 4 target 6 ]
attachment [ interface 5 target 7 ]
attachment [ interface 6 target 8 ]
attachment [ interface 7 target 9 ]
attachment [ interface 8 target 10 ]
attachment [ interface 9 target 11 ]
attachment [ interface 10 target 13 ]
attachment [ interface 11 target 14 ]
attachment [ interface 12 target 15 ]
attachment [ interface 13 target 16 ]
attachment [ interface 14 target 17 ]
attachment [ interface 15 target 18 ]
attachment [ interface 16 target 19 ]
]
]
exchange/rules/diazomethane_azo_esterification_macro.egml
rule [
ruleID "diazomethane_azo_esterification_macro"
note "Direct rule from exact H2C=N+=N- substrate form to ester plus N2 generated by AlgebraicRewriting.composeV_ from the exact azo-form proton-transfer step and the methyl-transfer step with preserved context."
extension "loops encode lone pairs; halfedges encode radicals"
interface [
node [ id 1 label "C" ]
node [ id 2 label "N" ]
node [ id 3 label "N" ]
node [ id 4 label "O" ]
node [ id 5 label "H" ]
edge [ id 1 source 2 target 3 label "pair" ]
edge [ id 2 source 2 target 3 label "pair" ]
loop [ id 3 node 3 label "lp" ]
]
left [
node [ id 1 label "C" ]
node [ id 2 label "N" ]
node [ id 3 label "N" ]
node [ id 4 label "O" ]
node [ id 5 label "H" ]
edge [ id 1 source 1 target 2 label "pair" ]
edge [ id 2 source 2 target 3 label "pair" ]
edge [ id 3 source 2 target 3 label "pair" ]
loop [ id 4 node 3 label "lp" ]
edge [ id 5 source 1 target 2 label "pair" ]
loop [ id 6 node 3 label "lp" ]
edge [ id 7 source 4 target 5 label "pair" ]
]
right [
node [ id 1 label "C" ]
node [ id 2 label "N" ]
node [ id 3 label "N" ]
node [ id 4 label "O" ]
node [ id 5 label "H" ]
edge [ id 1 source 2 target 3 label "pair" ]
edge [ id 2 source 2 target 3 label "pair" ]
edge [ id 3 source 2 target 3 label "pair" ]
loop [ id 4 node 3 label "lp" ]
edge [ id 5 source 1 target 5 label "pair" ]
edge [ id 6 source 4 target 1 label "pair" ]
loop [ id 7 node 2 label "lp" ]
]
interfaceToLeft [
atom [ interface 1 target 1 ]
atom [ interface 2 target 2 ]
atom [ interface 3 target 3 ]
atom [ interface 4 target 4 ]
atom [ interface 5 target 5 ]
feature [ interface 1 target 2 ]
feature [ interface 2 target 3 ]
feature [ interface 3 target 4 ]
attachment [ interface 1 target 3 ]
attachment [ interface 2 target 4 ]
attachment [ interface 3 target 5 ]
attachment [ interface 4 target 6 ]
attachment [ interface 5 target 7 ]
]
interfaceToRight [
atom [ interface 1 target 1 ]
atom [ interface 2 target 2 ]
atom [ interface 3 target 3 ]
atom [ interface 4 target 4 ]
atom [ interface 5 target 5 ]
feature [ interface 1 target 1 ]
feature [ interface 2 target 2 ]
feature [ interface 3 target 4 ]
attachment [ interface 1 target 1 ]
attachment [ interface 2 target 2 ]
attachment [ interface 3 target 3 ]
attachment [ interface 4 target 4 ]
attachment [ interface 5 target 7 ]
]
]
exchange/rules/diazomethane_azo_proton_transfer.egml
rule [
ruleID "diazomethane_azo_proton_transfer"
note "Exact H2C=N+=N- resonance-form proton transfer: consumes one C=N shared pair, one terminal-N lone-pair loop, and the acid O-H shared pair; creates the third N=N shared pair, an oxygen lone-pair loop, and a C-H shared pair."
extension "loops encode lone pairs; halfedges encode radicals"
interface [
node [ id 1 label "C" ]
node [ id 2 label "N" ]
node [ id 3 label "N" ]
node [ id 4 label "O" ]
node [ id 5 label "H" ]
edge [ id 1 source 1 target 2 label "pair" ]
edge [ id 2 source 2 target 3 label "pair" ]
edge [ id 3 source 2 target 3 label "pair" ]
loop [ id 4 node 3 label "lp" ]
]
left [
node [ id 1 label "C" ]
node [ id 2 label "N" ]
node [ id 3 label "N" ]
node [ id 4 label "O" ]
node [ id 5 label "H" ]
edge [ id 1 source 1 target 2 label "pair" ]
edge [ id 2 source 2 target 3 label "pair" ]
edge [ id 3 source 2 target 3 label "pair" ]
loop [ id 4 node 3 label "lp" ]
edge [ id 5 source 1 target 2 label "pair" ]
loop [ id 6 node 3 label "lp" ]
edge [ id 7 source 4 target 5 label "pair" ]
]
right [
node [ id 1 label "C" ]
node [ id 2 label "N" ]
node [ id 3 label "N" ]
node [ id 4 label "O" ]
node [ id 5 label "H" ]
edge [ id 1 source 1 target 2 label "pair" ]
edge [ id 2 source 2 target 3 label "pair" ]
edge [ id 3 source 2 target 3 label "pair" ]
loop [ id 4 node 3 label "lp" ]
edge [ id 5 source 2 target 3 label "pair" ]
loop [ id 6 node 4 label "lp" ]
edge [ id 7 source 1 target 5 label "pair" ]
]
interfaceToLeft [
atom [ interface 1 target 1 ]
atom [ interface 2 target 2 ]
atom [ interface 3 target 3 ]
atom [ interface 4 target 4 ]
atom [ interface 5 target 5 ]
feature [ interface 1 target 1 ]
feature [ interface 2 target 2 ]
feature [ interface 3 target 3 ]
feature [ interface 4 target 4 ]
attachment [ interface 1 target 1 ]
attachment [ interface 2 target 2 ]
attachment [ interface 3 target 3 ]
attachment [ interface 4 target 4 ]
attachment [ interface 5 target 5 ]
attachment [ interface 6 target 6 ]
attachment [ interface 7 target 7 ]
]
interfaceToRight [
atom [ interface 1 target 1 ]
atom [ interface 2 target 2 ]
atom [ interface 3 target 3 ]
atom [ interface 4 target 4 ]
atom [ interface 5 target 5 ]
feature [ interface 1 target 1 ]
feature [ interface 2 target 2 ]
feature [ interface 3 target 3 ]
feature [ interface 4 target 4 ]
attachment [ interface 1 target 1 ]
attachment [ interface 2 target 2 ]
attachment [ interface 3 target 3 ]
attachment [ interface 4 target 4 ]
attachment [ interface 5 target 5 ]
attachment [ interface 6 target 6 ]
attachment [ interface 7 target 7 ]
]
]
exchange/rules/diazomethane_esterification_macro.egml
rule [
ruleID "diazomethane_esterification_macro"
note "Direct rule from substrate to ester plus N2 generated by AlgebraicRewriting.composeV_ from the two DPO steps."
extension "loops encode lone pairs; halfedges encode radicals"
interface [
node [ id 1 label "C" ]
node [ id 2 label "N" ]
node [ id 3 label "N" ]
node [ id 4 label "O" ]
node [ id 5 label "H" ]
edge [ id 1 source 2 target 3 label "pair" ]
edge [ id 2 source 2 target 3 label "pair" ]
edge [ id 3 source 2 target 3 label "pair" ]
]
left [
node [ id 1 label "C" ]
node [ id 2 label "N" ]
node [ id 3 label "N" ]
node [ id 4 label "O" ]
node [ id 5 label "H" ]
edge [ id 1 source 1 target 2 label "pair" ]
edge [ id 2 source 2 target 3 label "pair" ]
edge [ id 3 source 2 target 3 label "pair" ]
edge [ id 4 source 2 target 3 label "pair" ]
loop [ id 5 node 1 label "lp" ]
edge [ id 6 source 4 target 5 label "pair" ]
]
right [
node [ id 1 label "C" ]
node [ id 2 label "N" ]
node [ id 3 label "N" ]
node [ id 4 label "O" ]
node [ id 5 label "H" ]
edge [ id 1 source 2 target 3 label "pair" ]
edge [ id 2 source 2 target 3 label "pair" ]
edge [ id 3 source 2 target 3 label "pair" ]
edge [ id 4 source 1 target 5 label "pair" ]
edge [ id 5 source 4 target 1 label "pair" ]
loop [ id 6 node 2 label "lp" ]
]
interfaceToLeft [
atom [ interface 1 target 1 ]
atom [ interface 2 target 2 ]
atom [ interface 3 target 3 ]
atom [ interface 4 target 4 ]
atom [ interface 5 target 5 ]
feature [ interface 1 target 2 ]
feature [ interface 2 target 3 ]
feature [ interface 3 target 4 ]
attachment [ interface 1 target 3 ]
attachment [ interface 2 target 4 ]
attachment [ interface 3 target 5 ]
attachment [ interface 4 target 6 ]
attachment [ interface 5 target 7 ]
attachment [ interface 6 target 8 ]
]
interfaceToRight [
atom [ interface 1 target 1 ]
atom [ interface 2 target 2 ]
atom [ interface 3 target 3 ]
atom [ interface 4 target 4 ]
atom [ interface 5 target 5 ]
feature [ interface 1 target 1 ]
feature [ interface 2 target 2 ]
feature [ interface 3 target 3 ]
attachment [ interface 1 target 1 ]
attachment [ interface 2 target 2 ]
attachment [ interface 3 target 3 ]
attachment [ interface 4 target 4 ]
attachment [ interface 5 target 5 ]
attachment [ interface 6 target 6 ]
]
]
exchange/rules/diazomethane_methyl_transfer.egml
rule [
ruleID "diazomethane_methyl_transfer"
note "Consumes one carboxylate oxygen lone pair and the C-N shared pair; creates the O-C shared pair and restores a lone pair on the inner nitrogen."
extension "loops encode lone pairs; halfedges encode radicals"
interface [
node [ id 1 label "O" ]
node [ id 2 label "C" ]
node [ id 3 label "N" ]
node [ id 4 label "N" ]
edge [ id 1 source 3 target 4 label "pair" ]
edge [ id 2 source 3 target 4 label "pair" ]
edge [ id 3 source 3 target 4 label "pair" ]
]
left [
node [ id 1 label "O" ]
node [ id 2 label "C" ]
node [ id 3 label "N" ]
node [ id 4 label "N" ]
edge [ id 1 source 3 target 4 label "pair" ]
edge [ id 2 source 3 target 4 label "pair" ]
edge [ id 3 source 3 target 4 label "pair" ]
loop [ id 4 node 1 label "lp" ]
edge [ id 5 source 2 target 3 label "pair" ]
]
right [
node [ id 1 label "O" ]
node [ id 2 label "C" ]
node [ id 3 label "N" ]
node [ id 4 label "N" ]
edge [ id 1 source 3 target 4 label "pair" ]
edge [ id 2 source 3 target 4 label "pair" ]
edge [ id 3 source 3 target 4 label "pair" ]
edge [ id 4 source 1 target 2 label "pair" ]
loop [ id 5 node 3 label "lp" ]
]
interfaceToLeft [
atom [ interface 1 target 1 ]
atom [ interface 2 target 2 ]
atom [ interface 3 target 3 ]
atom [ interface 4 target 4 ]
feature [ interface 1 target 1 ]
feature [ interface 2 target 2 ]
feature [ interface 3 target 3 ]
attachment [ interface 1 target 1 ]
attachment [ interface 2 target 2 ]
attachment [ interface 3 target 3 ]
attachment [ interface 4 target 4 ]
attachment [ interface 5 target 5 ]
attachment [ interface 6 target 6 ]
]
interfaceToRight [
atom [ interface 1 target 1 ]
atom [ interface 2 target 2 ]
atom [ interface 3 target 3 ]
atom [ interface 4 target 4 ]
feature [ interface 1 target 1 ]
feature [ interface 2 target 2 ]
feature [ interface 3 target 3 ]
attachment [ interface 1 target 1 ]
attachment [ interface 2 target 2 ]
attachment [ interface 3 target 3 ]
attachment [ interface 4 target 4 ]
attachment [ interface 5 target 5 ]
attachment [ interface 6 target 6 ]
]
]
exchange/rules/diazomethane_methyl_transfer_after_azo_context.egml
rule [
ruleID "diazomethane_methyl_transfer_after_azo_context"
note "Same methyl-transfer chemistry, but with the C-H pair and terminal-N lone-pair loop carried as preserved context so the exact azo-form proton-transfer result composes vertically."
extension "loops encode lone pairs; halfedges encode radicals"
interface [
node [ id 1 label "C" ]
node [ id 2 label "N" ]
node [ id 3 label "N" ]
node [ id 4 label "O" ]
node [ id 5 label "H" ]
edge [ id 1 source 2 target 3 label "pair" ]
edge [ id 2 source 2 target 3 label "pair" ]
edge [ id 3 source 2 target 3 label "pair" ]
loop [ id 4 node 3 label "lp" ]
edge [ id 5 source 1 target 5 label "pair" ]
]
left [
node [ id 1 label "C" ]
node [ id 2 label "N" ]
node [ id 3 label "N" ]
node [ id 4 label "O" ]
node [ id 5 label "H" ]
edge [ id 1 source 1 target 2 label "pair" ]
edge [ id 2 source 2 target 3 label "pair" ]
edge [ id 3 source 2 target 3 label "pair" ]
loop [ id 4 node 3 label "lp" ]
edge [ id 5 source 2 target 3 label "pair" ]
loop [ id 6 node 4 label "lp" ]
edge [ id 7 source 1 target 5 label "pair" ]
]
right [
node [ id 1 label "C" ]
node [ id 2 label "N" ]
node [ id 3 label "N" ]
node [ id 4 label "O" ]
node [ id 5 label "H" ]
edge [ id 1 source 2 target 3 label "pair" ]
edge [ id 2 source 2 target 3 label "pair" ]
edge [ id 3 source 2 target 3 label "pair" ]
loop [ id 4 node 3 label "lp" ]
edge [ id 5 source 1 target 5 label "pair" ]
edge [ id 6 source 4 target 1 label "pair" ]
loop [ id 7 node 2 label "lp" ]
]
interfaceToLeft [
atom [ interface 1 target 1 ]
atom [ interface 2 target 2 ]
atom [ interface 3 target 3 ]
atom [ interface 4 target 4 ]
atom [ interface 5 target 5 ]
feature [ interface 1 target 2 ]
feature [ interface 2 target 3 ]
feature [ interface 3 target 5 ]
feature [ interface 4 target 4 ]
feature [ interface 5 target 7 ]
attachment [ interface 1 target 3 ]
attachment [ interface 2 target 4 ]
attachment [ interface 3 target 5 ]
attachment [ interface 4 target 6 ]
attachment [ interface 5 target 8 ]
attachment [ interface 6 target 9 ]
attachment [ interface 7 target 7 ]
attachment [ interface 8 target 11 ]
attachment [ interface 9 target 12 ]
]
interfaceToRight [
atom [ interface 1 target 1 ]
atom [ interface 2 target 2 ]
atom [ interface 3 target 3 ]
atom [ interface 4 target 4 ]
atom [ interface 5 target 5 ]
feature [ interface 1 target 1 ]
feature [ interface 2 target 2 ]
feature [ interface 3 target 3 ]
feature [ interface 4 target 4 ]
feature [ interface 5 target 5 ]
attachment [ interface 1 target 1 ]
attachment [ interface 2 target 2 ]
attachment [ interface 3 target 3 ]
attachment [ interface 4 target 4 ]
attachment [ interface 5 target 5 ]
attachment [ interface 6 target 6 ]
attachment [ interface 7 target 7 ]
attachment [ interface 8 target 8 ]
attachment [ interface 9 target 9 ]
]
]
exchange/rules/diazomethane_methyl_transfer_after_proton_context.egml
rule [
ruleID "diazomethane_methyl_transfer_after_proton_context"
note "Same methyl-transfer chemistry, but with the newly created C-H pair carried as preserved context so the rule can compose vertically with proton transfer."
extension "loops encode lone pairs; halfedges encode radicals"
interface [
node [ id 1 label "C" ]
node [ id 2 label "N" ]
node [ id 3 label "N" ]
node [ id 4 label "O" ]
node [ id 5 label "H" ]
edge [ id 1 source 2 target 3 label "pair" ]
edge [ id 2 source 2 target 3 label "pair" ]
edge [ id 3 source 2 target 3 label "pair" ]
edge [ id 4 source 1 target 5 label "pair" ]
]
left [
node [ id 1 label "C" ]
node [ id 2 label "N" ]
node [ id 3 label "N" ]
node [ id 4 label "O" ]
node [ id 5 label "H" ]
edge [ id 1 source 1 target 2 label "pair" ]
edge [ id 2 source 2 target 3 label "pair" ]
edge [ id 3 source 2 target 3 label "pair" ]
edge [ id 4 source 2 target 3 label "pair" ]
loop [ id 5 node 4 label "lp" ]
edge [ id 6 source 1 target 5 label "pair" ]
]
right [
node [ id 1 label "C" ]
node [ id 2 label "N" ]
node [ id 3 label "N" ]
node [ id 4 label "O" ]
node [ id 5 label "H" ]
edge [ id 1 source 2 target 3 label "pair" ]
edge [ id 2 source 2 target 3 label "pair" ]
edge [ id 3 source 2 target 3 label "pair" ]
edge [ id 4 source 1 target 5 label "pair" ]
edge [ id 5 source 4 target 1 label "pair" ]
loop [ id 6 node 2 label "lp" ]
]
interfaceToLeft [
atom [ interface 1 target 1 ]
atom [ interface 2 target 2 ]
atom [ interface 3 target 3 ]
atom [ interface 4 target 4 ]
atom [ interface 5 target 5 ]
feature [ interface 1 target 2 ]
feature [ interface 2 target 3 ]
feature [ interface 3 target 4 ]
feature [ interface 4 target 6 ]
attachment [ interface 1 target 3 ]
attachment [ interface 2 target 4 ]
attachment [ interface 3 target 5 ]
attachment [ interface 4 target 6 ]
attachment [ interface 5 target 7 ]
attachment [ interface 6 target 8 ]
attachment [ interface 7 target 10 ]
attachment [ interface 8 target 11 ]
]
interfaceToRight [
atom [ interface 1 target 1 ]
atom [ interface 2 target 2 ]
atom [ interface 3 target 3 ]
atom [ interface 4 target 4 ]
atom [ interface 5 target 5 ]
feature [ interface 1 target 1 ]
feature [ interface 2 target 2 ]
feature [ interface 3 target 3 ]
feature [ interface 4 target 4 ]
attachment [ interface 1 target 1 ]
attachment [ interface 2 target 2 ]
attachment [ interface 3 target 3 ]
attachment [ interface 4 target 4 ]
attachment [ interface 5 target 5 ]
attachment [ interface 6 target 6 ]
attachment [ interface 7 target 7 ]
attachment [ interface 8 target 8 ]
]
]
exchange/rules/diazomethane_proton_transfer.egml
rule [
ruleID "diazomethane_proton_transfer"
note "Consumes the diazomethane carbon lone-pair loop and the acid O-H shared pair; creates an oxygen lone pair and a C-H shared pair."
extension "loops encode lone pairs; halfedges encode radicals"
interface [
node [ id 1 label "C" ]
node [ id 2 label "N" ]
node [ id 3 label "N" ]
node [ id 4 label "O" ]
node [ id 5 label "H" ]
edge [ id 1 source 1 target 2 label "pair" ]
edge [ id 2 source 2 target 3 label "pair" ]
edge [ id 3 source 2 target 3 label "pair" ]
edge [ id 4 source 2 target 3 label "pair" ]
]
left [
node [ id 1 label "C" ]
node [ id 2 label "N" ]
node [ id 3 label "N" ]
node [ id 4 label "O" ]
node [ id 5 label "H" ]
edge [ id 1 source 1 target 2 label "pair" ]
edge [ id 2 source 2 target 3 label "pair" ]
edge [ id 3 source 2 target 3 label "pair" ]
edge [ id 4 source 2 target 3 label "pair" ]
loop [ id 5 node 1 label "lp" ]
edge [ id 6 source 4 target 5 label "pair" ]
]
right [
node [ id 1 label "C" ]
node [ id 2 label "N" ]
node [ id 3 label "N" ]
node [ id 4 label "O" ]
node [ id 5 label "H" ]
edge [ id 1 source 1 target 2 label "pair" ]
edge [ id 2 source 2 target 3 label "pair" ]
edge [ id 3 source 2 target 3 label "pair" ]
edge [ id 4 source 2 target 3 label "pair" ]
loop [ id 5 node 4 label "lp" ]
edge [ id 6 source 1 target 5 label "pair" ]
]
interfaceToLeft [
atom [ interface 1 target 1 ]
atom [ interface 2 target 2 ]
atom [ interface 3 target 3 ]
atom [ interface 4 target 4 ]
atom [ interface 5 target 5 ]
feature [ interface 1 target 1 ]
feature [ interface 2 target 2 ]
feature [ interface 3 target 3 ]
feature [ interface 4 target 4 ]
attachment [ interface 1 target 1 ]
attachment [ interface 2 target 2 ]
attachment [ interface 3 target 3 ]
attachment [ interface 4 target 4 ]
attachment [ interface 5 target 5 ]
attachment [ interface 6 target 6 ]
attachment [ interface 7 target 7 ]
attachment [ interface 8 target 8 ]
]
interfaceToRight [
atom [ interface 1 target 1 ]
atom [ interface 2 target 2 ]
atom [ interface 3 target 3 ]
atom [ interface 4 target 4 ]
atom [ interface 5 target 5 ]
feature [ interface 1 target 1 ]
feature [ interface 2 target 2 ]
feature [ interface 3 target 3 ]
feature [ interface 4 target 4 ]
attachment [ interface 1 target 1 ]
attachment [ interface 2 target 2 ]
attachment [ interface 3 target 3 ]
attachment [ interface 4 target 4 ]
attachment [ interface 5 target 5 ]
attachment [ interface 6 target 6 ]
attachment [ interface 7 target 7 ]
attachment [ interface 8 target 8 ]
]
]
exchange/rules/radical_abstraction_recombination_partial_macro.egml
rule [
ruleID "radical_abstraction_recombination_partial_macro"
note "Direct Cl radical plus methane plus methyl radical to HCl plus ethane rule generated by composeV_ after partial overlap exposure."
extension "loops encode lone pairs; halfedges encode radicals"
interface [
node [ id 1 label "Cl" ]
node [ id 2 label "C" ]
node [ id 3 label "H" ]
node [ id 4 label "H" ]
node [ id 5 label "H" ]
node [ id 6 label "H" ]
node [ id 7 label "C" ]
node [ id 8 label "H" ]
node [ id 9 label "H" ]
node [ id 10 label "H" ]
loop [ id 1 node 1 label "lp" ]
loop [ id 2 node 1 label "lp" ]
loop [ id 3 node 1 label "lp" ]
edge [ id 4 source 2 target 4 label "pair" ]
edge [ id 5 source 2 target 5 label "pair" ]
edge [ id 6 source 2 target 6 label "pair" ]
edge [ id 7 source 7 target 8 label "pair" ]
edge [ id 8 source 7 target 9 label "pair" ]
edge [ id 9 source 7 target 10 label "pair" ]
]
left [
node [ id 1 label "Cl" ]
node [ id 2 label "C" ]
node [ id 3 label "H" ]
node [ id 4 label "H" ]
node [ id 5 label "H" ]
node [ id 6 label "H" ]
node [ id 7 label "C" ]
node [ id 8 label "H" ]
node [ id 9 label "H" ]
node [ id 10 label "H" ]
loop [ id 1 node 1 label "lp" ]
loop [ id 2 node 1 label "lp" ]
loop [ id 3 node 1 label "lp" ]
edge [ id 4 source 2 target 4 label "pair" ]
edge [ id 5 source 2 target 5 label "pair" ]
edge [ id 6 source 2 target 6 label "pair" ]
halfedge [ id 7 node 1 label "rad" ]
edge [ id 8 source 2 target 3 label "pair" ]
edge [ id 9 source 7 target 8 label "pair" ]
edge [ id 10 source 7 target 9 label "pair" ]
edge [ id 11 source 7 target 10 label "pair" ]
halfedge [ id 12 node 7 label "rad" ]
]
right [
node [ id 1 label "Cl" ]
node [ id 2 label "H" ]
node [ id 3 label "C" ]
node [ id 4 label "H" ]
node [ id 5 label "H" ]
node [ id 6 label "H" ]
node [ id 7 label "C" ]
node [ id 8 label "H" ]
node [ id 9 label "H" ]
node [ id 10 label "H" ]
edge [ id 1 source 1 target 2 label "pair" ]
loop [ id 2 node 1 label "lp" ]
loop [ id 3 node 1 label "lp" ]
loop [ id 4 node 1 label "lp" ]
edge [ id 5 source 3 target 4 label "pair" ]
edge [ id 6 source 3 target 5 label "pair" ]
edge [ id 7 source 3 target 6 label "pair" ]
edge [ id 8 source 7 target 8 label "pair" ]
edge [ id 9 source 7 target 9 label "pair" ]
edge [ id 10 source 7 target 10 label "pair" ]
edge [ id 11 source 3 target 7 label "pair" ]
]
interfaceToLeft [
atom [ interface 1 target 1 ]
atom [ interface 2 target 2 ]
atom [ interface 3 target 3 ]
atom [ interface 4 target 4 ]
atom [ interface 5 target 5 ]
atom [ interface 6 target 6 ]
atom [ interface 7 target 7 ]
atom [ interface 8 target 8 ]
atom [ interface 9 target 9 ]
atom [ interface 10 target 10 ]
feature [ interface 1 target 1 ]
feature [ interface 2 target 2 ]
feature [ interface 3 target 3 ]
feature [ interface 4 target 4 ]
feature [ interface 5 target 5 ]
feature [ interface 6 target 6 ]
feature [ interface 7 target 9 ]
feature [ interface 8 target 10 ]
feature [ interface 9 target 11 ]
attachment [ interface 1 target 1 ]
attachment [ interface 2 target 2 ]
attachment [ interface 3 target 3 ]
attachment [ interface 4 target 4 ]
attachment [ interface 5 target 5 ]
attachment [ interface 6 target 6 ]
attachment [ interface 7 target 7 ]
attachment [ interface 8 target 8 ]
attachment [ interface 9 target 9 ]
attachment [ interface 10 target 13 ]
attachment [ interface 11 target 14 ]
attachment [ interface 12 target 15 ]
attachment [ interface 13 target 16 ]
attachment [ interface 14 target 17 ]
attachment [ interface 15 target 18 ]
]
interfaceToRight [
atom [ interface 1 target 1 ]
atom [ interface 2 target 3 ]
atom [ interface 3 target 2 ]
atom [ interface 4 target 4 ]
atom [ interface 5 target 5 ]
atom [ interface 6 target 6 ]
atom [ interface 7 target 7 ]
atom [ interface 8 target 8 ]
atom [ interface 9 target 9 ]
atom [ interface 10 target 10 ]
feature [ interface 1 target 2 ]
feature [ interface 2 target 3 ]
feature [ interface 3 target 4 ]
feature [ interface 4 target 5 ]
feature [ interface 5 target 6 ]
feature [ interface 6 target 7 ]
feature [ interface 7 target 8 ]
feature [ interface 8 target 9 ]
feature [ interface 9 target 10 ]
attachment [ interface 1 target 3 ]
attachment [ interface 2 target 4 ]
attachment [ interface 3 target 5 ]
attachment [ interface 4 target 6 ]
attachment [ interface 5 target 7 ]
attachment [ interface 6 target 8 ]
attachment [ interface 7 target 9 ]
attachment [ interface 8 target 10 ]
attachment [ interface 9 target 11 ]
attachment [ interface 10 target 12 ]
attachment [ interface 11 target 13 ]
attachment [ interface 12 target 14 ]
attachment [ interface 13 target 15 ]
attachment [ interface 14 target 16 ]
attachment [ interface 15 target 17 ]
]
]
exchange/rules/radical_recombination_methyl.egml
rule [
ruleID "radical_recombination_methyl"
note "Consumes two methyl radical halfedges and creates one C-C shared pair."
extension "loops encode lone pairs; halfedges encode radicals"
interface [
node [ id 1 label "C" ]
node [ id 2 label "H" ]
node [ id 3 label "H" ]
node [ id 4 label "H" ]
node [ id 5 label "C" ]
node [ id 6 label "H" ]
node [ id 7 label "H" ]
node [ id 8 label "H" ]
edge [ id 1 source 1 target 2 label "pair" ]
edge [ id 2 source 1 target 3 label "pair" ]
edge [ id 3 source 1 target 4 label "pair" ]
edge [ id 4 source 5 target 6 label "pair" ]
edge [ id 5 source 5 target 7 label "pair" ]
edge [ id 6 source 5 target 8 label "pair" ]
]
left [
node [ id 1 label "C" ]
node [ id 2 label "H" ]
node [ id 3 label "H" ]
node [ id 4 label "H" ]
node [ id 5 label "C" ]
node [ id 6 label "H" ]
node [ id 7 label "H" ]
node [ id 8 label "H" ]
edge [ id 1 source 1 target 2 label "pair" ]
edge [ id 2 source 1 target 3 label "pair" ]
edge [ id 3 source 1 target 4 label "pair" ]
halfedge [ id 4 node 1 label "rad" ]
edge [ id 5 source 5 target 6 label "pair" ]
edge [ id 6 source 5 target 7 label "pair" ]
edge [ id 7 source 5 target 8 label "pair" ]
halfedge [ id 8 node 5 label "rad" ]
]
right [
node [ id 1 label "C" ]
node [ id 2 label "H" ]
node [ id 3 label "H" ]
node [ id 4 label "H" ]
node [ id 5 label "C" ]
node [ id 6 label "H" ]
node [ id 7 label "H" ]
node [ id 8 label "H" ]
edge [ id 1 source 1 target 2 label "pair" ]
edge [ id 2 source 1 target 3 label "pair" ]
edge [ id 3 source 1 target 4 label "pair" ]
edge [ id 4 source 5 target 6 label "pair" ]
edge [ id 5 source 5 target 7 label "pair" ]
edge [ id 6 source 5 target 8 label "pair" ]
edge [ id 7 source 1 target 5 label "pair" ]
]
interfaceToLeft [
atom [ interface 1 target 1 ]
atom [ interface 2 target 2 ]
atom [ interface 3 target 3 ]
atom [ interface 4 target 4 ]
atom [ interface 5 target 5 ]
atom [ interface 6 target 6 ]
atom [ interface 7 target 7 ]
atom [ interface 8 target 8 ]
feature [ interface 1 target 1 ]
feature [ interface 2 target 2 ]
feature [ interface 3 target 3 ]
feature [ interface 4 target 5 ]
feature [ interface 5 target 6 ]
feature [ interface 6 target 7 ]
attachment [ interface 1 target 1 ]
attachment [ interface 2 target 2 ]
attachment [ interface 3 target 3 ]
attachment [ interface 4 target 4 ]
attachment [ interface 5 target 5 ]
attachment [ interface 6 target 6 ]
attachment [ interface 7 target 8 ]
attachment [ interface 8 target 9 ]
attachment [ interface 9 target 10 ]
attachment [ interface 10 target 11 ]
attachment [ interface 11 target 12 ]
attachment [ interface 12 target 13 ]
]
interfaceToRight [
atom [ interface 1 target 1 ]
atom [ interface 2 target 2 ]
atom [ interface 3 target 3 ]
atom [ interface 4 target 4 ]
atom [ interface 5 target 5 ]
atom [ interface 6 target 6 ]
atom [ interface 7 target 7 ]
atom [ interface 8 target 8 ]
feature [ interface 1 target 1 ]
feature [ interface 2 target 2 ]
feature [ interface 3 target 3 ]
feature [ interface 4 target 4 ]
feature [ interface 5 target 5 ]
feature [ interface 6 target 6 ]
attachment [ interface 1 target 1 ]
attachment [ interface 2 target 2 ]
attachment [ interface 3 target 3 ]
attachment [ interface 4 target 4 ]
attachment [ interface 5 target 5 ]
attachment [ interface 6 target 6 ]
attachment [ interface 7 target 7 ]
attachment [ interface 8 target 8 ]
attachment [ interface 9 target 9 ]
attachment [ interface 10 target 10 ]
attachment [ interface 11 target 11 ]
attachment [ interface 12 target 12 ]
]
]
exchange/rules/radical_recombination_with_hcl_context.egml
rule [
ruleID "radical_recombination_with_hcl_context"
note "Methyl radical recombination rule with HCl carried as identity context for partial composition."
extension "loops encode lone pairs; halfedges encode radicals"
interface [
node [ id 1 label "Cl" ]
node [ id 2 label "H" ]
node [ id 3 label "C" ]
node [ id 4 label "H" ]
node [ id 5 label "H" ]
node [ id 6 label "H" ]
node [ id 7 label "C" ]
node [ id 8 label "H" ]
node [ id 9 label "H" ]
node [ id 10 label "H" ]
edge [ id 1 source 1 target 2 label "pair" ]
loop [ id 2 node 1 label "lp" ]
loop [ id 3 node 1 label "lp" ]
loop [ id 4 node 1 label "lp" ]
edge [ id 5 source 3 target 4 label "pair" ]
edge [ id 6 source 3 target 5 label "pair" ]
edge [ id 7 source 3 target 6 label "pair" ]
edge [ id 8 source 7 target 8 label "pair" ]
edge [ id 9 source 7 target 9 label "pair" ]
edge [ id 10 source 7 target 10 label "pair" ]
]
left [
node [ id 1 label "Cl" ]
node [ id 2 label "H" ]
node [ id 3 label "C" ]
node [ id 4 label "H" ]
node [ id 5 label "H" ]
node [ id 6 label "H" ]
node [ id 7 label "C" ]
node [ id 8 label "H" ]
node [ id 9 label "H" ]
node [ id 10 label "H" ]
edge [ id 1 source 1 target 2 label "pair" ]
loop [ id 2 node 1 label "lp" ]
loop [ id 3 node 1 label "lp" ]
loop [ id 4 node 1 label "lp" ]
edge [ id 5 source 3 target 4 label "pair" ]
edge [ id 6 source 3 target 5 label "pair" ]
edge [ id 7 source 3 target 6 label "pair" ]
halfedge [ id 8 node 3 label "rad" ]
edge [ id 9 source 7 target 8 label "pair" ]
edge [ id 10 source 7 target 9 label "pair" ]
edge [ id 11 source 7 target 10 label "pair" ]
halfedge [ id 12 node 7 label "rad" ]
]
right [
node [ id 1 label "Cl" ]
node [ id 2 label "H" ]
node [ id 3 label "C" ]
node [ id 4 label "H" ]
node [ id 5 label "H" ]
node [ id 6 label "H" ]
node [ id 7 label "C" ]
node [ id 8 label "H" ]
node [ id 9 label "H" ]
node [ id 10 label "H" ]
edge [ id 1 source 1 target 2 label "pair" ]
loop [ id 2 node 1 label "lp" ]
loop [ id 3 node 1 label "lp" ]
loop [ id 4 node 1 label "lp" ]
edge [ id 5 source 3 target 4 label "pair" ]
edge [ id 6 source 3 target 5 label "pair" ]
edge [ id 7 source 3 target 6 label "pair" ]
edge [ id 8 source 7 target 8 label "pair" ]
edge [ id 9 source 7 target 9 label "pair" ]
edge [ id 10 source 7 target 10 label "pair" ]
edge [ id 11 source 3 target 7 label "pair" ]
]
interfaceToLeft [
atom [ interface 1 target 1 ]
atom [ interface 2 target 2 ]
atom [ interface 3 target 3 ]
atom [ interface 4 target 4 ]
atom [ interface 5 target 5 ]
atom [ interface 6 target 6 ]
atom [ interface 7 target 7 ]
atom [ interface 8 target 8 ]
atom [ interface 9 target 9 ]
atom [ interface 10 target 10 ]
feature [ interface 1 target 1 ]
feature [ interface 2 target 2 ]
feature [ interface 3 target 3 ]
feature [ interface 4 target 4 ]
feature [ interface 5 target 5 ]
feature [ interface 6 target 6 ]
feature [ interface 7 target 7 ]
feature [ interface 8 target 9 ]
feature [ interface 9 target 10 ]
feature [ interface 10 target 11 ]
attachment [ interface 1 target 1 ]
attachment [ interface 2 target 2 ]
attachment [ interface 3 target 3 ]
attachment [ interface 4 target 4 ]
attachment [ interface 5 target 5 ]
attachment [ interface 6 target 6 ]
attachment [ interface 7 target 7 ]
attachment [ interface 8 target 8 ]
attachment [ interface 9 target 9 ]
attachment [ interface 10 target 10 ]
attachment [ interface 11 target 11 ]
attachment [ interface 12 target 13 ]
attachment [ interface 13 target 14 ]
attachment [ interface 14 target 15 ]
attachment [ interface 15 target 16 ]
attachment [ interface 16 target 17 ]
attachment [ interface 17 target 18 ]
]
interfaceToRight [
atom [ interface 1 target 1 ]
atom [ interface 2 target 2 ]
atom [ interface 3 target 3 ]
atom [ interface 4 target 4 ]
atom [ interface 5 target 5 ]
atom [ interface 6 target 6 ]
atom [ interface 7 target 7 ]
atom [ interface 8 target 8 ]
atom [ interface 9 target 9 ]
atom [ interface 10 target 10 ]
feature [ interface 1 target 1 ]
feature [ interface 2 target 2 ]
feature [ interface 3 target 3 ]
feature [ interface 4 target 4 ]
feature [ interface 5 target 5 ]
feature [ interface 6 target 6 ]
feature [ interface 7 target 7 ]
feature [ interface 8 target 8 ]
feature [ interface 9 target 9 ]
feature [ interface 10 target 10 ]
attachment [ interface 1 target 1 ]
attachment [ interface 2 target 2 ]
attachment [ interface 3 target 3 ]
attachment [ interface 4 target 4 ]
attachment [ interface 5 target 5 ]
attachment [ interface 6 target 6 ]
attachment [ interface 7 target 7 ]
attachment [ interface 8 target 8 ]
attachment [ interface 9 target 9 ]
attachment [ interface 10 target 10 ]
attachment [ interface 11 target 11 ]
attachment [ interface 12 target 12 ]
attachment [ interface 13 target 13 ]
attachment [ interface 14 target 14 ]
attachment [ interface 15 target 15 ]
attachment [ interface 16 target 16 ]
attachment [ interface 17 target 17 ]
]
]
Applications
exchange/applications/diazomethane_azo_esterification_macro_on_substrate.egml
application [
applicationID "diazomethane_azo_esterification_macro_on_substrate"
ruleID "diazomethane_azo_esterification_macro"
hostGraph "diazomethane_azo_esterification_host"
resultGraph "diazomethane_after_methyl_transfer"
note "This direct exact-resonance application reaches the ester product from the H2C=N+=N- substrate form in one composed macro step."
match [
atom [ rule 1 host 1 ]
atom [ rule 2 host 2 ]
atom [ rule 3 host 3 ]
atom [ rule 4 host 12 ]
atom [ rule 5 host 13 ]
feature [ rule 1 host 1 ]
feature [ rule 2 host 3 ]
feature [ rule 3 host 4 ]
feature [ rule 4 host 7 ]
feature [ rule 5 host 2 ]
feature [ rule 6 host 8 ]
feature [ rule 7 host 16 ]
]
deleted [
item "pair(C_diazomethane,N_inner)"
item "pair(C_diazomethane,N_inner)"
item "lp(N_outer)"
item "pair(O_acid,H_acid)"
]
created [
item "pair(N_inner,N_outer)"
item "pair(C_diazomethane,H_acid)"
item "pair(O_acid,C_diazomethane)"
item "lp(N_inner)"
]
]
exchange/applications/diazomethane_azo_proton_transfer_on_acid.egml
application [
applicationID "diazomethane_azo_proton_transfer_on_acid"
ruleID "diazomethane_azo_proton_transfer"
hostGraph "diazomethane_azo_esterification_host"
resultGraph "diazomethane_azo_after_proton_transfer"
note "This application follows the explicit [N-]=[N+]=C resonance form requested in the mechanism sketch."
match [
atom [ rule 1 host 1 ]
atom [ rule 2 host 2 ]
atom [ rule 3 host 3 ]
atom [ rule 4 host 12 ]
atom [ rule 5 host 13 ]
feature [ rule 1 host 1 ]
feature [ rule 2 host 3 ]
feature [ rule 3 host 4 ]
feature [ rule 4 host 7 ]
feature [ rule 5 host 2 ]
feature [ rule 6 host 8 ]
feature [ rule 7 host 16 ]
]
deleted [
item "pair(C_diazomethane,N_inner)"
item "lp(N_outer)"
item "pair(O_acid,H_acid)"
]
created [
item "pair(N_inner,N_outer)"
item "lp(O_carboxylate)"
item "pair(C_diazomethane,H_acid)"
]
]
exchange/applications/diazomethane_esterification_macro_on_substrate.egml
application [
applicationID "diazomethane_esterification_macro_on_substrate"
ruleID "diazomethane_esterification_macro"
hostGraph "diazomethane_esterification_host"
resultGraph "diazomethane_after_methyl_transfer"
note "This direct application reaches the ester product from the substrate in one macro step."
match [
atom [ rule 1 host 1 ]
atom [ rule 2 host 2 ]
atom [ rule 3 host 3 ]
atom [ rule 4 host 12 ]
atom [ rule 5 host 13 ]
feature [ rule 1 host 1 ]
feature [ rule 2 host 2 ]
feature [ rule 3 host 3 ]
feature [ rule 4 host 4 ]
feature [ rule 5 host 7 ]
feature [ rule 6 host 16 ]
]
deleted [
item "lp(C_diazomethane)"
item "pair(O_acid,H_acid)"
item "pair(C_methyl,N_inner)"
]
created [
item "pair(C_diazomethane,H_acid)"
item "pair(O_acid,C_diazomethane)"
item "lp(N_inner)"
]
]
exchange/applications/diazomethane_methyl_transfer_on_ion_pair.egml
application [
applicationID "diazomethane_methyl_transfer_on_ion_pair"
ruleID "diazomethane_methyl_transfer"
hostGraph "diazomethane_after_proton_transfer"
resultGraph "diazomethane_after_methyl_transfer"
note "This second application reaches the ester product and neutral N2 from the ion-pair intermediate."
match [
atom [ rule 1 host 4 ]
atom [ rule 2 host 1 ]
atom [ rule 3 host 2 ]
atom [ rule 4 host 3 ]
feature [ rule 1 host 2 ]
feature [ rule 2 host 3 ]
feature [ rule 3 host 4 ]
feature [ rule 4 host 5 ]
feature [ rule 5 host 1 ]
]
deleted [
item "lp(O_carboxylate)"
item "pair(C_methyl,N_inner)"
]
created [
item "pair(O_carboxylate,C_methyl)"
item "lp(N_inner)"
]
]
exchange/applications/diazomethane_proton_transfer_on_acid.egml
application [
applicationID "diazomethane_proton_transfer_on_acid"
ruleID "diazomethane_proton_transfer"
hostGraph "diazomethane_esterification_host"
resultGraph "diazomethane_after_proton_transfer"
note "This is the first application from the substrate graph."
match [
atom [ rule 1 host 1 ]
atom [ rule 2 host 2 ]
atom [ rule 3 host 3 ]
atom [ rule 4 host 12 ]
atom [ rule 5 host 13 ]
feature [ rule 1 host 1 ]
feature [ rule 2 host 2 ]
feature [ rule 3 host 3 ]
feature [ rule 4 host 4 ]
feature [ rule 5 host 7 ]
feature [ rule 6 host 16 ]
]
deleted [
item "lp(C_diazomethane)"
item "pair(O_acid,H_acid)"
]
created [
item "lp(O_carboxylate)"
item "pair(C_diazomethane,H_acid)"
]
]
exchange/applications/radical_abstraction_recombination_partial_macro_on_host.egml
application [
applicationID "radical_abstraction_recombination_partial_macro_on_host"
ruleID "radical_abstraction_recombination_partial_macro"
hostGraph "radical_chain_host"
resultGraph "radical_chain_product"
note "This direct application maps Cl radical plus methane plus methyl radical to HCl plus ethane."
match [
atom [ rule 1 host 1 ]
atom [ rule 2 host 2 ]
atom [ rule 3 host 3 ]
atom [ rule 4 host 4 ]
atom [ rule 5 host 5 ]
atom [ rule 6 host 6 ]
atom [ rule 7 host 7 ]
atom [ rule 8 host 8 ]
atom [ rule 9 host 9 ]
atom [ rule 10 host 10 ]
feature [ rule 1 host 1 ]
feature [ rule 2 host 2 ]
feature [ rule 3 host 3 ]
feature [ rule 4 host 6 ]
feature [ rule 5 host 7 ]
feature [ rule 6 host 8 ]
feature [ rule 7 host 4 ]
feature [ rule 8 host 5 ]
feature [ rule 9 host 9 ]
feature [ rule 10 host 10 ]
feature [ rule 11 host 11 ]
feature [ rule 12 host 12 ]
]
deleted [
item "rad(Cl)"
item "pair(C_methane,H_abstracted)"
item "rad(C_external_methyl)"
]
created [
item "pair(Cl,H_abstracted)"
item "pair(C_methane,C_external_methyl)"
]
]
Compositions
exchange/compositions/diazomethane_azo_esterification_composeV.egml
composition [
compositionID "diazomethane_azo_esterification_composeV"
kind "vertical DPO rule composition"
operation "AlgebraicRewriting.composeV_"
firstRule "diazomethane_azo_proton_transfer"
secondRule "diazomethane_methyl_transfer_after_azo_context"
resultRule "diazomethane_azo_esterification_macro"
intermediateCondition "right(firstRule) equals left(secondRule) after exposing preserved C-H and terminal-N lone-pair context"
note "This is the exact resonance-form variant: R(firstRule) is exposed as L(secondRule), then the two open DPO rules are composed categorically."
]
exchange/compositions/diazomethane_esterification_composeV.egml
composition [
compositionID "diazomethane_esterification_composeV"
kind "vertical DPO rule composition"
operation "AlgebraicRewriting.composeV_"
firstRule "diazomethane_proton_transfer"
secondRule "diazomethane_methyl_transfer_after_proton_context"
resultRule "diazomethane_esterification_macro"
intermediateCondition "right(firstRule) equals left(secondRule) after exposing preserved C-H context"
note "This is a real categorical composition of open DPO rules, then projected back to a closed DPO rule for application to the substrate."
]
exchange/compositions/radical_abstraction_recombination_partial_composeV.egml
composition [
compositionID "radical_abstraction_recombination_partial_composeV"
kind "vertical DPO rule composition"
operation "AlgebraicRewriting.composeV_"
firstRule "chlorine_h_abstraction_with_external_methyl"
secondRule "radical_recombination_with_hcl_context"
resultRule "radical_abstraction_recombination_partial_macro"
intermediateCondition "right(firstRule) equals left(secondRule) after adding identity contexts; original-rule overlap is only the produced methyl radical"
note "This records the partial DPO composition: chlorine abstraction creates one methyl radical, which is identified with one radical input of recombination; HCl and the external methyl radical are carried as contexts."
]