#!/usr/bin/env python
import coral

L=coral.lang.SMD01

m1 = L.Language()
m1.name = "one"


m2 = coral.ModelCopy_One(m1)
m2.__setXMIid__(m1.__XMIid__())

m2.name = "two"
e1 = L.ElementDefinition()
e2 = L.ElementDefinition()
m2.elements.append(e1)
m2.elements.append(e2)

op = L.Operation()
e2.operations.add(op)

s1 = coral.String.newAtom()
s1.__setString__("Hello")
s2 = coral.String.newAtom()
s2.__setString__("World")

op.code = [ s1, s2 ]

assert m1
assert m2
diff = coral.ModelDifference_One(m1, m2)

set = coral.Set()
set.insert(diff)
s = coral.saveDocument_str(set, "1.2")
print s

for i in range(10):
    print ""

diff = coral.ModelDifference_One(m2, m1)

set = coral.Set()
set.insert(diff)
s = coral.saveDocument_str(set, "1.2")
print s


