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.

7DPO cases 20molecules/states 12rule files 6applications 3compositions

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?

FeatureStatusMeaning
Ownership-structured HEG categoryv2 implementedOwnedHalfEdgeMol uses HalfEdge, Edge, Incidence, and rewritable Ownership objects.
Diazomethane proton-transfer rulev2 implementedHalfEdges and pair objects are preserved across K; ownership objects carry the resource movement.
Diazomethane methyl-transfer rulev2 implementedSame v2 rule style as above.
Diazomethane composed macro rulev2 implementedDirect v2 macro rule exists; generated product is checked against the explicit two-step product.
General v2 rule-composition APInot yet in v2The old partial-composition witness machinery is not yet ported to ownership-structured HEG v2.
Weighted resonance coalescinglegacy layerAvailable in the EFG/native-HEG resonance experiments, but not yet as a v2 weighted-family API.
Partial-overlap radical-chain compositionlegacy layerAvailable in older DPO/native-HEG assets and shown in the Composition tab; not yet v2.
truetwo-step equals macro truematches expected product H/E kepthalfedges and pair objects preserved in K Ownershiprewritten as structure

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")
RuleHalfEdges L/K/RPairs L/K/ROwnership L/K/R
Proton transfer12/12/126/6/612/10/12
Methyl transfer10/10/105/5/510/8/10
Macro rule12/12/126/6/612/9/12

v2 proton transfer

LKR
Molecule viewclick image to switch: Molecule / Lewis-EFG / HEG
v2 proton transfer L Molecule
v2 proton transfer L Lewis-EFG
v2 proton transfer L HEG
HEG viewclick image to switch: HEG
v2 proton transfer K 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 proton transfer R Molecule
v2 proton transfer R Lewis-EFG
v2 proton transfer R HEG

v2 methyl transfer

LKR
Molecule viewclick image to switch: Molecule / Lewis-EFG / HEG
v2 methyl transfer L Molecule
v2 methyl transfer L Lewis-EFG
v2 methyl transfer L HEG
HEG viewclick image to switch: HEG
v2 methyl transfer K 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 R Molecule
v2 methyl transfer R Lewis-EFG
v2 methyl transfer R HEG

v2 composed macro rule

LKR
Molecule viewclick image to switch: Molecule / Lewis-EFG / HEG
v2 composed macro rule L Molecule
v2 composed macro rule L Lewis-EFG
v2 composed macro rule L HEG
HEG viewclick image to switch: HEG
v2 composed macro rule K 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 R Molecule
v2 composed macro rule R Lewis-EFG
v2 composed macro rule R HEG

Executable State Sequence

StartAfter proton transferAfter methyl transferDirect macro product
Molecule viewclick image to switch: Molecule / Lewis-EFG / HEG
start state Molecule
start state Lewis-EFG
start state HEG
Molecule viewclick image to switch: Molecule / Lewis-EFG / HEG
after proton transfer Molecule
after proton transfer Lewis-EFG
after proton transfer HEG
Molecule viewclick image to switch: Molecule / Lewis-EFG / HEG
after methyl transfer Molecule
after methyl transfer Lewis-EFG
after methyl transfer HEG
Molecule viewclick image to switch: Molecule / Lewis-EFG / HEG
direct macro product Molecule
direct macro product Lewis-EFG
direct macro product 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

RuleLKR
Rule 1: chlorine_h_abstraction
Fragment viewDOT viewclick image to switch representation
Rule 1: chlorine_h_abstraction L Fragment
Rule 1: chlorine_h_abstraction L DOT
Fragment viewDOT viewclick image to switch representation
Rule 1: chlorine_h_abstraction K Fragment
Rule 1: chlorine_h_abstraction K DOT
Fragment viewDOT viewclick image to switch representation
Rule 1: chlorine_h_abstraction R Fragment
Rule 1: chlorine_h_abstraction R DOT
Rule 2: radical_recombination_methyl
Fragment viewDOT viewclick image to switch representation
Rule 2: radical_recombination_methyl L Fragment
Rule 2: radical_recombination_methyl L DOT
Fragment viewDOT viewclick image to switch representation
Rule 2: radical_recombination_methyl K Fragment
Rule 2: radical_recombination_methyl K DOT
Fragment viewDOT viewclick image to switch representation
Rule 2: radical_recombination_methyl R Fragment
Rule 2: radical_recombination_methyl R DOT

