<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">OCL2FOL + : Coping with Undefinedness</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author>
							<persName><forename type="first">Carolina</forename><surname>Dania</surname></persName>
							<email>carolina.dania@imdea.org</email>
						</author>
						<author>
							<persName><forename type="first">Manuel</forename><surname>Clavel</surname></persName>
							<email>manuel.clavel]@imdea.org</email>
						</author>
						<author>
							<affiliation key="aff0">
								<orgName type="institution">IMDEA Software Institute</orgName>
								<address>
									<settlement>Madrid</settlement>
									<country key="ES">Spain</country>
								</address>
							</affiliation>
						</author>
						<author>
							<affiliation key="aff1">
								<orgName type="institution">Universidad Complutense de Madrid</orgName>
								<address>
									<settlement>Madrid</settlement>
									<country key="ES">Spain</country>
								</address>
							</affiliation>
						</author>
						<title level="a" type="main">OCL2FOL + : Coping with Undefinedness</title>
					</analytic>
					<monogr>
						<imprint>
							<date/>
						</imprint>
					</monogr>
					<idno type="MD5">B11BF8D38CD7DE88E3E188B99DA9BA26</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2023-03-24T19:54+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>At present, the OCL language includes two constants, null and invalid, to represent undefinedness. This effectively turns OCL into a four-valued logic. It makes also problematic its mapping to first-order logic and, as a consequence, hinders the use of first-order automated-reasoning tools for OCL reasoning. We address this problem and propose a solution, grounded on the same principles underlying OCL2FOL, in order to cope with undefinedness in OCL.</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">Introduction</head><p>In the past decade, there has been a plethora of proposals to map OCL <ref type="bibr" target="#b15">[11]</ref> into different formalisms for which reasoning tools may be readily available. By choosing a particular formalism each proposal commits to a different trade off between expressiveness and termination, automation, or completeness (see <ref type="bibr" target="#b16">[12,</ref><ref type="bibr" target="#b9">5]</ref> and references). In particular, most of these proposals have not considered the OCL language parts that deal with undefinedness or generate it: basically, the constants null and invalid,<ref type="foot" target="#foot_0">1</ref> the type-casting operator, the division operator, and the operators any, oclIsUndefined and oclIsInvalid. By doing so, these proposals try to turn OCL into a two-valued logic, so that it can be more easily mapped to different formalisms for which reasoning tools already exist. Notable exceptions to this trend are <ref type="bibr" target="#b7">[3,</ref><ref type="bibr" target="#b8">4,</ref><ref type="bibr">2,</ref><ref type="bibr" target="#b14">10]</ref> though <ref type="bibr">[2,</ref><ref type="bibr" target="#b14">10]</ref> only deals with null.</p><p>In <ref type="bibr" target="#b10">[6]</ref> we proposed a mapping from OCL to first-order logic, and we implemented it in a tool called OCL2FOL. This mapping supports the direct use of SMT solvers (e.g., Z3 <ref type="bibr">[7]</ref> or Yices <ref type="bibr">[8]</ref>) to check the satisfiability of OCL expressions, but under specific restrictions both on the expressions that were allowed and on the instances of data models that were KuhlmannG12Models checked. <ref type="foot" target="#foot_1">2</ref> Not surprisingly, some of these restrictions were imposed to avoid the problem of coping with undefinedness in OCL. In particular, i) OCL2FOL only considers instances where all attributes are defined, and ii) it does not allow expressions containing operators that can generate undefined values. However, after experimenting with OCL2FOL, we have come to realize that these restrictions impose severe limitations on the applicability of the tool (and we conjecture that similar limitations will apply as well to other methodologies that are not prepared to deal with undefinedness).</p><p>In this paper we propose OCL2FOL + which, although grounded on the same principles underlying OCL2FOL, is designed to overcome the limitations of the latter with regard to undefinedness in OCL. <ref type="foot" target="#foot_2">3</ref> Let us explain the key difference in a nutshell. Under the aforementioned restrictions i) and ii), a Boolean OCL expression can only evaluate to either true or false. Thus, to reason in this context using Boolean OCL expressions it is sufficient to define a mapping that formalizes when a Boolean OCL expressions evaluates to true. This is precisely what we did in OCL2FOL. However, in the presence of undefinedness, Boolean OCL expressions can also evaluate to null or invalid. To cope with this fact, we now define in OCL2FOL + four different mappings which formalize, respectively, when a Boolean OCL expression evaluates to true, when to false, when to null, and when to invalid.</p><p>Organization. First, in Section 2, we recall the basic principles underlying the mapping from OCL to first-order logic which is implemented in OCL2FOL. Then, in Section 3, we discuss the key ideas behind the four mappings which are implemented in OCL2FOL + for coping with undefinedness in OCL. Next, in Section 4, we report on the status of OCL2FOL + , and on some experiments that we have carried out with this tool. Finally, we draw conclusions in Section 5.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">OCL2FOL</head><p>In <ref type="bibr" target="#b10">[6]</ref> we define a mapping, called OCL2FOL, from a subset of OCL<ref type="foot" target="#foot_3">4</ref> into first-order logic. For the sake of space, we will refer here to this mapping as O2F * . The key property of O2F * is the following: Let M be a data model, let I be an instance of M (where all attributes values are defined) and let exp be a Boolean OCL expression (within the O2F * 's range), whose context is also M. Then, Eval(exp,I) = true ⇐⇒ O2F env (M, I, exp) | = O2F * (exp) <ref type="bibr">(1)</ref> where Eval(exp,I) is the value returned by the evaluation of the expression exp for the instance I, and O2F env (M, I, exp) is the union of the set of formulas resulting from calling three auxiliary mappings, namely, O2F data , O2F inst , and O2F def , on, respectively, the data model M, the instance I, and the expression exp. That is,</p><formula xml:id="formula_0">O2F env (M, I, exp) = O2F data (M) ∪ O2F inst (I) ∪ O2F def (exp)</formula><p>Next, we briefly discuss these three auxiliary mappings, and then the key mapping O2F * . But before, consider the following remark, whose correctness is based on the correctness of (1) and on the assumption that the evaluation of exp cannot possible result in null or invalid. To simplify the presentation, we do not consider here class inheritance, multi-valued attributes, or association-ends with multiplicities different from *.</p><p>Classes are represented by predicates. In particular, for every two classes C and C in M, C C , the set O2F data (M) includes the following formula:</p><formula xml:id="formula_1">• ∀(x)(¬(C(x) ∧ C (x)))</formula><p>Then, attributes are represented as functions. Finally, association-ends are represented as binary predicates. In particular, for every association between two classes C and C , with association-ends assoc and assoc , the set O2F data (M) includes the formulas:</p><formula xml:id="formula_2">• ∀(x, y)(assoc(x, y) ⇔ assoc (y, x)) • ∀(x, y)(assoc(x, y) ⇒ C (y)) ∧ ∀(x, y)(assoc(x, y) ⇒ C(x))</formula><p>O2F inst (I): Mapping instances I Objects are represented by constants. In particular, for every object o in I of a class C, the set O2F inst (I) includes the following formula:</p><formula xml:id="formula_3">• C(o)</formula><p>Then, attributes values are represented by equalities, which all-together define the corresponding functions. In particular, for every object o in I, if v is the value of its attribute attr, then the set O2F inst (I) includes the following equality:</p><p>• attr(o) = v Finally, links between objects are represented by formulas, which all-together define the corresponding predicates. In particular, for every two objects o and o in I, if o is linked to o through o's association-end assoc, then the set O2F inst (M) includes the following formula:</p><formula xml:id="formula_4">• assoc(o, o ) O2F def (</formula></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>exp): Mapping definitions in expressions exp</head><p>The OCL language includes operators (e.g., collect or select, but also union or including) that define new collections, without naming them, using a certain property. We represent these new collections by new predicates. In particular, for every sub-expression of exp which defines a new collection, the set O2F def (exp) includes the formula that formalizes that for every element for which the new predicate holds it also holds the property which defines the new collection. Example 1 below illustrates, among other things, this essential feature of our mapping from OCL to first-order logic.</p><p>There are also operators in OCL (e.g., max or any) that refer to objects, without naming it, using also a certain property. We represent these objects by new constants. In particular, for every sub-expression of exp that refers, without naming it, to an object using a property, then set O2F def (exp) includes the formula that formalizes that the aforementioned property holds for the element referred to by the new constant.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>O2F * (exp). Mapping expressions (but not aware of null or invalid)</head><p>The map O2F * is defined recursively over the structure of OCL expressions, according to the following principles: First, each expression of the form C.allInstances() is translated by a predicate formula whose predicate is the one representing the class C. Second, each expression of type Boolean whose root symbol (the one at the root of the tree representing the expression) is not, and, or, implies, xor, =, &gt;, &lt;, ≤, ≥, forAll, exists, one, isUnique, isEmpty, notEmpty, includes, excludes, includesAll, excludesAll is translated into a formula which mirror its logical structure. Third, each expression of type Integer whose root symbol is +, −, * is translated by the corresponding functional expression. Fourth, each expression of type Set whose root symbol is select, reject, including, excluding, union, intersection, collect (followed by asSet) is translated by a predicate formula, whose predicate's definition is generated using O2F def . Finally, each expression of type Integer whose root symbol is max or min (over collections) is translated by a constant, whose definition is generated using O2F def .</p><p>The recursive definition of O2F * is rather technical, and we shall refer to <ref type="bibr" target="#b10">[6,</ref><ref type="bibr">1]</ref> for further details. These technicalities are mainly due to the fact that, in order to capture the semantics of a number of OCL operators (including the iterator operators, but also others) we introduce fresh logical variables, which are then passed on to the subsequent recursive calls and are used when translating the arguments of these operators. This and other features of the mapping from OCL to first-order logic which is implemented in OCL2FOL are illustrated by the following example.</p><p>Example 1. Consider a simple data model Persons containing just one class Person, with one attribute age of type Integer and a self-association whose association-ends are friendsOf (x is a friend of y) and friendTo (y is considered a friend by x).</p><p>Let exp be Person.allInstances()→notEmpty(). Then, O2F * (exp) is the formula: ∃(x)(Person(x)) where Person is the predicate that represents the class Person and x is a logical variable introduced as part of the mapping of the operator notEmpty. Now, let exp be Person.allInstances()→exists(p|p.age ≤ 18). Then, O2F * (exp) is the following formula: ∃(x)(Person(x) ∧ age(x) ≤ 18) where age is the function that represents the attribute age and x is a logical variable introduced as part of the mapping of the operator exists.</p><p>Also, let exp be Person.allInstances()→select(p|p.age &gt; 18) →isEmpty(). Then, O2F * (exp) is the following formula: ∀(x)(¬Select#1(x)) where x is a logical variable introduced as part of the mapping of the operator isEmpty and Select#1 is the predicate that represents the collection defined by the expression Person.allInstances()→select(p|p.age &gt; 18). The predicate Select#1 is, in turn, defined, using the mapping O2F def , by the following formula: ∀(x)(Select#1(x) ⇔ (Person(x) ∧ age(x) &gt; 18)) Finally, let exp be Person.allInstances()→collect(p|p.friendsOf)→asSet()→not-Empty(). Then, O2F * (exp) is the following formula:</p><formula xml:id="formula_5">∃(x)(Collect#1(x))</formula><p>where x is a logical variable introduced as part of the mapping of the operator notEmpty and Collect#1 is the predicate that represents the collection defined by the expression Person.allInstances()→collect(p|p.friendsOf)→asSet(). The predicate Collect#1 is, in turn, defined, using the mapping O2F def , by the following formula: ∀(x)(Collect#1(x) ⇔ ∃(y)(Person(y) ∧ friendsOf(y, x)) where friendsOf is the predicate that represents the association-end friendsOf.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">OCL2FOL + : Coping with undefinedness</head><p>In a nutshell, the problem of undefinedness in OCL when trying to use existing firstorder logic reasoning tools for OCL reasoning is the problem of mapping a four-valued logic (true, false, null, and invalid) a two-valued logic (true and false). In general, when evaluating a Boolean OCL expression for an instance of a data model, the result can be either true, false, null or invalid. However, when interpreting a formula in a first-order model, the result can only be true or false. In other words, in the presence of undefinedness, Remark 1 does not hold.</p><p>To cope with undefinedness while at the same time being able to use SMT solvers, as we did in OCL2FOL, to automatically carry out OCL reasoning, our solution consists on defining four mappings, namely, O2F true , O2F false , O2F null , and O2F inval , such that the following holds: Let M be a data model, let I be an instance of M (where now not all attributes values need to be defined), and let exp be a Boolean OCL expression whose context is M (within the O2F * 's range, extended now to include expressions built with the type-casting operators, the division operator, and the operators any, oclIsUndefined, and oclIsInvalid). where Eval(exp,I) is the value returned by the evaluation of the expression exp for the instance I, and O2F env+ (M, I, exp) is the union of the set of formulas resulting from calling three auxiliary mappings, namely, O2F data+ , O2F inst+ , and O2F def+ , on, respectively, the data model M, the instance I, and the expression exp. As their names suggest, these three mappings are extensions of the mappings O2F data , O2F inst , and O2F def . That is, O2F env+ (M, I, exp) = O2F data+ (M) ∪ O2F inst+ (I) ∪ O2F def+ (exp) Next, we briefly discuss the content of these extensions, and afterwards the four key mappings O2F true , O2F false , O2F null , and O2F inval .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>O2F data+ (M): Mapping data models M</head><p>The values null or invalid are represented, respectively, by the constants null and invalid. Moreover, we introduce two unary predicates IsNull and IsInvalid, to represent when an element is null or invalid, and we add to the set O2F data+ (M) the following formula:</p><p>• IsNull(null) ∧ ¬IsInvalid(null) ∧ ¬IsNull(invalid) ∧ IsInvalid(invalid) Objects are neither null nor invalid. <ref type="foot" target="#foot_4">5</ref> Therefore, for every class C in M, the set O2F data+ (M) contains the following additional formula:</p><formula xml:id="formula_6">• ∀(x)(C(x) ⇒ ¬(IsNull(x) ∨ IsInvalid(x)))</formula><p>O2F inst+ (I): Mapping instances I Attributes values may be undefined. Thus, for every object o in I, the value of its attribute attr is undefined, then the set O2F inst+ (I) includes the following equality:</p><p>• attr(o) = null On the other hand, attributes values may be defined. Thus, for every object o in I, if v is the (defined) value of its attribute attr, then the set O2F inst+ (I) includes the formula:</p><formula xml:id="formula_7">• ¬(IsNull(v) ∨ IsInvalid(v))</formula><p>O2F def+ (exp): Mapping definitions in expressions exp Literals of primitive types are also neither null nor invalid. Thus, for every literal l in the given expression exp, the set O2F def+ (exp) contains the following additional formula:</p><formula xml:id="formula_8">• ¬(IsNull(l) ∨ IsInvalid(l))</formula><p>Mapping expressions (aware of null and invalid)</p><p>For the sake of space limitation, we shall not provide here the full recursive definitions of our four mappings O2F true , O2F false , O2F null , O2F inval . Instead, we illustrate the main ideas using examples. In particular, since the new mappings follow the same principles than our original mapping O2F * , we use as examples the same expressions that we used in Example 1.</p><p>According to the OCL's semantics, if a collection contains invalid, the collection itself evaluates to invalid. Furthermore, for every operator, except of course oclIsInvalid and oclIsUndefined, if invalid happens to be passed as one of its arguments, the result is invalid. We now take these facts into account when mapping operators on collection, as shown in the following example. Notice, in particular, that we do not "reduce" a collection containing invalid to invalid, but instead we "keep" it in that collection. Then, when formalizing the semantics of operators on collections, we "check" if the given collections may contain invalid, and proceed accordingly.</p><p>Example 2. Let exp be Person.allInstances()→notEmpty().</p><formula xml:id="formula_9">O2F true (exp) = ∃(x)(Person(x)) ∧ ∀(x)(Person(x) ⇒ ¬IsInvalid(x)) O2F false (exp) = ∀(x)(¬Person(x)) ∧ ∀(x)(Person(x) ⇒ ¬IsInvalid(x)) O2F null (exp) = ⊥ O2F inval (exp) = ∃(x)(Person(x) ∧ IsInvalid(x))</formula><p>Notice that, in the logical context provided by O2F env+ , some of the above expressions can be simplified. For example, ∀(x)(Person(x) ⇒ ¬IsInvalid(x)) can be reduced to , since objects are neither null nor invalid; for the same reason, ∃(x)(Person(x) ∧ IsInvalid(x)) can be reduced to ⊥. However, for the of clarity, we will not perform such optimizations in our examples. Now, if one of the elements in a disjunction is null, and the other element is neither true nor invalid, then the disjunction itself evaluates to null. Similarly, if one the elements in a disjunction is invalid, and the other element is not true, then the disjunction itself evaluates to invalid. Now, in the case of the operator ≤, if both arguments are null, then ≤ evaluates to true. But if only one of the arguments, but not the other, is null, then ≤ evaluates to invalid. And, if at least one element is invalid, or one argument is null, but not the other, then ≤ evaluates to invalid. We take these facts into account when mapping the iterator exists over collections and the operator ≤ between integers, as shown in the following examples.</p><p>Example 3. Let exp be Person.allInstances()→ exists(p|p.age ≤ 18). Next, recall that a collection resulting from the select-iterator contains every element of the source-collection for which the body evaluates to true. However, we now take into account that, if the source-collection contains invalid (and the same applies to the other iterator operators), then the resulting collection will also contain invalid, as shown in the following example.</p><formula xml:id="formula_10">O2F true (exp) = ∃(x)(Person(x) ∧ O2F true (x.age ≤ 18)) ∧ ∀(x)(Person(x) ⇒ ¬IsInvalid(x)) O2F false (exp) = ∀(x)(Person(x) ⇒ O2F false (x.age ≤ 18)) ∧ ∀(x)(Person(x) ⇒ ¬IsInvalid(x)) O2F null (exp) = ∃(x)(Person(x) ∧ O2F null (x.age ≤ 18)) ∧ ∀(x)(Person(x) ⇒ (O2F false (x.age ≤ 18) ∨ O2F null (x.age ≤ 18))) ∧ ∀(x)(Person(x) ⇒ ¬IsInvalid(x)) O2F inval (exp) = (∃(x)(Person(x) ∧ O2F inval (x.age ≤ 18)) ∧ ∀(x)(Person(x) ⇒ (O2F</formula><p>Example 4. Let exp be Person.allInstances()→select(p|p.age &gt; 18)→isEmpty().</p><p>O2F true (exp) = ∀(x)(¬Select#1(x)) ∧ ∀(x)(Select#1(x) ⇒ ¬IsInvalid(x))</p><formula xml:id="formula_11">O2F false (exp) = ∃(x)(Select#1(x)) ∧ ∀(x)(Select#1(x) ⇒ ¬IsInvalid(x)) O2F null (exp) = ⊥ O2F inval (exp) = ∃(x)(Select#1(x) ∧ IsInvalid(x))</formula><p>where Select#1 is the predicate that represents the collection defined by the expression Person.allInstances()→select(p|p.age &gt; 18). The predicate Select#1 is, in turn, defined by the following formula:</p><formula xml:id="formula_12">∀(x)(Select#1(x) ⇔ (Person(x) ∧ (O2F true (x.age &gt; 18) ∨ IsInvalid(x))))</formula><p>Finally, recall that oclIsUndefined returns true when its argument is either null or invalid, and false otherwise. Also, recall that the any-iterator returns null if no element in the source-collection satisfies the given property. As expected, if the source-collection contains invalid, the any-iterator also returns invalid. We now take into account all these three facts, as shown in the following example: </p><formula xml:id="formula_13">)) ∧ ∀(x)(Person(x) ⇒ ¬IsInvalid(x))) IsInvalid(Any#1) ⇔ ∃(x)(Person(x) ∧ IsInvalid(x))</formula><p>4 Tool support and case study</p><p>We have implemented our mappings in a tool, called OCL2FOL + <ref type="bibr">[1]</ref>. OCL2FOL + takes as input a data model M (the context), a set of Boolean OCL expressions exp 1 , . . . , exp n (the hypothesis), a Boolean OCL expression exp n+1 (the assertion), and one of the following keywords (the type): true, false, null, inval. From the given input, the  </p><formula xml:id="formula_14">O2F data+ (M) ∪ ( n i=1 O2F true (exp i )) ∪ ( n+1 i=1 O2F def+ (exp i )) ∪ O2F type (exp n+1 )</formula><p>To validate OCL2FOL + we have carried out a number of experiments. In particular, each column in Table <ref type="table" target="#tab_2">1</ref> shows the result of checking, using Z3, the satisfiability of the set of formulas that results from calling OCL2FOL + with Persons (context), the empty set (hypothesis) and the conjunction of some formulas taken from Figure <ref type="figure" target="#fig_0">1</ref> plus the type true (assertion).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">Conclusions and future work</head><p>We have addressed the problem of coping with undefinedness in OCL while at the same time being able to use SMT solvers (e.g., Z3 and Yices) to automatically carry out OCL reasoning. Our solution follows the same principles underlying OCL2FOL, but consists now of four mappings which formalize, respectively, when an expression evaluates to true, when to false, when to null, and when to invalid. Our solution also differs from <ref type="bibr" target="#b7">[3,</ref><ref type="bibr" target="#b8">4]</ref>, since we pursue different goals. In particular, while we are able to support automated OCL reasoning, we can only cover a subset of OCL. On the other hand, the solution presented in <ref type="bibr" target="#b7">[3,</ref><ref type="bibr" target="#b8">4]</ref>, although it scovers the full OCL language, it can only provide interactive theorem-proving capabilities. As part of this work, we have also implemented our four mappings in a tool called OCL2FOL + [1] , and we have applied this tool for reasoning about OCL expressions in the presence of undefinedness. For this case study we have used a non-trivial benchmark that we would like to propose as an extension of <ref type="bibr">[9]</ref>, following their invitation to provide scenarios which are not currently covered: in particular, in their own words, "intensive use of the full semantics of OCL (like the undefined value or collection semantics); this poses a challenge for the lifting to two-valued logics."</p><p>Our future work will follow two main directions. On the one hand, we want to formally prove that our four mappings are correct with respect to the OCL semantics; unfortunately, the OCL semantics for undefinedness has been, in the past, in a constant state of flux. On the other hand, we want to apply OCL2FOL + for analyzing ActionGUI models <ref type="bibr">[1]</ref>, since they contain non-trivial Boolean OCL expressions which should never evaluate to null or invalid: e.g., authorization constraints in permissions or conditions in if-then-else statements (which are both expected to always evaluate to either true or false), and arguments in actions (which, when referring to the object upon which an action is to be executed, are expected to never evaluate to null or invalid).</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head>Remark 1 .</head><label>1</label><figDesc>Let M be a data model, let I be an instance of M (where all attributes values are defined), and let exp be a Boolean OCL expression (within the O2F * 's range), whose context is also M. Then, Eval(exp,I) = false ⇐= O2F env (M, I, exp) | = O2F * (exp)O2F data (M): Mapping data models M</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head></head><label></label><figDesc>Then, Eval(exp,I) = true ⇐⇒ O2F env+ (M, I, exp) | = O2F true (exp) Eval(exp,I) = false ⇐⇒ O2F env+ (M, I, exp) | = O2F false (exp) Eval(exp,I) = null ⇐⇒ O2F env+ (M, I, exp) | = O2F null (exp) Eval(exp,I) = invalid ⇐⇒ O2F env+ (M, I, exp) | = O2F inval (exp)</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_2"><head>Fig. 1 .</head><label>1</label><figDesc>Fig. 1. OCL2FOL + case study: sample formulas {1,2} {1,3} {2,3} {4} {5} {5,6} {1,7} {1,8} {1,6,8} {1,9} {1,6,9} {1,10} O2F true unsat unsat sat unsat sat unsat unsat sat unsat sat unsat unsat</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_1"><head></head><label></label><figDesc>Example 5. Let exp be Person.allInstances()→any(p|p.age &gt; 16).oclIsUndefined(). O2F</figDesc><table /><note>true (exp) = IsNull(Any#1) ∨ IsInvalid(Any#1) O2F false (exp) = ¬(IsNull(Any#1) ∨ IsInvalid(Any#1))O2F null (exp) = ⊥ O2F inval (exp) = ⊥where Any#1 is the constant that represents the element defined by the expression Person.allInstances()→any(p|p.age &gt; 16). The constant Any#1 is, in turn, defined by the following formulas:¬(IsNull(Any#1) ∨ IsInvalid(Any#1)) ⇒ ∃(x)(Person(x) ∧ O2F true (x.age &gt; 16) ∧ Any#1 = x) IsNull(Any#1) ⇔ (∀(x)(Person(x) ⇒ (O2F false (x.age &gt; 16) ∨ O2F null (x.age &gt; 16) ∨ O2F inval (x.age &gt; 16)</note></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_2"><head>Table 1 .</head><label>1</label><figDesc>OCL2FOL + case study: checking satisfiability tool OCL2FOL + automatically generates the following set of formulas (in SMT-Lib 2.0 syntax):</figDesc><table /></figure>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0">Intuitively, null represents unknown/undefined values and invalid represents error/exceptions.</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="2" xml:id="foot_1">Class diagrams and object diagrams are prototypical examples, respectively, of data models and of instances of data models.</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="3" xml:id="foot_2">However, other limitations, like the inability to deal with the operator size and count, or with collection-types different from Set do still apply to OCL2FOL + .</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="4" xml:id="foot_3">This subset includes arbitrary, possibly nested forAll, exists, select, reject, and collect iterator expressions. However, collect-expressions must be followed by asSet. See<ref type="bibr" target="#b10">[6,</ref> 1]  for further details.</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="5" xml:id="foot_4">At the model level, objects are instances of (UML) classes. Thus, they cannot be null nor invalid. At the linguistic level, however, the constants null and invalid are instances of every (OCL) class type.</note>
		</body>
		<back>

			<div type="acknowledgement">
