You should add some facts that will enforce the constraints you have in mind for your model.
For example, to enforce that every line has a corresponding function, you can write something like
fact LinesBelongToFunctions {
all ln: line |
one f: function |
ln in f.Line
}
This fact says that for each line ln
there exists exactly one function f
such that f.Lines
contains line ln
.