Partial overlap

Overlap graphMeaning
Fragment viewDOT viewclick image to switch representation
Partial overlap: produced methyl radical Fragment
Partial overlap: produced methyl radical DOT
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_

RuleLKR
Rule 1 with external methyl context
Fragment viewDOT viewclick image to switch representation
Rule 1 with external methyl context L Fragment
Rule 1 with external methyl context L DOT
Fragment viewDOT viewclick image to switch representation
Rule 1 with external methyl context K Fragment
Rule 1 with external methyl context K DOT
Fragment viewDOT viewclick image to switch representation
Rule 1 with external methyl context R Fragment
Rule 1 with external methyl context R DOT
Rule 2 with HCl context
Fragment viewDOT viewclick image to switch representation
Rule 2 with HCl context L Fragment
Rule 2 with HCl context L DOT
Fragment viewDOT viewclick image to switch representation
Rule 2 with HCl context K Fragment
Rule 2 with HCl context K DOT
Fragment viewDOT viewclick image to switch representation
Rule 2 with HCl context R Fragment
Rule 2 with HCl context R DOT

Composed macro rule

RuleLKR
Composed macro rule
Fragment viewDOT viewclick image to switch representation
Composed macro rule L Fragment
Composed macro rule L DOT
Fragment viewDOT viewclick image to switch representation
Composed macro rule K Fragment
Composed macro rule K DOT
Fragment viewDOT viewclick image to switch representation
Composed macro rule R Fragment
Composed macro rule R DOT

Partial radical-chain DPO composition

RDKit molecule quick view

HostProduct
RDKit viewDOT viewclick image to switch representation
host molecule RDKit
host molecule DOT
RDKit viewDOT viewclick image to switch representation
product molecule RDKit
product molecule DOT

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 fragmentK interfaceR rule fragment
L K R
H full hostD pushout complementH' full product
H D Hprime

Chemical/DOT companion view

L rule fragmentK interfaceR rule fragment
Fragment viewDOT viewclick image to switch representation
L fragment Fragment
L fragment DOT
Fragment viewDOT viewclick image to switch representation
K fragment Fragment
K fragment DOT
Fragment viewDOT viewclick image to switch representation
R fragment Fragment
R fragment DOT
H full hostD pushout complementH' full product
RDKit viewDOT viewclick image to switch representation
H molecule RDKit
H molecule DOT
Fragment viewDOT viewclick image to switch representation
D fragment Fragment
D fragment DOT
RDKit viewDOT viewclick image to switch representation
Hprime molecule RDKit
Hprime molecule DOT

RDKit host/product views

HostProduct
RDKit viewDOT viewclick image to switch representation
host molecule RDKit
host molecule DOT
RDKit viewDOT viewclick image to switch representation
product molecule RDKit
product molecule DOT

Diazomethane composed macro DPO

RDKit molecule quick view

HostProduct
RDKit viewDOT viewclick image to switch representation
host molecule RDKit
host molecule DOT
RDKit viewDOT viewclick image to switch representation
product molecule RDKit
product molecule DOT

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 fragmentK interfaceR rule fragment
L K R
H full hostD pushout complementH' full product
H D Hprime

Chemical/DOT companion view

L rule fragmentK interfaceR rule fragment
Fragment viewDOT viewclick image to switch representation
L fragment Fragment
L fragment DOT
Fragment viewDOT viewclick image to switch representation
K fragment Fragment
K fragment DOT
Fragment viewDOT viewclick image to switch representation
R fragment Fragment
R fragment DOT
H full hostD pushout complementH' full product
RDKit viewDOT viewclick image to switch representation
H molecule RDKit
H molecule DOT
Fragment viewDOT viewclick image to switch representation
D fragment Fragment
D fragment DOT
RDKit viewDOT viewclick image to switch representation
Hprime molecule RDKit
Hprime molecule DOT

