Text DSL parser for fabula patterns and graphs.
Inspired by Kreminski et al. (2021) "Winnow: A Domain-Specific Language for Incremental Story Sifting" (AIIDE 2021). Extends Winnow with metric temporal constraints (Dechter/Meiri/Pearl 1991), strict variable scoping validation, and composition operators (Kreminski et al. 2025 FDG).
Provides a human-readable syntax for defining temporal graph patterns and in-memory graphs, compiling them to fabula's core types.
Pattern syntax
pattern violation_of_hospitality {
stage e1 {
e1.eventType = "enterTown"
e1.actor -> ?guest
}
stage e2 {
e2.eventType = "showHospitality"
e2.actor -> ?host
e2.target -> ?guest
}
unless between e1 e2 {
eMid.eventType = "leaveTown"
eMid.actor -> ?guest
}
}
Graph syntax
graph {
@1 ev1.eventType = "enterTown"
@1 ev1.actor -> alice
@2..5 ev2.eventType = "siege"
now = 10
}