Leanpub Header

Skip to main content

Dependent Types (DTT) & Logic for AI Agent Ready Knowledge Graphs

Dependent Types (DTT) & Logic  for AI Agent Ready Knowledge Graphs
This book is 92% completeUpdated 30 Nov 2026

Your knowledge graphs are fundamentally broken. RDF forces complex relationships into binary triples. OWL can't express real constraints. SHACL catches errors after corruption spreads.

Dependent types change everything. Types that depend on values make invalid data impossible to construct. Higher-order logic enables meta-reasoning about relationships. Contextual types handle knowledge that varies by time and perspective.

This book reveals how type theory solves problems RDF/OWL cannot address:

  • Native hypergraph representation
  • Formal constraint verification
  • AI memory systems for edge devices
  • Scientific knowledge evolution

Learn practical implementations in ELPI, TypeDB, Twelf, and Beluga. Discover migration strategies from existing RDF infrastructure.

The future of AI demands better knowledge representation. The future of knowledge representation is type theory.

Ready to build knowledge systems that match reality's complexity?

Minimum price

$20.00

$45.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
WEB
APP
About

About

About the Book

About This Book

This book explores the intersection of formal logic, type theory, and knowledge representation, arguing for a fundamental shift from traditional RDF/OWL-based approaches to type-theoretic foundations for knowledge graphs and AI systems.

Overview

We stand at a critical juncture in knowledge representation. While RDF and OWL have served as foundational technologies for the semantic web, their limitations become increasingly apparent as we build more sophisticated AI systems requiring complex reasoning, contextual knowledge, and formal guarantees. This book presents a comprehensive exploration of how dependent type theory, higher-order logic, and advanced programming language concepts can revolutionize knowledge representation.

Drawing parallels between Russell's Paradox in set theory and current limitations in knowledge graphs, we demonstrate why moving beyond first-order logic is not just beneficial but necessary for the next generation of AI systems. The book combines theoretical foundations with practical implementations, showing how languages like Twelf, Beluga, ELPI, and TypeDB point toward a more expressive and reliable future for knowledge representation.

Key Topics

Foundational Concepts

  • Dependent Type Theory: Types that depend on values, enabling precise specification of data relationships and constraints
  • Higher-Order Logic: Quantification over predicates and functions for meta-level reasoning
  • Logical Frameworks: LF and contextual modal type theory as foundations for formal systems
  • Unification Theory: From Prolog's first-order unification to higher-order pattern unification

Programming Languages and Systems

  • Lambda Prolog and ELPI: Higher-order logic programming for knowledge representation
  • Twelf: Logical framework for encoding deductive systems and ontologies
  • Beluga: Programming with contextual types and first-class contexts
  • F*: Functional programming with dependent types for verified software
  • TypeDB: Polymorphic database design with concept modeling

Knowledge Representation Evolution

  • Beyond RDF Triples: Moving from binary relations to hypergraphs and metagraphs
  • Ontology Verification: Formal validation of consistency, satisfiability, and structural properties
  • Context-Sensitive Knowledge: Representing knowledge that varies by time, location, or perspective
  • Constraint Integration: Unifying ontology definition with data validation

Advanced Applications

  • AI Memory Systems: Type-theoretic approaches to artificial agent memory
  • Personal Knowledge Graphs: Scalable, privacy-preserving knowledge for edge AI
  • Hypergraph Ontologies: Native representation of n-ary relationships
  • Scientific Knowledge Modeling: Formal approaches to evolving scientific understanding

Chapter Topics

  1. Introduction: The Problem We Have vs. The Problem We Understand
  2. Russell's Paradox and Knowledge Representation
  3. From Set Theory to Type Theory
  4. First-Order Logic and Its Limitations
  5. Higher-Order Logic for Knowledge Graphs
  6. Dependent Types: A New Paradigm for Ontologies
  7. Lambda Prolog and ELPI: Logic Programming Meets Types
  8. Twelf for Hypergraph Ontology
  9. Beluga: Programming with Contexts
  10. F: Verified Knowledge Systems*
  11. TypeDB: Polymorphic Databases for AI
  12. Understanding Unification: From Prolog to Higher-Order Logic
  13. Emergent Intelligence in AI Agents and Knowledge Graphs
  14. Personal Knowledge Graphs and Edge AI
  15. Implementation Strategies and Practical Considerations

Target Audience