RDKit host/product views

HostProduct
RDKit viewDOT viewclick image to switch representation
host molecule RDKit
host molecule DOT
RDKit viewDOT viewclick image to switch representation
product molecule RDKit
product molecule DOT

Diazomethane exact-azo composed macro DPO

RDKit molecule quick view

HostProduct
RDKit viewDOT viewclick image to switch representation
host molecule RDKit
host molecule DOT
RDKit viewDOT viewclick image to switch representation
product molecule RDKit
product molecule DOT

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 fragmentK interfaceR rule fragment
L K R
H full hostD pushout complementH' full product
H D Hprime

Chemical/DOT companion view

L rule fragmentK interfaceR rule fragment
Fragment viewDOT viewclick image to switch representation
L fragment Fragment
L fragment DOT
Fragment viewDOT viewclick image to switch representation
K fragment Fragment
K fragment DOT
Fragment viewDOT viewclick image to switch representation
R fragment Fragment
R fragment DOT
H full hostD pushout complementH' full product
RDKit viewDOT viewclick image to switch representation
H molecule RDKit
H molecule DOT
Fragment viewDOT viewclick image to switch representation
D fragment Fragment
D fragment DOT
RDKit viewDOT viewclick image to switch representation
Hprime molecule RDKit
Hprime molecule DOT

RDKit host/product views

HostProduct
RDKit viewDOT viewclick image to switch representation
host molecule RDKit
host molecule DOT
RDKit viewDOT viewclick image to switch representation
product molecule RDKit
product molecule DOT

Rules

Generated EGML rule spans. The visual rule panels below use clickable Fragment/DOT images where available; raw rule files remain in the appendix.

Rule fileRole
exchange/rules/chlorine_h_abstraction.egmlradical abstraction rule
exchange/rules/chlorine_h_abstraction_with_external_methyl.egmlcontext-complete rule input
exchange/rules/diazomethane_azo_esterification_macro.egmlcomposed macro rule
exchange/rules/diazomethane_azo_proton_transfer.egmlelementary proton-transfer rule
exchange/rules/diazomethane_esterification_macro.egmlcomposed macro rule
exchange/rules/diazomethane_methyl_transfer.egmlelementary methyl-transfer rule
exchange/rules/diazomethane_methyl_transfer_after_azo_context.egmlcontext-complete rule input
exchange/rules/diazomethane_methyl_transfer_after_proton_context.egmlcontext-complete rule input
exchange/rules/diazomethane_proton_transfer.egmlelementary proton-transfer rule
exchange/rules/radical_abstraction_recombination_partial_macro.egmlpartial-overlap macro rule
exchange/rules/radical_recombination_methyl.egmlradical recombination rule
exchange/rules/radical_recombination_with_hcl_context.egmlcontext-complete rule input

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.

ExampleLayerInput weightsRules/routesAvailableUnavailableRaw branchesClassesClass weightsProvenanceConclusion
Charge-shift H2 toyEFG weighted familycovalent 0.5; ionic 0.25 + 0.25ionic_pair_recombination0.50.5210.5w=0.5 from ionic_h1_minus_h2_plus+ionic_h1_plus_h2_minus via ionic_pair_recombinationThe averaged charges vanish, but only the ionic weight 0.5 is reactive; both ionic branches coalesce to one covalent product class.
Diazomethane protonationEFG/DPO resonancediazo ylide 0.5; azo form 0.5ylide proton-transfer + azo proton-transfer101411w=1 from azo_form+diazo_ylide via diazomethane_azo_proton_transfer+diazomethane_proton_transferTwo distinct localized DPO rules become one protonated intermediate product class after isomorphism coalescing.
Substituted allyl methyl trapnative HEG v1left radical 0.5; right radical 0.5radical_recombination10420.5, 0.5w=0.5 from left_radical via native_radical_recombination; w=0.5 from right_radical via native_radical_recombinationRadical density is converted into two non-isomorphic regioisomeric product classes with weights 0.5 and 0.5.
Singlet/triplet carbene routesnative HEG v1singlet 0.6; triplet 0.4direct singlet rule vs triplet two-step diradical route10511w=1 from singlet+triplet via native_singlet_carbene_cyclopropanation+triplet_diradical_routeDirect 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 demo
Minimal 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

