---
include_toc: true
---

// presynapse.md

**Expansions and modulations**:
  - is expanded and developed by: [AXON](axon.md)
  - is tuned by: [ORGANISM](../../organism.md), organs, modules
  - expands and tunes: [PRE_VGG](pre_vgcc.md)
  - develops _Ca2, _Rrp

  **Introduction**:
  
  The presynaptic bouton releases neurotransmitter and gathers evidence about whether that release was worth strengthening and worth sustaining. Its behavior unfolds across two DAY contexts and the NIGHT scope.

  During DAY, during AP — the bouton releases neurotransmitter. The amount released depends on:
  
  - residual calcium from recent spikes (the fast trace), which sets the release drive;
  - the two retrograde messages from the postsynapse — retro_eCB brakes the drive (the postsynapse is over-driven), retro_NO will later confirm that release reached a responsive target;
  - the availability of both fuel and vesicles — release proceeds only if budget covers the cost and the readily-releasable pool is non-empty. These two shortfalls are read differently: a fuel shortfall on a succeeding release is evidence the bouton needs more endurance; an empty pool with fuel to spare is ordinary short-term depression.
  
  During DAY, during NOT_AP — the bouton consolidates and recovers. With no spike to release, it:
  
  - receives what arrived — latches the retrograde messages, refills its budget from astrocytic lactate and arrived axonal shipment (contested supply);
  - maintains its traces — accumulates eligibility toward a tag, and stabilizes that tag if dopamine has arrived (the bridge toward strength);
  - recovers its readily-releasable pool from the private reserve, between spikes (which is why high-frequency firing depletes faster than it recovers);
  - lets its traces decay, closing the eligibility, endurance, and tagging windows.
  
  During NIGHT — the bouton's ceilings are rewritten. Acting on the evidence gathered across the day, NIGHT raises the bouton's structure (active-zone capacity) where a validated tag accumulated, and its budget capacity (mitochondrial endurance) where fuel repeatedly interrupted a succeeding release. Both draw on the same finite material and energy shipped down the axon, so the bouton's two kinds of growth compete — and whatever is not maintained drifts back down.

# PRESYNAPSE

```Gen

PRESYNAPSE

  type: comprehension

  include: pre_vgcc.md

  // ########################## Intrication ##########################
  
    // Scope
  !DAY: INTRICATE [ scope: &ORGANISM.!DAY ]
  !NIGHT: INTRICATE [ scope: &ORGANISM.!NIGHT ]

    // Context  
  *AP: INTRICATE [ context: &SOMA.*AP ]
  *Spike_train: INTRICATE [ context: &NEURON.*Spike_train ] 

  *Rem: INTRICATE [ context: &HYPOTHALAMUS.*Rem ] 
  *Not_rem_1: INTRICATE [ context: &HYPOTHALAMUS.*Not_rem_1 ] 
  *Not_rem_2: INTRICATE [ context: &HYPOTHALAMUS.*Not_rem_2 ] 

    // Tub
  _NT: INTRICATE [ tub: &ASTROSYNAPSE._NT ] 
  _pre_budget: INTRICATE [ tub: &ASTROCYTE._pre_budget ] 
  _eCB: INTRICATE [ tub: &POSTSYNAPSE._eCB ]

  // ########################## Instantiation ##########################

    // Context

    // Tub
  _Ca2: INSTANTIATE [ tub: local, full: 60x, act: 30x, empty: 0x ]
  _Rrp: INSTANTIATE [ tub: local, full: 60x, act: 30x, empty: 0x ]
  _Rp: INSTANTIATE [ tub: local, full: 60x, act: 30x, empty: 0x ]
  _CaTracesHigh: INSTANTIATE [ tub: local, full: 60x, act: 30x, empty: 0x ]
  _CaTracesMedium: INSTANTIATE [ tub: local, full: 60x, act: 30x, empty: 0x ]
  _CaTracesLow: INSTANTIATE [ tub: local, full: 60x, act: 30x, empty: 0x ]

  _Ca2FullDev: INSTANTIATE [ tub: local, full: 60x, act: 30x, empty: 0x ]
  _RrpFullDev: INSTANTIATE [ tub: local, full: 60x, act: 30x, empty: 0x ] // serve al DEV

    // Container
  void: INSTANTIATE [ scope: !DAY, container: ACTION, context:  *AP ]
  void: INSTANTIATE [ scope: !DAY, container: RECOVERY, context:  NOT *AP,  *Spike_train ]
  void: INSTANTIATE [ scope: !DAY, container: PREPARE, context: * NOT Spike_train ]
  void: INSTANTIATE [ scope: !NIGHT, container: ACTION, context:  *Not_rem_1 ]
  void: INSTANTIATE [ scope: !NIGHT, container: RECOVERY, context:  *Not_rem_2 ]
  void: INSTANTIATE [ scope: !NIGHT, container: PREPARE, context:  *Rem ]

  // ########################## Expansion ##########################

  _@pre_vgcc: INSTANTIATE [ tub: EXPAND [ comprehension: PRE_VGCC ], full: 10x, active: 5x, empty: 2x ] // PRE_VGCC, il tub  _@pre_vgcc serve al tuning
    
```
  
