On this page:
4.1 Facts
4.2 Rules
4.2.1 Strict Rules
4.2.2 Defeasible Rules
4.2.3 Defeaters
4.2.4 Rule Syntax
4.3 Literals
4.3.1 Simple Literals
4.3.2 Negated Literals
4.4 Superiority Relations
4.5 Comments
4.6 Annotations
4.7 Imports
4.8 Complete Example
9.0

4 DFL Syntax Reference🔗ℹ

DFL (Defeasible Logic Format) is the primary textual syntax for Spindle theories.

4.1 Facts🔗ℹ

Facts are unconditional truths, declared with >>:

>> bird

>> penguin

Facts with labels:

f1: >> bird

f2: >> penguin

4.2 Rules🔗ℹ

4.2.1 Strict Rules🔗ℹ

Strict rules always apply and cannot be defeated. Use ->:

r1: human -> mortal

r2: a, b -> c

4.2.2 Defeasible Rules🔗ℹ

Defeasible rules typically apply but can be overridden. Use =>:

r1: bird => flies

r2: student => busy

4.2.3 Defeaters🔗ℹ

Defeaters block conclusions without asserting the opposite. Use ~>:

d1: broken_wing ~> ¬flies

4.2.4 Rule Syntax🔗ℹ

General form:

label: body -> head    (strict)

label: body => head    (defeasible)

label: body ~> head    (defeater)

Where:
  • label is a unique identifier (letters, numbers, underscores)

  • body is a comma-separated list of literals (premises)

  • head is a single literal (conclusion)

4.3 Literals🔗ℹ

4.3.1 Simple Literals🔗ℹ

Identifiers starting with a letter:

bird

is_employee

hasAccess

4.3.2 Negated Literals🔗ℹ

Use ¬ or - prefix:

¬flies

-authorized

4.4 Superiority Relations🔗ℹ

Declare which rules defeat others:

r2 > r1

specific_rule > general_rule

Multiple superiorities:

r3 > r2

r2 > r1

4.5 Comments🔗ℹ

Single-line comments start with #:

# This is a comment

>> bird    # Inline comment

4.6 Annotations🔗ℹ

Rules can have metadata annotations in a front-matter block:

---

description: "Birds typically fly"

dc:source: "ornithology-handbook.pdf"

confidence: 0.95

---

r1: bird => flies

Common annotation keys:
  • description Human-readable explanation

  • dc:source Provenance (Dublin Core)

  • confidence Numeric confidence (0.0-1.0)

  • justification Why this rule exists

  • @id Unique URI identifier

4.7 Imports🔗ℹ

Import conclusions from other files:

@import "./base-rules.dfl" .

@import "./policies.dfl" as policy .

Imports must appear at the top of the file, before any rules.

4.8 Complete Example🔗ℹ

# Penguin Exception Theory

 

@import "./animals.dfl" .

 

# Facts

f1: >> tweety_is_bird

f2: >> tweety_is_penguin

 

# Rules with annotations

---

description: "Birds typically fly"

confidence: 0.9

---

r1: tweety_is_bird => tweety_flies

 

---

description: "Penguins don't fly"

dc:source: "biology-textbook"

---

r2: tweety_is_penguin => ¬tweety_flies

 

# Superiority

r2 > r1