RuleSourceDeltaVDeltaPairsDeltaLonePairsDeltaRadicalsDeltaEDeltaQRadical parity
carbene_singlet_to_tripletexamples/rules/carbene_singlet_to_triplet.egml00-1+200even (0)
carbene_triplet_to_singletexamples/rules/carbene_triplet_to_singlet.egml00+1-200even (0)
chlorine_h_abstractionexchange/rules/chlorine_h_abstraction.egml000000even (0)
chlorine_h_abstraction_with_external_methylexchange/rules/chlorine_h_abstraction_with_external_methyl.egml000000even (0)
diazomethane_azo_esterification_macroexchange/rules/diazomethane_azo_esterification_macro.egml000000even (0)
diazomethane_azo_proton_transferexchange/rules/diazomethane_azo_proton_transfer.egml000000even (0)
diazomethane_esterification_macroexchange/rules/diazomethane_esterification_macro.egml000000even (0)
diazomethane_methyl_transferexchange/rules/diazomethane_methyl_transfer.egml000000even (0)
diazomethane_methyl_transfer_after_azo_contextexchange/rules/diazomethane_methyl_transfer_after_azo_context.egml000000even (0)
diazomethane_methyl_transfer_after_proton_contextexchange/rules/diazomethane_methyl_transfer_after_proton_context.egml000000even (0)
diazomethane_proton_transferexchange/rules/diazomethane_proton_transfer.egml000000even (0)
radical_abstraction_recombination_partial_macroexchange/rules/radical_abstraction_recombination_partial_macro.egml0+10-200even (0)
radical_recombinationexamples/rules/radical_recombination.egml0+10-200even (0)
radical_recombination_methylexchange/rules/radical_recombination_methyl.egml0+10-200even (0)
radical_recombination_with_hcl_contextexchange/rules/radical_recombination_with_hcl_context.egml0+10-200even (0)

Named Compositions

CompositionSourceRule equationFirst+second defectResult defectDefects add?
diazomethane_azo_esterification_composeVexchange/compositions/diazomethane_azo_esterification_composeV.egmldiazomethane_azo_proton_transfer + diazomethane_methyl_transfer_after_azo_context -> diazomethane_azo_esterification_macroDeltaV=0; DeltaPairs=0; DeltaLonePairs=0; DeltaRadicals=0; DeltaE=0; DeltaQ=0; radical parity=0DeltaV=0; DeltaPairs=0; DeltaLonePairs=0; DeltaRadicals=0; DeltaE=0; DeltaQ=0; radical parity=0yes
diazomethane_esterification_composeVexchange/compositions/diazomethane_esterification_composeV.egmldiazomethane_proton_transfer + diazomethane_methyl_transfer_after_proton_context -> diazomethane_esterification_macroDeltaV=0; DeltaPairs=0; DeltaLonePairs=0; DeltaRadicals=0; DeltaE=0; DeltaQ=0; radical parity=0DeltaV=0; DeltaPairs=0; DeltaLonePairs=0; DeltaRadicals=0; DeltaE=0; DeltaQ=0; radical parity=0yes
radical_abstraction_recombination_partial_composeVexchange/compositions/radical_abstraction_recombination_partial_composeV.egmlchlorine_h_abstraction_with_external_methyl + radical_recombination_with_hcl_context -> radical_abstraction_recombination_partial_macroDeltaV=0; DeltaPairs=+1; DeltaLonePairs=0; DeltaRadicals=-2; DeltaE=0; DeltaQ=0; radical parity=0DeltaV=0; DeltaPairs=+1; DeltaLonePairs=0; DeltaRadicals=-2; DeltaE=0; DeltaQ=0; radical parity=0yes

Specific Chemical Examples

Elementary DPO applications over concrete chemical hosts.

Cyclopropanation DPO

RDKit molecule quick view

HostProduct
RDKit viewDOT viewclick image to switch representation
host molecule RDKit
host molecule DOT
RDKit viewDOT viewclick image to switch representation
product molecule RDKit
product molecule DOT

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 fragmentK interfaceR rule fragment
L K R
H full hostD pushout complementH' full product
H D Hprime

