// Souffle - A Datalog Compiler
// Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved
// Licensed under the Universal Permissive License v 1.0 as shown at:
// - https://opensource.org/licenses/UPL
// - <souffle root>/licenses/SOUFFLE-UPL.txt

//// Test-case for string matching

.type String <: symbol

.decl stringTable (t:String)
.decl substringTable (t:String)
.decl outputData  (sub_str:String, str:String)
.output outputData  ()

outputData(x,y) :- substringTable(x), stringTable(y), contains(x,y).

stringTable("aaaa").
stringTable("abba").
stringTable("bcab").
stringTable("bdab").

substringTable("a").
substringTable("ab").
substringTable("cab").
