Vadalog Cheat Sheet

A list of the most popular rules, annotations and programs used by Vadalog programmer, for quick and easy reference.

Rules

Basic program

a(0,1).
b(X,Y):- a(X,Y).
@output("b").

Comparison, not equal

equipment("Backpack").
equipment("Potion").
equipment("Blade").
equipment("Star brooch").

inBackpack(X):- equipment(X), X<>"Backpack".
@output("inBackpack").

msum Aggregation Operator

s(0.1, 2, "a").
s(0.2, 2, "a").
s(0.5, 3, "a").
s(0.6, 4, "b").
s(0.5, 5, "b").

f(J, Z) :- s(X, Y, Z), J = msum(X, <Y>).
@output("f").

Annotations

Library import

@library("abbreviation:","libraryName").

Temporal

Temporal Mappings

@temporalMappings(predicateName, posStart, posEnd, posStartClosed, posEndClosed, defaultTemplate).
@temporalMappings("a",3,5,-1,-1,"[_,_]").

Time Granularity with Integers and Doubles

@timeGranularity("no_date").

Temporal Type Integer

@temporalType("int").