Chemical/DOT companion view

L rule fragmentK interfaceR rule fragment
Fragment viewDOT viewclick image to switch representation
L fragment Fragment
L fragment DOT
Fragment viewDOT viewclick image to switch representation
K fragment Fragment
K fragment DOT
Fragment viewDOT viewclick image to switch representation
R fragment Fragment
R fragment DOT
H full hostD pushout complementH' full product
RDKit viewDOT viewclick image to switch representation
H molecule RDKit
H molecule DOT
Fragment viewDOT viewclick image to switch representation
D fragment Fragment
D fragment DOT
RDKit viewDOT viewclick image to switch representation
Hprime molecule RDKit
Hprime molecule DOT

RDKit host/product views

HostProduct
RDKit viewDOT viewclick image to switch representation
host molecule RDKit
host molecule DOT
RDKit viewDOT viewclick image to switch representation
product molecule RDKit
product molecule DOT

Diazomethane proton-transfer DPO

RDKit molecule quick view

HostProduct
RDKit viewDOT viewclick image to switch representation
host molecule RDKit
host molecule DOT
RDKit viewDOT viewclick image to switch representation
product molecule RDKit
product molecule DOT

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 fragmentK interfaceR rule fragment
L K R
H full hostD pushout complementH' full product
H D Hprime

Chemical/DOT companion view

L rule fragmentK interfaceR rule fragment
Fragment viewDOT viewclick image to switch representation
L fragment Fragment
L fragment DOT
Fragment viewDOT viewclick image to switch representation
K fragment Fragment
K fragment DOT
Fragment viewDOT viewclick image to switch representation
R fragment Fragment
R fragment DOT
H full hostD pushout complementH' full product
RDKit viewDOT viewclick image to switch representation
H molecule RDKit
H molecule DOT
Fragment viewDOT viewclick image to switch representation
D fragment Fragment
D fragment DOT
RDKit viewDOT viewclick image to switch representation
Hprime molecule RDKit
Hprime molecule DOT

RDKit host/product views

HostProduct
RDKit viewDOT viewclick image to switch representation
host molecule RDKit
host molecule DOT
RDKit viewDOT viewclick image to switch representation
product molecule RDKit
product molecule DOT

Diazomethane azo-form proton-transfer DPO

RDKit molecule quick view

HostProduct
RDKit viewDOT viewclick image to switch representation
host molecule RDKit
host molecule DOT
RDKit viewDOT viewclick image to switch representation
product molecule RDKit
product molecule DOT

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 fragmentK interfaceR rule fragment
L K R
H full hostD pushout complementH' full product
H D Hprime

Chemical/DOT companion view

L rule fragmentK interfaceR rule fragment
Fragment viewDOT viewclick image to switch representation
L fragment Fragment
L fragment DOT
Fragment viewDOT viewclick image to switch representation
K fragment Fragment
K fragment DOT
Fragment viewDOT viewclick image to switch representation
R fragment Fragment
R fragment DOT
H full hostD pushout complementH' full product
RDKit viewDOT viewclick image to switch representation
H molecule RDKit
H molecule DOT
Fragment viewDOT viewclick image to switch representation
D fragment Fragment
D fragment DOT
RDKit viewDOT viewclick image to switch representation
Hprime molecule RDKit
Hprime molecule DOT

RDKit host/product views

HostProduct
RDKit viewDOT viewclick image to switch representation
host molecule RDKit
host molecule DOT
RDKit viewDOT viewclick image to switch representation
product molecule RDKit
product molecule DOT

Diazomethane methyl-transfer DPO

RDKit molecule quick view

HostProduct
RDKit viewDOT viewclick image to switch representation
host molecule RDKit
host molecule DOT
RDKit viewDOT viewclick image to switch representation
product molecule RDKit
product molecule DOT

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 fragmentK interfaceR rule fragment
L K R
H full hostD pushout complementH' full product
H D Hprime

Chemical/DOT companion view

L rule fragmentK interfaceR rule fragment
Fragment viewDOT viewclick image to switch representation
L fragment Fragment
L fragment DOT
Fragment viewDOT viewclick image to switch representation
K fragment Fragment
K fragment DOT
Fragment viewDOT viewclick image to switch representation
R fragment Fragment
R fragment DOT
H full hostD pushout complementH' full product
RDKit viewDOT viewclick image to switch representation
H molecule RDKit
H molecule DOT
Fragment viewDOT viewclick image to switch representation
D fragment Fragment
D fragment DOT
RDKit viewDOT viewclick image to switch representation
Hprime molecule RDKit
Hprime molecule DOT

RDKit host/product views

HostProduct
RDKit viewDOT viewclick image to switch representation
host molecule RDKit
host molecule DOT
RDKit viewDOT viewclick image to switch representation
product molecule RDKit
product molecule DOT

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.

Diazomethane plus acid

RDKit viewDOT viewclick image to switch representation
Diazomethane plus acid RDKit
Diazomethane plus acid DOT

After diazomethane proton transfer

RDKit viewDOT viewclick image to switch representation
After diazomethane proton transfer RDKit
After diazomethane proton transfer DOT

After diazomethane methyl transfer

RDKit viewDOT viewclick image to switch representation
After diazomethane methyl transfer RDKit
After diazomethane methyl transfer DOT

Exact azo-form diazomethane plus acid

RDKit viewDOT viewclick image to switch representation
Exact azo-form diazomethane plus acid RDKit
Exact azo-form diazomethane plus acid DOT

Radicals And Carbenes

Open-shell and carbene states used by the local and DPO rules.

Methylene singlet

RDKit viewDOT viewclick image to switch representation
Methylene singlet RDKit
Methylene singlet DOT

Methylene triplet from rule

RDKit viewDOT viewclick image to switch representation
Methylene triplet from rule RDKit
Methylene triplet from rule DOT

Chlorine radical plus methane

RDKit viewDOT viewclick image to switch representation
Chlorine radical plus methane RDKit
Chlorine radical plus methane DOT

HCl plus methyl radical

RDKit viewDOT viewclick image to switch representation
HCl plus methyl radical RDKit
HCl plus methyl radical DOT

Chlorine radical plus methane plus methyl radical

RDKit viewDOT viewclick image to switch representation
Chlorine radical plus methane plus methyl radical RDKit
Chlorine radical plus methane plus methyl radical DOT

Radical chain after H abstraction

RDKit viewDOT viewclick image to switch representation
Radical chain after H abstraction RDKit
Radical chain after H abstraction DOT

HCl plus ethane

RDKit viewDOT viewclick image to switch representation
HCl plus ethane RDKit
HCl plus ethane DOT

Allyl radical start

RDKit viewDOT viewclick image to switch representation
Allyl radical start RDKit
Allyl radical start DOT

Methyl radical pair

RDKit viewDOT viewclick image to switch representation
Methyl radical pair RDKit
Methyl radical pair DOT

Ethane from radical recombination

RDKit viewDOT viewclick image to switch representation
Ethane from radical recombination RDKit
Ethane from radical recombination DOT

Reference And Verification States

Closed-shell and charge-transfer examples used as sanity checks.

Formose host start

RDKit viewDOT viewclick image to switch representation
Formose host start RDKit
Formose host start DOT

Formose after keto-enol step

RDKit viewDOT viewclick image to switch representation
Formose after keto-enol step RDKit
Formose after keto-enol step DOT

Formose after aldol step

RDKit viewDOT viewclick image to switch representation
Formose after aldol step RDKit
Formose after aldol step DOT

Hydronium/hydroxide ion pair

RDKit viewDOT viewclick image to switch representation
Hydronium/hydroxide ion pair RDKit
Hydronium/hydroxide ion pair DOT

Two waters after neutralization

RDKit viewDOT viewclick image to switch representation
Two waters after neutralization RDKit
Two waters after neutralization DOT

Other Molecule States

Additional generated states in the figure bundle.

Allyl radical shifted

RDKit viewDOT viewclick image to switch representation
Allyl radical shifted RDKit
Allyl radical shifted DOT

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."
]