This book is designed for:

  • Researchers in knowledge representation, semantic web, and formal methods
  • AI Engineers building systems that require sophisticated knowledge modeling
  • Graduate Students in computer science, particularly those studying logic, type theory, or AI
  • Software Architects designing knowledge-intensive applications
  • Ontology Engineers seeking more expressive and reliable representation frameworks

Prerequisites

Readers should have familiarity with:

  • Basic logic and set theory
  • Functional programming concepts
  • RDF/OWL and semantic web technologies
  • Fundamental computer science theory

No prior experience with dependent types or proof assistants is required, though familiarity with these concepts will enhance understanding.

What Makes This Book Different

Unlike traditional treatments of knowledge representation that focus on extending existing technologies, this book advocates for a fundamental paradigm shift. It bridges the gap between theoretical computer science (type theory, formal logic) and practical AI engineering, showing how advanced programming language concepts can solve real-world knowledge representation challenges.

The book emphasizes working implementations and practical examples rather than purely theoretical discussions, demonstrating how these advanced concepts can be applied to build more reliable, expressive, and verifiable knowledge systems.

Bundle

Bundles that include this book

Author

About the Author

Volodymyr Pavlyshyn

Hey I am Volodymyr 

Seasoned Developer's Journey from COBOL to Web 3.0, SSI, Privacy First Edge AI, and Beyond

 As a seasoned developer with over 20 years of experience, I have worked with various programming languages, including some that are considered "dead," such as COBOL and Smalltalk. However, my passion for innovation and embracing cutting-edge technology has led me to focus on the emerging fields of Web 5.0, Self-Sovereign Identity (SSI),AI Agents, Knowledge Graphs, Agentiic memory systems, and the architecture of a decentralized world that empowers data democratization.

A firm believer in the potential of agent systems and the concept of a "soft" internet, I am dedicated to exploring and promoting these transformative ideas. In addition to writing, I also enjoy sharing my knowledge and insights through videoblogging. Most of my Medium posts serve as supplementary content to the videos on my YouTube channel, which you can explore here: https://www.youtube.com/c/VolodymyrPavlyshyn. 

Join me on this exciting journey as we delve into the future of technology and the possibilities it holds.

Contents

Table of Contents

About book

About the Author

About a cover

We do not solve the problems we have; we solve the problems we understand.

  1. Introduction to Lene Rachel Andersen
  2. Understanding of the Problem
  3. Misunderstanding Makes It Worse
  4. Complexity and Complex Problems
  5. Emotional Comfort for Complex Problems
  6. New Education: The Place of Bildung and Ego Development
  7. Philosophy as a Key to Understanding: Epistemology, Reasoning, Logic, and Ethics
  8. How to Build Organizations That Understand
  9. Conclusion

Emergent Intelligence: How More Becomes Different in Architecture of AI Agents and Knowledge Graphs

  1. The Scaling Problem in Software
  2. Knowledge Graphs: The Ultimate Emergent Structure
  3. Broken Symmetry in Software Architecture
  4. AI Agents and Memory: Emergence of Digital Consciousness
  5. Hierarchical Organization of Software Complexity
  6. Conclusion: The New Whole

Evolution of Knowledge Graphs and AI Agents

  1. Static Graphs
  2. Dynamic Graphs
  3. Temporal Graphs
  4. Event Graphs
  5. LLMs in Graph Construction
  6. Dynamic Graphs and Entity/Relation Extraction with LLMs
  7. Temporal Graphs and Temporal Context Extraction
  8. Event Graphs and Event Context Extraction
  9. Event Graphs and Episodic Memory for AI Agents
  10. Conclusion

Metagraphs and Hypergraphs for complex AI agent memory and RAG

  1. Knowledge graphs and not just graphs
  2. Strings not things
  3. Knowledge Graphs are not enough, and Tripples is not enough.
  4. Temporal aware Semantic and Episodic memory for AI agents
  5. Hypergraphs as rescue
  6. Named Graphs and Graph of Graphs for Multi-model and multilingual data
  7. Humman-like memories for AI Agent with Metagraph

The Semantic Hypergraph (SH) Model: A Deep Dive into Representing Linguistic Meaning

  1. Understanding Hypergraphs: Beyond Pairwise Connections
  2. Core Concepts of Semantic Hypergraphs: Weaving Meaning
  3. The SH Type System: A Grammar for Semantic Roles
  4. Atomic Types (Atoms)
  5. Non-Atomic Types (Inferable)
  6. Argument Roles: Enhancing Semantic Precision
  7. Knowledge Representation in Semantic Hypergraphs: Illustrative Examples
  8. Goals, Advantages, and Potential Applications of the SH Model
  9. Relation to Other Knowledge Representation Formalisms (A Comparative Perspective)
  10. Challenges and Future Directions
  11. Conclusion: Charting a Course for Deeper Semantic Understanding

