Skip to content

Instantly share code, notes, and snippets.

@rberenguel
Last active May 15, 2021 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rberenguel/22de343b7d445bdd8bfb42a37e4ea46e to your computer and use it in GitHub Desktop.
Save rberenguel/22de343b7d445bdd8bfb42a37e4ea46e to your computer and use it in GitHub Desktop.
one sig Pipeline {
process: Process,
dump: Dump,
load: Load,
}
sig Engine, FileFormat {}
sig Location {}
one sig Process {
engine: one Engine,
output: one Location,
}
sig Name, Type {}
sig Column {
name: one Name,
type: one Type,
}
sig Schema {
def: set Column,
}
one sig Dump {
input: one Location,
outputFormat: one FileFormat,
output: one Location,
outputSchema: one Schema,
}
one sig Load {
schema: one Schema,
input: one Location,
inputFormat: one FileFormat,
}
pred ConsistentProcessDump[p: Pipeline]{
p.process.output = p.dump.input
}
pred ConsistentDump[p: Pipeline]{
p.dump.input != p.dump.output
}
pred ConsistentDumpLoad[p: Pipeline]{
p.dump.output = p.load.input
p.dump.outputFormat = p.load.inputFormat
}
pred ConsistentSchemas[p: Pipeline]{
p.dump.outputSchema.def = p.load.schema.def
}
fact InterestingSchemasOnly {
all s: Schema | # s.def > 1
}
run {
all p: Pipeline {
ConsistentProcessDump[p]
ConsistentDumpLoad[p]
ConsistentDump[p]
ConsistentSchemas[p]
}
} for 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment