virtual resource tmp { @associated_call fn associated_call_from_tmp(domain source) { allow(source, tmp, file, [read]); } fn not_an_associated_call(domain source) { allow(source, tmp, file, [write]); } } virtual resource var { @associated_call fn associated_call_from_var(domain source) { allow(source, var, file, [read]); } } virtual resource bin { // no @associated_call fn not_an_associated_call_from_bin(domain source) { allow(source, bin, file, [read]); } } @associate([tmp var]) virtual domain foo { // Creates new resources foo-tmp and foo-var, and implicitly calls // foo-tmp.associated_call_from_tmp(foo) and foo-var.associated_call_from_var(foo) // // foo-tmp inherits tmp // foo-var inherits var tmp.associated_call_from_tmp(this); tmp.not_an_associated_call(this); } @associate([bin]) virtual domain bar inherits foo { // Creates new resources bar-tmp, bar-var and bar-bin, and implicitly calls // bar-tmp.associated_call_from_tmp(bar), bar-var.associated_call_from_var(bar) and // bar-bin.associated_call_from_var(bar) // // bar-bin inherits bin // bar-tmp inherits foo-tmp // bar-var inherits foo-var } domain baz inherits bar { // Creates new resources baz-tmp, baz-var and baz-bin, and implicitly calls // baz-tmp.associated_call_from_tmp(baz), baz-var.associated_call_from_var(baz) and // baz-bin.associated_call_from_var(baz) // // baz-bin inherits bar-bin // baz-tmp inherits bar-tmp // baz-var inherits bar-var } domain qux { // Calls synthetic functions. foo-tmp.associated_call_from_tmp(this); bar-tmp.associated_call_from_tmp(this); baz-tmp.associated_call_from_tmp(this); }