Metagraphs as Homoiconic Structures: Revolutionizing Knowledge Representation

  1. Understanding Homoiconicity in Knowledge Structures
  2. Metagraphs: Beyond Traditional Graph Representations
  3. The Synthesis: Metagraphs as Homoiconic Structures
  4. 1. Schema as Data
  5. 2. Operations as Graph Elements
  6. 3. Recursive Self-Description
  7. 4. Emergent Semantic Layers
  8. Practical Applications
  9. Knowledge Engineering and Ontology Management
  10. Adaptive AI Systems
  11. Complex Systems Modeling
  12. Data Integration and Federated Knowledge
  13. Intelligent Business Process Management
  14. Implementation Challenges and Approaches
  15. Computational Efficiency
  16. Representational Clarity
  17. Future Directions
  18. Cognitive Architectures
  19. Distributed Knowledge Commons
  20. Neurosymbolic Integration
  21. Conclusion

Beyound Knowledge Graphs for AI - Why we need Something different

  1. Beyond Binary Relations: The Memory Project Revelations
  2. When Simple Graphs Meet Complex Reality
  3. Hitting the Wall: The Limitations of Binary Relations
  4. The Emergence of Complex Hierarchies
  5. The Complexity of Construction Rules
  6. The Inadequacy of First-Order Logic
  7. The Path Forward: From Theory to Implementation

Why Logic

  1. The Foundational Role of Logic in Knowledge Representation
  2. Beyond Validation: Logic as Computational Foundation
  3. The Limits of First-Order Approaches
  4. The Path Forward: Higher-Order Logic and Type Theory

Logical Frameworks

  1. The Architecture of Formal Reasoning
  2. From Theory to Practice: Framework Implementation
  3. Framework Selection and Trade-offs
  4. First Order Logic
  5. The Structure of First-Order Logic
  6. First-Order Logic in Knowledge Graphs
  7. The Power of First-Order Reasoning
  8. Limitations in AI Agent Memory Systems
  9. Bridging to Higher-Order Frameworks
  10. Higher Order Logic
  11. The Architecture of Higher-Order Logic
  12. Higher-Order Logic in Knowledge Representation
  13. Implementation Challenges and Solutions
  14. Higher-Order Logic in Practice: ELPI and Lambda Prolog
  15. Contextual Reasoning and Hypothetical Knowledge
  16. Integration with Type-Theoretic Approaches

Type Theory

  1. The Curry-Howard Correspondence
  2. Types as Specifications
  3. Computational Content and Constructive Logic
  4. The Progression to Dependent Types
  5. Simple Type Theory
  6. The Type Hierarchy and Classification
  7. Type-Directed Knowledge Organization
  8. Simple Types in Knowledge Graph Systems
  9. Implementation in Programming Language Foundations
  10. Limitations and Extensions
  11. The Bridge to Dependent Types
  12. Dependent Type Theory
  13. The Foundation: Types Depending on Values
  14. Dependent Types in Knowledge Representation
  15. The Pi and Sigma Type Constructors
  16. Dependent Types and Proof-Relevant Programming
  17. Practical Challenges and Solutions
  18. Implementation Strategies in Knowledge Systems
  19. Dependent Types and Hypergraph Ontologies
  20. Quasi Dependent Types
  21. Restricted Dependency Mechanisms
  22. Practical Applications in Knowledge Systems
  23. Integration Strategies for Knowledge Graphs
  24. Balancing Expressiveness and Tractability
  25. Future Directions and Research Opportunities

Dependent Types: A New Paradigm for Ontologies and Knowledge Graphs

  1. What is Dependent Type Theory (DTT)?
  2. OWL’s Logical Foundations and Limitations
  3. How DTT Enhances Knowledge Modeling
  4. Using Proof Assistants and Dependently-Typed Languages
  5. Hypergraphs and Higher-Order Relationships
  6. Conclusion

Type Theory, AI Memory and Metagraphs

  1. Russell’s Paradox
  2. Set Theory Is Not Wrong, But Has Paradoxes
  3. RDF Is Not Wrong, But Not Enough
  4. Meta and Hyper Graphs for AI Memory
  5. Type Theory for Graph Modeling
  6. Conclusion

DataLog and Prolog as AI first Languages

  1. A Historical Perspective and Future Implications
  2. The Birth of AI Programming: Lisp and Symbolic Reasoning
  3. The European Response: Prolog and First-Order Logic
  4. The Power of Declarative Programming
  5. Datalog: The Elegant Subset
  6. Why This History Matters for Modern AI
  7. The Future of Logic-Based AI
  8. A Call to Rediscover Logic

Personal Knowledge Graphs. Semantic Entity Persistence in DataLog. Deductive databases

  1. Common Logic and power of relations
  2. DataLog as a GPT like program
  3. Entities modeling
  4. Conclusion

High-Order Logic Languages for Unifying OWL and SHACL

  1. DataLog and Prolog for Ontology
  2. OWL and Second-Order Logic Capabilities
  3. Why We Need HOL for Ontology
  4. Dependent Type Theory and HOL for Ontology
  5. HOL and DTT for Hypergraph Ontology
  6. Conclusion

TypeDB: A Polymorphic Database for AI Agent Memory and Complex Ontology

  1. Graph DB and Object Impedance
  2. Failure of Object Databases
  3. PERA and Concept Modeling
  4. Concept Modeling and Concept Graphs
  5. Concept Modeling and Dependent Types Theory
  6. Relations and Hypergraph Modeling
  7. TypeDB and Deductive Capabilities with Rules
  8. Conclusion

F*: The Dependently Typed Programming Language for Software Verification

  1. Origins and Design Philosophy
  2. Core Features
  3. Dependent Types
  4. Effects System
  5. Proof-Oriented Programming
  6. Multi-Target Compilation
  7. Real-World Applications
  8. Project Everest
  9. Security-Critical Applications
  10. Learning Curve and Adoption Challenges
  11. Comparison with Other Verification Tools
  12. Future Directions
  13. Conclusion

Twelf: Dependent Types and Logic for Knowledge Graph and Ontology Description

  1. Knowledge Representation in Twelf
  2. Type-Based Entity Representation
  3. Relations as Dependent Types
  4. Ontology Formalization
  5. Judgment-Based Class Hierarchies
  6. Constraint Modeling
  7. Reasoning and Querying
  8. Inference Rules
  9. Query Execution
  10. Advantages for Knowledge Graph Applications
  11. Comparison with Mainstream Approaches
  12. Formal Foundations
  13. Type System Capabilities
  14. Reasoning Capabilities
  15. Verification Strength
  16. Expressivity Trade-offs
  17. Practical Considerations
  18. Use Cases

Twelf for Hypergraph Ontology: A Comprehensive Guide

  1. Twelf as a Meta-Logical Framework
  2. Hypergraphs in Ontology
  3. Integration of Twelf with Hypergraph Ontologies
  4. Formal Representation Capabilities
  5. Semantic Hypergraphs for Ontology Modeling
  6. Knowledge Representation for Complex Domains
  7. Implementation challenges in these domains include:
  8. Implementation Techniques and Tools
  9. Advanced Topics and Future Directions
  10. Integration with Other Formalisms
  11. Scalability and Performance
  12. Applications in Emerging Fields
  13. Implementing Twelf for Hypergraph Ontology: A Complete Example
  14. Basic Declarations
  15. Hypergraph Structure
  16. Inference Rules
  17. Querying the Ontology
  18. Advanced Features: Modular Organization
  19. Extension: Temporal Aspects
  20. Conclusion

Lambda Prolog and ELPI: Advancing Knowledge Graphs and Complex Ontologies

  1. The Origins and Foundations of Lambda Prolog
  2. Higher-Order Terms and Unification
  3. Scoped Logical Variables
  4. Hypothetical Reasoning
  5. Strong Typing
  6. ELPI: Revitalizing Lambda Prolog for Modern Computing
  7. Performance Breakthrough
  8. Embeddability by Design
  9. Constraint Handling Rules
  10. Knowledge Graphs and Ontologies: The Representational Challenge
  11. The Limitations of First-Order Approaches
  12. The Expressivity-Tractability Tradeoff
  13. ELPI for Advanced Knowledge Representation
  14. Representing Higher-Order Relationships
  15. Contextual and Modal Reasoning
  16. Meta-Ontology and Ontology Evolution
  17. Constraint-Based Knowledge Validation
  18. ELPI for Hypergraph Knowledge Representation
  19. Native Hyperedge Representation
  20. Hypergraph Traversal and Pattern Matching
  21. Advanced Applications in Domain-Specific Knowledge Graphs
  22. Biomedical Knowledge Integration
  23. Legal and Regulatory Knowledge Graphs
  24. Scientific Knowledge Discovery
  25. Implementation Strategies and Challenges
  26. Integration with Existing Knowledge Infrastructures
  27. Performance and Scalability Considerations
  28. Knowledge Acquisition and Maintenance Workflows
  29. Future Directions and Research Opportunities
  30. Neural-Symbolic Integration
  31. Distributed Knowledge and Federated Reasoning
  32. Human-AI Collaborative Knowledge Engineering
  33. Conclusion