## !DAY | ACTION | *AP 

```Gen

ACTION

  type: container

  // ########################## NTRelease | Fast (ms–s) ##########################

  // Devo aggiungere la limitazione dovuta al Glutamate Spillover GluR e retro_eCB !!!!
  
  NTreleaseLow: INSTANTIATE [ snippet: accumulator, event: 12x ] {
    hypothesis: _Ca2 mediumness AND _Rrp mediumness AND NOT _pre_budget empty 
      action: [ _Rrp decrease, _NT increase ]
      cost: [ _pre_budget decrease 3x ] 
    else: None
  }
  
  NTreleaseMedium: INSTANTIATE [ snippet: accumulator, event: 9x ] {
    hypothesis: ( _Ca2 fullness AND _Rrp mediumness ) OR ( _Ca2 mediumness AND _Rrp fullness ) AND NOT _pre_budget empty 
      action: [ _Rrp decrease, _NT increase ]
      cost: [ _pre_budget decrease 3x ] 
    else: None
  }

  NTreleaseHigh: INSTANTIATE [ snippet: accumulator, event: 6x ] {
    hypothesis: _Ca2 fullness AND _Rrp fullness AND NOT _pre_budget empty
      action: [ _Rrp decrease, _NT increase ]
      cost: [ _pre_budget decrease 3x ] 
    else: None
  }

  // ########################## Endurance | Fast (ms–s) ##########################
  
    // Tag se manca pre_budget, ma il rilascio di NT sarebbe stato di beneficio

  Endourance_tag: INSTANTIATE [ snippet: accumulator, event: 9x ] {
    hypothesis: _pre_budget empty AND NOT deve esserci la possibilita di spikare e altri segnali come NO 
      action: [ _pre_endurance_tag increase ]
      cost: None
    else: None
  }

```
  
## !DAY | RECOVERY | NOT *AP, *Spike_train

```Gen

RECOVERY

  type: container

  // ########################## _Ca2 level | Fast (ms–s) ##########################

  TracesAccLow: INSTANTIATE [ snippet: accumulator, event: 3x ] {
    hypothesis: _Ca2 emptiness
      action: [ _CaTraceLow increase ]
      cost: None
    else: None
  }
  
  TracesAccMedium: INSTANTIATE [ snippet: accumulator, event: 6x ] {
    hypothesis: _Ca2 mediumness
      action: [ _CaTraceMed increase ]
      cost: None
    else: None
  }

  TracesAccHigh: INSTANTIATE [ snippet: accumulator, event: 10x ] {
    hypothesis: _Ca2 fullness
      action: [ _CaTraceHigh increase ]
      cost: None
    else: None
  }

  // ########################## TracesClearance | Fast (ms–s) ##########################

    TracesClearance: INSTANTIATE [ snippet: accumulator, event: 30x] {
    
      hypothesis: NOT _CaTraceHigh empty
        action: [ _CaTRaceHigh decrease ]
        cost: None
      else: None

      hypothesis: NOT _CaTraceMedium empty
        action: [ _CaTRaceMedium decrease ]
        cost: None
      else: None

      hypothesis: NOT _CaTraceLow empty
        action: [ _CaTRaceLow decrease ]
        cost: None
      else: None

    }

  // ##########################  Rp Shuttle | Fast (ms–s) ##########################

    // The "Hard Bottleneck" State. Recruitment is throttled by a lack of signal, a lack of supply, or a lack of space. 
    // If even one of these "Near-Stop" conditions is met, the rate cannot exceed "Slow," regardless of the other two conditions. 
    // Rate: 0.00 – 0.25
  
  RPShuttleLow: INSTANTIATE [ snippet: accumulator, event: 24x ] {
    hypothesis: _CaTraceLow fullness OR _RP emptiness OR _Rrp fullness
      action: [ _RP decrease, _Rrp increase ]
      cost:
    else: None
  }

    // The "Sub-Optimal" State. The machinery is working, but it's held back by partial limitations. 
    // This covers cases where the signal is steady but the "piston" isn't firing at full speed, 
    // or where a high vacancy in the RRP (emptiness) forces a low signal to work a bit harder. Rate: 0.50 – 0.97

  RPShuttleMedium: INSTANTIATE [ snippet: accumulator, event: 48x ] {
    hypothesis: ( _CaTraceMedium fullness AND _RP mediumness AND _Rrp mediumness ) OR 
                ( _CaTraceHigh fullness AND _RP mediumness AND _Rrp mediumness ) OR   # signal boost
                ( _CaTraceMedium fullness AND _RP fullness AND _Rrp mediumness ) OR   # supply boost
                ( _CaTraceMedium fullness AND _RP mediumness AND _Rrp emptiness )     # vacancy boost
      action: [ _RP decrease, _Rrp increase ]
      cost: 
    else: None
  }

```
  
## !DAY | PREPARE | NOT *Spike_train 

```Gen

PREPARE

  type: container

  // ########################## PRE_VGCC Tun | Medium (s–min) ##########################

    // qui stiamo attivando e disattivando PRE_VGCC. Fra un massimo full e minimo empty (empty puo' non essere 0)
    
  VgccTun: INSTANTIATE [ snippet: accumulator, event: 60x ] {
  
    condition:  _CaTraceHigh fullness
      hypothesis:  
        action:
        cost: [ _pre_budget decrease 3x ] 
      else: 
        
    condition:  _CaTraceLow fullness
      hypothesis:  
        action:
        cost: [ _pre_budget increase 3x ] 
      else: 
  }

  // ########################## RefillGlutamine | Medium (s–min) ##########################

    // The "High Performance" State. Multiple systems are optimized, but one is still at a "mediumness" level. 
    // This represents an active synapse that hasn't reached its absolute peak because either the supply is only 50% 
    // or the \_Rrp isn't empty enough to create that "maximal vacuum" pull. Rate: 1.25 – 1.94

  RefillGlutamine: INSTANTIATE [ snippet: accumulator, event: 24x ] {
    hypothesis: ( _CaTraceHigh fullness AND _RP fullness AND _Rrp mediumness ) OR   # signal + supply
                ( _CaTraceHigh fullness AND _RP mediumness AND _Rrp emptiness ) OR  # signal + vacancy
                ( _CaTraceMedium fullness AND _RP fullness AND _Rrp emptiness )     # supply + vacancy
      action: [ _RP decrease, _Rrp increase ]
      cost: 
    else: None
  }

  // ########################## eCBClearance | Medium (s–min) ##########################
  
    eCBClearenceMedium: INSTANTIATE [ snippet: accumulator, event: 24x ] {
      hypothesis: NOT _eCB empty
        action: [ _eCB decrease ]
        cost: 
      else: None
    }

    eCBClearenceLow: INSTANTIATE [ snippet: accumulator, event: 48x] {
      hypothesis: NOT _eCB empty
        action: [ _eCB decrease ]
        cost: 
      else: None
    }
    
```

## !NIGHT | ACTION | *Not_rem_1

```Gen

DEVELOP

  type: container

  // !NIGHT | ???

  // ########################## CaFull | ??? ##########################

  Ca2Check: INSTANTIATE [ snippet: accumulator, event: 60x ] {
  
    condition: ( empty ) // CaFullDecrease
      hypothesis: NOT ( full ) AND NOT ( empty ) 
        action: [ increase,  decrease]
        cost: 
      else: None
      
    condition: ( full) // Ca2FullIncrease
      hypothesis: NOT ( full ) AND NOT ( empty ) 
        action: [ increase,  decrease]
        cost: 
      else: None
  }

  // ########################## RRPFull | ??? ##########################
  
  RrpCheck: INSTANTIATE [ snippet: accumulator, event: 60x ]
  
    condition: ( empty ) // RrpFullDecrease
      hypothesis: NOT ( full ) AND NOT ( empty ) 
        action: [ increase,  decrease]
        cost: 
      else: None
      
    condition: ( full) // RrpFullIncrease
      hypothesis: NOT ( full ) AND NOT ( empty ) 
        action: [ increase,  decrease]
        cost: 
      else: None
  }

```

## !NIGHT | RECOVERY | *Not_rem_2

## !NIGHT | PREPARE | *Rem
