// CSE 414 Unit 2 -- Relational Data Model // Souffle demo // run using souffle [filename] // here we declare an EDB called edge // the type 'symbol' means 'string' or 'varchar' in souffle .decl edge (n: symbol, m: symbol) // add some facts about cities edge("Seattle", "Portland"). edge("Portland", "SF"). edge("SF", "Portland"). edge("SF", "LA"). // we declare reachable to be an IDB to be computed and // printed on the console .decl reachable (n: symbol, m: symbol) .output reachable(IO=stdout) // anything in edge is reachable reachable(x, y):- edge(x, y). // anything that is already in reachable and can further be reached // by checking the IDB edge is also reachable reachable(x, z):- edge(x, y), reachable(y, z).