Understanding Unification: From Prolog to Higher-Order Logic

  1. Prolog Unification: The Foundation
  2. What is Prolog Unification?
  3. The Unification Algorithm
  4. Detailed Examples
  5. Implementation Considerations
  6. Beta Reduction: Function Application in Lambda Calculus
  7. What is Beta Reduction?
  8. Formal Definition and Properties
  9. Connection to Higher-Order Logic
  10. Examples in Different Contexts
  11. Beta Reduction in the Paper’s Context
  12. Higher-Order Unification: The Challenge
  13. The Fundamental Complexity
  14. Why Higher-Order Unification is Harder
  15. The Pattern Fragment
  16. Key Challenges
  17. Detection Algorithms
  18. The Solution Approach
  19. Practical Implementation
  20. The Elpi System
  21. Implementation Architecture
  22. Key Innovations
  23. Benefits and Trade-offs
  24. Real-World Application
  25. Conclusion

Beluga for Ontologies and Knowledge Graphs: Bridging Formal Systems and Semantic Knowledge

  1. Understanding Beluga: A Programming Language for Formal Reasoning
  2. The Logical Framework Foundation
  3. Higher-Order Abstract Syntax (HOAS)
  4. First-Class Contexts and Contextual Objects
  5. Dependently Typed System
  6. Inductive Proofs as Programs
  7. Understanding Ontologies and Knowledge Graphs
  8. Ontologies: Formal Representations of Knowledge Domains
  9. Knowledge Graphs: Practical Applications of Ontologies
  10. The Role of Ontologies in Knowledge Graphs
  11. Potential Applications of Beluga for Ontologies and Knowledge Graphs
  12. 1. Formal Verification of Ontology Consistency
  13. 2. Ontology Evolution and Change Management
  14. 3. Reasoning with Contextual Knowledge
  15. 4. Mapping Between Ontologies
  16. 5. Knowledge Graph Schema Validation
  17. A Concrete Example: Verifying a Simple Ontology with Beluga
  18. The University Ontology
  19. Encoding the Ontology in Beluga
  20. Verifying Ontology Properties with Beluga
  21. Validating Cardinality Constraints
  22. Benefits of the Beluga Approach
  23. Implementation Challenges and Considerations
  24. 1. Bridging Different Formalisms
  25. 2. Scalability Concerns
  26. 3. Integration with Existing Tools
  27. 4. Usability for Domain Experts
  28. Practical Implementation Approach
  29. 1. Develop a Formal Representation of OWL/RDF Semantics in Beluga
  30. 2. Create Verification Libraries for Common Ontology Patterns
  31. 3. Build Interfaces to Existing Knowledge Graph Management Systems
  32. 4. Implement a Layer of Abstraction for Domain Experts
  33. Conclusion

Emulating Dependent Types in Elpi: A Journey into Logic Programming and Type Theory

  1. What are Dependent Types? A Deeper Dive
  2. Why Elpi for Emulating Dependent Types? The Unique Advantage
  3. Emulating Dependent Types in Elpi: A Conceptual and Practical Approach
  4. Applying This Model to Hypergraph Ontology
  5. Practical Implications and Next Steps

Beyond OWL and SHACL: Why Dependent Type Theory is the Future of Knowledge Representation

  1. The Binary Trap: What OWL Cannot Express
  2. Agda: Types as Theorems, Programs as Proofs
  3. Hypergraphs in Agda: Natural Multi-way Relationships
  4. Metagraphs: Graphs Within Graphs
  5. Temporal Metagraphs: Knowledge That Evolves
  6. The Challenges: Why Hasn’t Everyone Switched?
  7. The Learning Curve Cliff
  8. The Tooling Gap
  9. Open World vs. Closed World
  10. Runtime vs. Compile-Time
  11. The Hybrid Path Forward
  12. Use Agda for Core Specifications
  13. Use OWL/SHACL for Integration and Runtime
  14. Use Agda for Hypergraphs and Metagraphs
  15. Real-World Impact: Trust Registries and SSI
  16. Beyond Replacement: A New Paradigm

Temporal Awareness in Knowledge Systems: A Modal Homotopy Type Theory Perspective

  1. The Problem: Time in Traditional Knowledge Systems
  2. The Temporal Blindness of Static Knowledge Graphs
  3. Modal Type Theory: A Primer
  4. From Types to Spaces: The HoTT Foundation
  5. Adding Modality: Operators on Types
  6. Temporal Modalities for Knowledge Systems
  7. The Later Modality: Guarded Recursion and Evolving Knowledge
  8. Accessibility Modalities: Knowledge Through Time
  9. Epistemic-Temporal Modalities: What the Agent Knows When
  10. Type-Theoretic Foundations: Making It Formal
  11. Temporal Types as Indexed Families
  12. The Later Modality as a Type Constructor
  13. Modal Operators as Monads
  14. Temporal Knowledge Graphs
  15. From Static to Dynamic Structure
  16. Layered Temporal Structure: From Events to Meanings
  17. Causal Structure and Temporal Paths
  18. Agent Memory and Temporal Self-Knowledge
  19. Episodic Memory as Temporal Structures
  20. Semantic Memory as Modal Knowledge
  21. Temporal Self-Awareness: The Meta-Temporal Agent
  22. 7. Practical Implementation: From Theory to Systems
  23. Encoding Modal Types in Practical Systems
  24. Query Languages for Temporal Modalities
  25. Implementing Temporal Reasoning
  26. Temporal Planning and Action Selection
  27. Contextual Knowledge Retrieval
  28. Explainable Temporal Reasoning
  29. Collaborative Agent Systems with Shared Temporal Context
  30. Metagraphs and Higher-Order Temporal Structure
  31. Semantic Spacetime and Cohesive HoTT
  32. Conclusion: Toward Temporally Aware AI

The Geometry of Knowledge: How Cubic Types Reveal the Hidden Architecture of Metagraphs

  1. The Problem with Flat Graphs
  2. When Paths Became First-Class Citizens
  3. The Cubical Revolution
  4. The Hidden Geometry of Metagraphs
  5. Zooming In and Out
  6. The Query Language of Cubes
  7. The Practical Reality
  8. The Philosophy of Levels
  9. The Frontiers
  10. The Unification
  11. The Shape of Knowledge

Metagraphs in Cubical Agda: From Geometry to Running Code

  1. Setting Up
  2. Paths Are Functions out of the Interval
  3. The Agent’s Vocabulary
  4. A Metagraph with Unordered Ends
  5. Identity Lifts Through Every Level
  6. Queries Must Respect Identity
  7. Paths Between Paths, and Why We Truncate
  8. Schema Evolution Is a Path
  9. What Cubical Agda Gives, and Where It Stops

Why Lean 4 Is a Good Compromise

  1. The Four Pressures
  2. One File: Data, Program, Proof
  3. A Small Kernel You Can Re-check
  4. Dependent Types Where You Need Them
  5. A Language You Can Extend
  6. It Runs
  7. The Ecosystem and the Models
  8. What You Give Up
  9. The Shape of the Compromise

Bulletproof Knowledge: A Certified Agent Memory in Lean 4

  1. The Problem in One Example
  2. The Vocabulary as Closed Types
  3. Data That Carries Its Own Proof
  4. Axioms as Decidable Propositions
  5. The Only Door into Memory
  6. The Open World at the Boundary
  7. Statements About Statements: the Metagraph in Lean
  8. The Agent Loop
  9. What Is Trusted

lean-elpi: λProlog Inside Lean 4

  1. Installing
  2. Programs, Queries and Shared Types
  3. Rules over a Lean Memory
  4. Higher-Order Reasoning over a Typed Metagraph
  5. Tactics Written in λProlog
  6. The LF Layer: Search Finds, the Kernel Checks
  7. From Python, Node.js and Rust
  8. Honest Numbers
  9. Further Reading

LeanRDF: RDF Semantics You Can Prove

  1. The Data Model as Lean Types
  2. Entailment as a Proposition
  3. Rules as Data, Each Proven Sound
  4. Elpi Finds
  5. Lean Checks
  6. A Rule of Your Own, End to End
  7. When Certificates Are Not Enough
  8. Certifying Someone Else’s Engine
  9. Where This Leaves RDF

Find, Check, Commit: Putting the Pieces Together

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub