> For the complete documentation index, see [llms.txt](https://guardian.hedera.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guardian.hedera.com/docs/3.6.0/methodology-digitization/methodology-digitization-handbook/part-5.md).

# Part V: Calculation Logic Implementation

> **Status**: ✅ Complete and Available\
> **Implementation Focus**: VM0033 emission reduction calculations, Guardian Tools architecture, and comprehensive testing frameworks

This part covers the implementation of calculation logic in Guardian environmental methodologies, with VM0033 as the primary example and AR Tool 14 demonstrating Guardian's Tools architecture.

## Part Overview

Part V provides comprehensive guidance on implementing and testing calculation logic for environmental methodologies in Guardian:

### [Chapter 18: Custom Logic Block Development](/docs/3.6.0/methodology-digitization/methodology-digitization-handbook/part-5/chapter-18.md)

Complete implementation of VM0033 emission reduction calculations using Guardian's customLogicBlock, including baseline emissions, project emissions, leakage calculations, and final net emission reductions with real JavaScript production code.

### [Chapter 19: Formula Linked Definitions (FLDs)](/docs/3.6.0/methodology-digitization/methodology-digitization-handbook/part-5/chapter-19.md)

Foundation concepts and architectural framework for parameter relationships and dependencies in environmental methodologies, establishing patterns for future FLD implementation.

### [Chapter 20: Guardian Tools Architecture and Implementation](/docs/3.6.0/methodology-digitization/methodology-digitization-handbook/part-5/chapter-20.md)

Complete guide to building Guardian Tools using AR Tool 14 as practical example, covering the extractDataBlock → customLogicBlock → extractDataBlock mini-policy pattern for standardized calculation tools.

### [Chapter 21: Calculation Testing and Validation](/docs/3.6.0/methodology-digitization/methodology-digitization-handbook/part-5/chapter-21.md)

Comprehensive testing framework using Guardian's dry-run mode and customLogicBlock testing interface, with validation against VM0033 test artifacts at every calculation stage.

## Key Artifacts and Resources

* [**VM0033 Test Spreadsheet**](https://github.com/hashgraph/guardian/blob/develop/docs/methodology-digitization-handbook/_shared/artifacts/VM0033_Allcot_Test_Case_Artifact.xlsx) - Official Allcot test case
* [**Final PDD VC**](https://github.com/hashgraph/guardian/blob/develop/docs/methodology-digitization-handbook/_shared/artifacts/final-PDD-vc.json) - Complete Guardian VC with net ERR data
* [**ER Calculations**](https://github.com/hashgraph/guardian/blob/develop/docs/methodology-digitization-handbook/_shared/artifacts/er-calculations.js) - Production JavaScript implementation
* [**AR Tool 14 Implementation**](https://github.com/hashgraph/guardian/blob/develop/docs/methodology-digitization-handbook/_shared/artifacts/AR-Tool-14.json) - Complete Guardian Tool configuration

## Prerequisites for Part V

* Completed Parts I-IV: Foundation through Policy Workflow Implementation
* Understanding of Guardian's Policy Workflow Engine (PWE)
* Basic JavaScript programming knowledge
* Familiarity with environmental methodology calculations

## Learning Outcomes

After completing Part V, you will be able to:

✅ **Implement calculation logic** using Guardian's customLogicBlock with real production examples\
✅ **Build Guardian Tools** using the extractDataBlock and customLogicBlock pattern\
✅ **Test and validate calculations** using Guardian's dry-run mode and testing interfaces\
✅ **Debug calculation issues** using Guardian's built-in debugging tools\
✅ **Create production-ready** environmental methodology implementations

## Next Steps

Part V completes the core implementation knowledge needed for Guardian methodology digitization. Future parts will cover:

* **Part VI**: Integration and Testing - End-to-end policy testing and API automation
* **Part VII**: Deployment and Maintenance - Production deployment and user management
* **Part VIII**: Advanced Topics - External system integration and troubleshooting

***

{% hint style="success" %}
**Part V Complete**: You now have comprehensive knowledge of calculation logic implementation in Guardian, from individual customLogicBlocks to complete testing frameworks. These skills enable building production-ready environmental methodologies with confidence in calculation accuracy.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://guardian.hedera.com/docs/3.6.0/methodology-digitization/methodology-digitization-handbook/part-5.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