<div xmlns="http://www.tei-c.org/ns/1.0"><p>Acknowledgements. We kindly thank Achim Brucker and Marco Guarnieri for our very helpful discussions on the semantics of OCL undefinedness, and we also thank our anonymous reviewers for their insightful comments and suggestions. This work is partially supported by the EU FP7-ICT Project "NESSoS: Network of Excellence on Engineering Secure Future Internet Software Services and Systems" (256980) by the Spanish Ministry of Science and Innovation Project "DESAFIOS-10" (TIN2009-14599-C03-01), and by Comunidad de Madrid Program "PROMETIDOS-CM" (S2009TIC-1465).</p></div>
			</div>

			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<analytic>
		<title/>
	</analytic>
	<monogr>
		<title level="j">Person.allInstances</title>
		<imprint>
			<biblScope unit="page">18</biblScope>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<analytic>
		<title/>
	</analytic>
	<monogr>
		<title level="j">Person.allInstances</title>
		<imprint>
			<biblScope unit="page">18</biblScope>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<monogr>
		<title level="m">age)−&gt;asSet()−&gt;exists</title>
				<editor>
			<persName><surname>Person</surname></persName>
		</editor>
		<imprint/>
	</monogr>
	<note>−&gt;collect. a|a.oclIsUndefined</note>
</biblStruct>

<biblStruct xml:id="b3">
	<analytic>
		<title/>
	</analytic>
	<monogr>
		<title level="j">Person.allInstances</title>
		<imprint>
			<biblScope unit="page">16</biblScope>
			<publisher>oclIsUndefined</publisher>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b4">
	<analytic>
		<title/>
	</analytic>
	<monogr>
		<title level="j">Person.allInstances</title>
		<imprint/>
	</monogr>
	<note>age.oclIsInvalid</note>
</biblStruct>

<biblStruct xml:id="b5">
	<monogr>
		<author>
			<persName><surname>Actiongui</surname></persName>
		</author>
		<ptr target="http://www.actiongui.org" />
		<title level="m">ActionGUI and OCL2FOL projects</title>
				<imprint>
			<date type="published" when="2012">2012</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b6">
	<analytic>
		<title level="a" type="main">On challenges of model transformation from UML to alloy</title>
		<author>
			<persName><forename type="first">K</forename><surname>Anastasakis</surname></persName>
		</author>
		<author>
			<persName><forename type="first">B</forename><surname>Bordbar</surname></persName>
		</author>
		<author>
			<persName><forename type="first">G</forename><surname>Georg</surname></persName>
		</author>
		<author>
			<persName><forename type="first">I</forename><surname>Ray</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Software and System Modeling</title>
		<imprint>
			<biblScope unit="volume">9</biblScope>
			<biblScope unit="issue">1</biblScope>
			<biblScope unit="page" from="69" to="86" />
			<date type="published" when="2010">2010</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b7">
	<analytic>
		<title level="a" type="main">A specification-based test case generation method for UML/OCL</title>
		<author>
			<persName><forename type="first">A</forename><forename type="middle">D</forename><surname>Brucker</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><forename type="middle">P</forename><surname>Krieger</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Longuet</surname></persName>
		</author>
		<author>
			<persName><forename type="first">B</forename><surname>Wolff</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">MoDELS Workshops</title>
				<editor>
			<persName><forename type="first">J</forename><surname>Dingel</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">A</forename><surname>Solberg</surname></persName>
		</editor>
		<imprint>
			<date type="published" when="2010">2010</date>
			<biblScope unit="volume">6627</biblScope>
			<biblScope unit="page" from="334" to="348" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b8">
	<analytic>
		<title level="a" type="main">Featherweight OCL: a study for the consistent semantics of OCL 2.3 in HOL</title>
		<author>
			<persName><forename type="first">A</forename><forename type="middle">D</forename><surname>Brucker</surname></persName>
		</author>
		<author>
			<persName><forename type="first">B</forename><surname>Wolff</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">OCL and Textual Modelling</title>
				<editor>
			<persName><forename type="first">M</forename><surname>Balaban</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">J</forename><surname>Cabot</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">M</forename><surname>Gogolla</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">C</forename><surname>Wilke</surname></persName>
		</editor>
		<imprint>
			<publisher>ACM</publisher>
			<date type="published" when="2012">2012</date>
			<biblScope unit="page" from="19" to="24" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b9">
	<analytic>
		<title level="a" type="main">Verification and validation of declarative model-to-model transformations through invariants</title>
		<author>
			<persName><forename type="first">J</forename><surname>Cabot</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Clarisó</surname></persName>
		</author>
		<author>
			<persName><forename type="first">E</forename><surname>Guerra</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>De Lara</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Journal of Systems and Software</title>
		<imprint>
			<biblScope unit="volume">83</biblScope>
			<biblScope unit="issue">2</biblScope>
			<biblScope unit="page" from="283" to="302" />
			<date type="published" when="2010">2010</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b10">
	<analytic>
		<title level="a" type="main">Checking unsatisfiability for OCL constraints</title>
		<author>
			<persName><forename type="first">M</forename><surname>Clavel</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Egea</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><forename type="middle">A</forename><surname>García De Dios</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">ECEASST</title>
		<imprint>
			<biblScope unit="volume">24</biblScope>
			<date type="published" when="2009">2009</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b11">
	<analytic>
		<title level="a" type="main">Z3: An efficient SMT solver</title>
		<author>
			<persName><forename type="first">L</forename><surname>Mendonc</surname></persName>
		</author>
		<author>
			<persName><forename type="first">N</forename><surname>De Moura</surname></persName>
		</author>
		<author>
			<persName><surname>Bjørner</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">TACAS</title>
				<editor>
			<persName><forename type="first">C</forename><forename type="middle">R</forename><surname>Ramakrishnan</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">J</forename><surname>Rehof</surname></persName>
		</editor>
		<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2008">2008</date>
			<biblScope unit="volume">4963</biblScope>
			<biblScope unit="page" from="337" to="340" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b12">
	<monogr>
		<author>
			<persName><forename type="first">B</forename><surname>Dutertre</surname></persName>
		</author>
		<author>
			<persName><forename type="first">L</forename><surname>Moura</surname></persName>
		</author>
		<ptr target="http://yices.csl.sri.com" />
		<title level="m">Yices: An SMT solver</title>
				<imprint>
			<date type="published" when="2008">2008</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b13">
	<analytic>
		<title level="a" type="main">Initiating a Benchmark for UML and OCL Analysis Tools</title>
		<author>
			<persName><forename type="first">M</forename><surname>Gogolla</surname></persName>
		</author>
		<author>
			<persName><forename type="first">F</forename><surname>Büttner</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Cabot</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">TAP</title>
				<editor>
			<persName><forename type="first">M</forename><surname>Veanes</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">L</forename><surname>Viganò</surname></persName>
		</editor>
		<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2013">2013</date>
			<biblScope unit="volume">7942</biblScope>
			<biblScope unit="page" from="115" to="132" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b14">
	<analytic>
		<title level="a" type="main">From UML and OCL to relational logic and back</title>
		<author>
			<persName><forename type="first">M</forename><surname>Kuhlmann</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Gogolla</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">MoDELS</title>
				<editor>
			<persName><forename type="first">R</forename><forename type="middle">B</forename><surname>France</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">J</forename><surname>Kazmeier</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">R</forename><surname>Breu</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">C</forename><surname>Atkinson</surname></persName>
		</editor>
		<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2012">2012</date>
			<biblScope unit="volume">7590</biblScope>
			<biblScope unit="page" from="415" to="431" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b15">
	<monogr>
		<title level="m" type="main">Object Constraint Language specification Version 2</title>
		<ptr target="http://www.omg.org/spec/OCL/2.3.1" />
		<imprint>
			<date type="published" when="2012-01">January 2012</date>
		</imprint>
	</monogr>
	<note>Object Management Group</note>
</biblStruct>

<biblStruct xml:id="b16">
	<analytic>
		<title level="a" type="main">OCL-Lite: Finite reasoning on UM-L/OCL conceptual schemas</title>
		<author>
			<persName><forename type="first">A</forename><surname>Queralt</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Artale</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Calvanese</surname></persName>
		</author>
		<author>
			<persName><forename type="first">E</forename><surname>Teniente</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Data &amp; Knowledge Engineering</title>
		<imprint>
			<biblScope unit="volume">73</biblScope>
			<biblScope unit="page" from="1" to="22" />
			<date type="published" when="2012">2012</date>
		</imprint>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
