Safety Checking for Domain Relational Calculus Queries Using Alloy - - PowerPoint PPT Presentation

safety checking for domain relational calculus queries
SMART_READER_LITE
LIVE PREVIEW

Safety Checking for Domain Relational Calculus Queries Using Alloy - - PowerPoint PPT Presentation

M asters Project Safety Checking for Domain Relational Calculus Queries Using Alloy Analyzer Abhabongse Plane Janthong Department of Computer Science, University of California, Santa Barbara CREATED AND EDITABLE USING IPE (


slide-1
SLIDE 1

Safety Checking for Domain Relational Calculus Queries Using Alloy Analyzer

Abhabongse “Plane” Janthong

Master’s Project Department of Computer Science, University of California, Santa Barbara

CREATED AND EDITABLE USING IPE ( http://ipe.otfried.org/ )

slide-2
SLIDE 2

Safety Checking for Domain Relational Calculus Queries Using Alloy Analyzer

Abhabongse “Plane” Janthong

Master’s Project Department of Computer Science, University of California, Santa Barbara

slide-3
SLIDE 3

2

introduction

1

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Defintion of database systems, domain relational caluculus queries, and query safety.

slide-4
SLIDE 4

3 A

What is relational database?

PersonalData Name BirthYear ‘Alice’

1994

‘Bob’

1995

‘Carol’

1994

‘David’

1993

Friendship NameA NameB ‘Alice’ ‘Bob’ ‘Bob’ ‘Carol’ ‘Alice’ ‘Carol’ ‘Carol’ ‘David’

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-5
SLIDE 5

3 B

What is relational database?

PersonalData Name BirthYear ‘Alice’

1994

‘Bob’

1995

‘Carol’

1994

‘David’

1993

Friendship NameA NameB ‘Alice’ ‘Bob’ ‘Bob’ ‘Carol’ ‘Alice’ ‘Carol’ ‘Carol’ ‘David’

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Alice (b.1994) Bob (b.1995) Carol (b.1994) David (b.1993)

friendship friendship friendship friendship

slide-6
SLIDE 6

3 C

What is relational database?

Database: a collection of tables.

PersonalData Name BirthYear ‘Alice’

1994

‘Bob’

1995

‘Carol’

1994

‘David’

1993

Friendship NameA NameB ‘Alice’ ‘Bob’ ‘Bob’ ‘Carol’ ‘Alice’ ‘Carol’ ‘Carol’ ‘David’

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Alice (b.1994) Bob (b.1995) Carol (b.1994) David (b.1993)

friendship friendship friendship friendship

slide-7
SLIDE 7

3 D

What is relational database?

Database: a collection of tables.

PersonalData Name BirthYear ‘Alice’

1994

‘Bob’

1995

‘Carol’

1994

‘David’

1993

Friendship NameA NameB ‘Alice’ ‘Bob’ ‘Bob’ ‘Carol’ ‘Alice’ ‘Carol’ ‘Carol’ ‘David’

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Alice (b.1994) Bob (b.1995) Carol (b.1994) David (b.1993)

friendship friendship friendship friendship

In this particular example, each table is a binary relation over sets of scalar values.

Table: a mathematical relation over one or more sets of scalar values (numbers, strings, etc.).

*

slide-8
SLIDE 8

3 E

What is relational database?

Database: a collection of tables.

PersonalData Name BirthYear ‘Alice’

1994

‘Bob’

1995

‘Carol’

1994

‘David’

1993

Friendship NameA NameB ‘Alice’ ‘Bob’ ‘Bob’ ‘Carol’ ‘Alice’ ‘Carol’ ‘Carol’ ‘David’

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Alice (b.1994) Bob (b.1995) Carol (b.1994) David (b.1993)

friendship friendship friendship friendship

Table: a mathematical relation over one or more sets of scalar values (numbers, strings, etc.).

slide-9
SLIDE 9

3 F

What is relational database?

Database: a collection of tables.

PersonalData Name BirthYear ‘Alice’

1994

‘Bob’

1995

‘Carol’

1994

‘David’

1993

Friendship NameA NameB ‘Alice’ ‘Bob’ ‘Bob’ ‘Carol’ ‘Alice’ ‘Carol’ ‘Carol’ ‘David’

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Alice (b.1994) Bob (b.1995) Carol (b.1994) David (b.1993)

friendship friendship friendship friendship

Table: a mathematical relation over one or more sets of scalar values (numbers, strings, etc.). Tuple: a row of the table.

slide-10
SLIDE 10

3 G

What is relational database?

Database: a collection of tables.

PersonalData Name BirthYear ‘Alice’

1994

‘Bob’

1995

‘Carol’

1994

‘David’

1993

Friendship NameA NameB ‘Alice’ ‘Bob’ ‘Bob’ ‘Carol’ ‘Alice’ ‘Carol’ ‘Carol’ ‘David’

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Alice (b.1994) Bob (b.1995) Carol (b.1994) David (b.1993)

friendship friendship friendship friendship

For this project, we ignore the concept of keys (primary keys, foreign keys, etc.)

*

Table: a mathematical relation over one or more sets of scalar values (numbers, strings, etc.). Tuple: a row of the table.

slide-11
SLIDE 11

4 A

Database queries

Query: the process of fetching the stored data from the database.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-12
SLIDE 12

4 B

Database queries

SELECT Name, BirthYear FROM PersonalData WHERE BirthYear < 1995

Query: the process of fetching the stored data from the database.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Example of SQL query:

slide-13
SLIDE 13

4 C

Database queries

SELECT Name, BirthYear FROM PersonalData WHERE BirthYear < 1995

Query: the process of fetching the stored data from the database.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Example 1. All students and their year of birth who were born strictly before 1995. Example of SQL query:

slide-14
SLIDE 14

4 D

Database queries

Qery Result Name BirthYear ‘Alice’

1994

‘Carol’

1994

‘David’

1993

PersonalData Name BirthYear ‘Alice’

1994

‘Bob’

1995

‘Carol’

1994

‘David’

1993 SELECT Name, BirthYear FROM PersonalData WHERE BirthYear < 1995

Query: the process of fetching the stored data from the database.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Example 1. All students and their year of birth who were born strictly before 1995. Example of SQL query:

slide-15
SLIDE 15

4 E

Database queries

Qery Result Name BirthYear ‘Alice’

1994

‘Carol’

1994

‘David’

1993

PersonalData Name BirthYear ‘Alice’

1994

‘Bob’

1995

‘Carol’

1994

‘David’

1993 SELECT Name, BirthYear FROM PersonalData WHERE BirthYear < 1995

Query: the process of fetching the stored data from the database.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Example 1. All students and their year of birth who were born strictly before 1995.

Q before 1995 = {name, year ∣ PersonalData(name, year) ∧ (year < 1995)}

Example of SQL query: Example of Domain Relational Calculus (drc) query:

slide-16
SLIDE 16

4 F

Database queries

Qery Result Name BirthYear ‘Alice’

1994

‘Carol’

1994

‘David’

1993

PersonalData Name BirthYear ‘Alice’

1994

‘Bob’

1995

‘Carol’

1994

‘David’

1993 SELECT Name, BirthYear FROM PersonalData WHERE BirthYear < 1995

Use set comprehension notation, in first-order logic.

Query: the process of fetching the stored data from the database.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Example 1. All students and their year of birth who were born strictly before 1995.

Q before 1995 = {name, year ∣ PersonalData(name, year) ∧ (year < 1995)}

Example of SQL query: Example of Domain Relational Calculus (drc) query:

slide-17
SLIDE 17

4 G

Database queries

Qery Result Name BirthYear ‘Alice’

1994

‘Carol’

1994

‘David’

1993

PersonalData Name BirthYear ‘Alice’

1994

‘Bob’

1995

‘Carol’

1994

‘David’

1993 SELECT Name, BirthYear FROM PersonalData WHERE BirthYear < 1995

Use set comprehension notation, in first-order logic. Identifiers always represent scalar values.

Query: the process of fetching the stored data from the database.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Example 1. All students and their year of birth who were born strictly before 1995.

Q before 1995 = {name, year ∣ PersonalData(name, year) ∧ (year < 1995)}

Example of SQL query: Example of Domain Relational Calculus (drc) query:

slide-18
SLIDE 18

4 H

Database queries

Qery Result Name BirthYear ‘Alice’

1994

‘Carol’

1994

‘David’

1993

PersonalData Name BirthYear ‘Alice’

1994

‘Bob’

1995

‘Carol’

1994

‘David’

1993 SELECT Name, BirthYear FROM PersonalData WHERE BirthYear < 1995

Use set comprehension notation, in first-order logic. Identifiers always represent scalar values.

Query: the process of fetching the stored data from the database.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Example 1. All students and their year of birth who were born strictly before 1995.

Q before 1995 = {name, year ∣ PersonalData(name, year) ∧ (year < 1995)}

Example of SQL query: Example of Domain Relational Calculus (drc) query:

Table names: predicate to indicate whether a specified tuple exists in such table.

slide-19
SLIDE 19

4 I

Database queries

Qery Result Name BirthYear ‘Alice’

1994

‘Carol’

1994

‘David’

1993

PersonalData Name BirthYear ‘Alice’

1994

‘Bob’

1995

‘Carol’

1994

‘David’

1993 SELECT Name, BirthYear FROM PersonalData WHERE BirthYear < 1995

Use set comprehension notation, in first-order logic. Identifiers always represent scalar values.

Query: the process of fetching the stored data from the database.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Example 1. All students and their year of birth who were born strictly before 1995.

Q before 1995 = {name, year ∣ PersonalData(name, year) ∧ (year < 1995)}

Example of SQL query: Example of Domain Relational Calculus (drc) query:

Table names: predicate to indicate whether a specified tuple exists in such table.

PersonalData Name BirthYear ‘Alice’

1994

‘Bob’

1995

‘Carol’

1994

‘David’

1993

For example, PersonalData(‘Alice’, 1994) is true, whereas PersonalData(‘Bob’, 1993) is false.

slide-20
SLIDE 20

4 J

Database queries

Qery Result Name BirthYear ‘Alice’

1994

‘Carol’

1994

‘David’

1993

PersonalData Name BirthYear ‘Alice’

1994

‘Bob’

1995

‘Carol’

1994

‘David’

1993 SELECT Name, BirthYear FROM PersonalData WHERE BirthYear < 1995

Use set comprehension notation, in first-order logic. Identifiers always represent scalar values.

Query: the process of fetching the stored data from the database.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Example 1. All students and their year of birth who were born strictly before 1995.

Q before 1995 = {name, year ∣ PersonalData(name, year) ∧ (year < 1995)}

*

Example of SQL query: Example of Domain Relational Calculus (drc) query:

Table names: predicate to indicate whether a specified tuple exists in such table.

There are other variant of Relational Calculus, namely Tuple Relational Calculus. Other types of queries include Datalog, etc.

slide-21
SLIDE 21

5 A

More examples of drc queries

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Example 2. All friends of Bob.

Q Bob’s friend = {name ∣ Friendship(name, ‘Bob’) ∨ Friendship(‘Bob’, name)}

slide-22
SLIDE 22

5 B

More examples of drc queries

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Example 2. All friends of Bob. Example 3. All pairs of students who share a common friend.

Q friend of friend = {x,y ∣ (x < y) ∧ ∃z[(Friendship(x,z) ∨ Friendship(z,x)) ∧ (Friendship(y,z) ∨ Friendship(z,y))]} Q Bob’s friend = {name ∣ Friendship(name, ‘Bob’) ∨ Friendship(‘Bob’, name)}

slide-23
SLIDE 23

5 C

More examples of drc queries

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Example 2. All friends of Bob. Example 3. All pairs of students who share a common friend.

Q friend of friend = {x,y ∣ (x < y) ∧ ∃z[(Friendship(x,z) ∨ Friendship(z,x)) ∧ (Friendship(y,z) ∨ Friendship(z,y))]}

Notice that identifiers do not have explicit domain in the query. Is this okay?

*

Q Bob’s friend = {name ∣ Friendship(name, ‘Bob’) ∨ Friendship(‘Bob’, name)}

slide-24
SLIDE 24

6 A

Domain in drc queries

Is it fine that identifiers in drc query do not have explicit domain?

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-25
SLIDE 25

6 B

Domain in drc queries

Is it fine that identifiers in drc query do not have explicit domain?

not always

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-26
SLIDE 26

6 C

Domain in drc queries

Is it fine that identifiers in drc query do not have explicit domain?

not always

Example 1. All students and their year of birth who were born strictly before 1995.

Q∗

before 1995 = {name, year ∣ year < 1995}

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-27
SLIDE 27

6 D

Domain in drc queries

Is it fine that identifiers in drc query do not have explicit domain?

not always

Example 1. All students and their year of birth who were born strictly before 1995.

Q∗

before 1995 = {name, year ∣ year < 1995}

Mathematically speaking, we cannot determine the result if the domain is not established.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-28
SLIDE 28

6 E

Domain in drc queries

Is it fine that identifiers in drc query do not have explicit domain?

not always

Example 1. All students and their year of birth who were born strictly before 1995.

If the domain of year is a set of integers, then (‘Alice’, -80) is part of the result.

Q∗

before 1995 = {name, year ∣ year < 1995}

Mathematically speaking, we cannot determine the result if the domain is not established.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-29
SLIDE 29

6 F

Domain in drc queries

counterexample

Is it fine that identifiers in drc query do not have explicit domain?

not always

Example 1. All students and their year of birth who were born strictly before 1995.

If the domain of year is a set of integers, then (‘Alice’, -80) is part of the result. If the domain of year is a set of positive integers, then (‘Alice’, -80) is not part of the result.

Q∗

before 1995 = {name, year ∣ year < 1995}

Mathematically speaking, we cannot determine the result if the domain is not established.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-30
SLIDE 30

6 G

Domain in drc queries

counterexample

Is it fine that identifiers in drc query do not have explicit domain?

not always

Example 1. All students and their year of birth who were born strictly before 1995.

If the domain of year is a set of integers, then (‘Alice’, -80) is part of the result. If the domain of year is a set of positive integers, then (‘Alice’, -80) is not part of the result.

Q∗

before 1995 = {name, year ∣ year < 1995}

Mathematically speaking, we cannot determine the result if the domain is not established.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-31
SLIDE 31

6 H

Domain in drc queries

counterexample

Is it fine that identifiers in drc query do not have explicit domain?

not always

Example 1. All students and their year of birth who were born strictly before 1995.

If the domain of year is a set of integers, then (‘Alice’, -80) is part of the result. If the domain of year is a set of positive integers, then (‘Alice’, -80) is not part of the result.

Q∗

before 1995 = {name, year ∣ year < 1995}

Mathematically speaking, we cannot determine the result if the domain is not established. Other way to look at this: it queries for data that might not be bounded by the database.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-32
SLIDE 32

6 I

Domain in drc queries

counterexample

Is it fine that identifiers in drc query do not have explicit domain?

not always

Example 1. All students and their year of birth who were born strictly before 1995.

If the domain of year is a set of integers, then (‘Alice’, -80) is part of the result. If the domain of year is a set of positive integers, then (‘Alice’, -80) is not part of the result.

Q∗

before 1995 = {name, year ∣ year < 1995}

Mathematically speaking, we cannot determine the result if the domain is not established. Other way to look at this: it queries for data that might not be bounded by the database. Or even: the result is infinite, which implies that the result depends on the domain.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-33
SLIDE 33

7 A

Domain-independency (safety)

A drc query is domain-independent if the result of the query depends on only the data in the database and not on the domain set.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-34
SLIDE 34

7 B

Domain-independency (safety)

A drc query is domain-independent if the result of the query depends on only the data in the database and not on the domain set.

Q before 1995 = {name, year ∣ PersonalData(name, year) ∧ (year < 1995)} Q friend of friend = {x, y ∣ (x < y) ∧ ∃z[(Friendship(x, z) ∨ Friendship(z, x)) ∧ (Friendship(y, z) ∨ Friendship(z, y))]} Q Bob’s friend = {name ∣ Friendship(name, ‘Bob’) ∨ Friendship(‘Bob’, name)} Q∗

before 1995 = {name, year ∣ year < 1995}

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-35
SLIDE 35

7 C

Domain-independency (safety)

A drc query is domain-independent if the result of the query depends on only the data in the database and not on the domain set.

Q before 1995 = {name, year ∣ PersonalData(name, year) ∧ (year < 1995)} Q friend of friend = {x, y ∣ (x < y) ∧ ∃z[(Friendship(x, z) ∨ Friendship(z, x)) ∧ (Friendship(y, z) ∨ Friendship(z, y))]} Q Bob’s friend = {name ∣ Friendship(name, ‘Bob’) ∨ Friendship(‘Bob’, name)} Q∗

before 1995 = {name, year ∣ year < 1995}

⎧ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩ safe

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-36
SLIDE 36

7 D

Domain-independency (safety)

A drc query is domain-independent if the result of the query depends on only the data in the database and not on the domain set.

Q before 1995 = {name, year ∣ PersonalData(name, year) ∧ (year < 1995)} Q friend of friend = {x, y ∣ (x < y) ∧ ∃z[(Friendship(x, z) ∨ Friendship(z, x)) ∧ (Friendship(y, z) ∨ Friendship(z, y))]} Q Bob’s friend = {name ∣ Friendship(name, ‘Bob’) ∨ Friendship(‘Bob’, name)} Q∗

before 1995 = {name, year ∣ year < 1995}

⎧ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩ safe unsafe

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-37
SLIDE 37

7 E

Domain-independency (safety)

A drc query is domain-independent if the result of the query depends on only the data in the database and not on the domain set.

Q before 1995 = {name, year ∣ PersonalData(name, year) ∧ (year < 1995)} Q friend of friend = {x, y ∣ (x < y) ∧ ∃z[(Friendship(x, z) ∨ Friendship(z, x)) ∧ (Friendship(y, z) ∨ Friendship(z, y))]} Q Bob’s friend = {name ∣ Friendship(name, ‘Bob’) ∨ Friendship(‘Bob’, name)} Q∗

before 1995 = {name, year ∣ year < 1995}

⎧ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩ safe unsafe

...and more ...

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-38
SLIDE 38

8 A

More example of drc unsafe query

Example 4. People who do not follow Alice.

We have the database table Follows(fan, idol) representing the fact that fan is following idol

  • n a social network.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-39
SLIDE 39

8 B

More example of drc unsafe query

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

We have the database table Follows(fan, idol) representing the fact that fan is following idol

  • n a social network.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-40
SLIDE 40

8 C

More example of drc unsafe query

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

We have the database table Follows(fan, idol) representing the fact that fan is following idol

  • n a social network.

Suppose that D1, D2 are distinct domain sets such that D2 = D1 ∪ {c} where Follows(c, ‘Alice’) is

  • false. Then,

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-41
SLIDE 41

8 D

More example of drc unsafe query

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

We have the database table Follows(fan, idol) representing the fact that fan is following idol

  • n a social network.

Suppose that D1, D2 are distinct domain sets such that D2 = D1 ∪ {c} where Follows(c, ‘Alice’) is

  • false. Then,

Result of the query under D1 does not contain (c).

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-42
SLIDE 42

8 E

More example of drc unsafe query

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

We have the database table Follows(fan, idol) representing the fact that fan is following idol

  • n a social network.

Suppose that D1, D2 are distinct domain sets such that D2 = D1 ∪ {c} where Follows(c, ‘Alice’) is

  • false. Then,

Result of the query under D1 does not contain (c). Result of the query under D2 contains (c).

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-43
SLIDE 43

8 F

More example of drc unsafe query

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

We have the database table Follows(fan, idol) representing the fact that fan is following idol

  • n a social network.

Suppose that D1, D2 are distinct domain sets such that D2 = D1 ∪ {c} where Follows(c, ‘Alice’) is

  • false. Then,

Result of the query under D1 does not contain (c). Result of the query under D2 contains (c).

counterexample

unsafe

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-44
SLIDE 44

9 A

Even more examples of drc unsafe queries

Example 5. Set of pairs of people such that the first person follows Alice or the second person follows Bob.

Q weird pairing = {x,y ∣ Follows(x, ‘Alice’) ∨ Follows(y, ‘Bob’)}

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-45
SLIDE 45

9 B

Even more examples of drc unsafe queries

Example 5. Set of pairs of people such that the first person follows Alice or the second person follows Bob.

Q weird pairing = {x,y ∣ Follows(x, ‘Alice’) ∨ Follows(y, ‘Bob’)}

As long as there is a person y following Bob, then (x,y) would be in the result for every x in the domain.

counterexample

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-46
SLIDE 46

9 C

Even more examples of drc unsafe queries

Example 5. Set of pairs of people such that the first person follows Alice or the second person follows Bob.

Q follows all = {x ∣ ∀y[Follows(x,y)]} Q weird pairing = {x,y ∣ Follows(x, ‘Alice’) ∨ Follows(y, ‘Bob’)} unsafe

As long as there is a person y following Bob, then (x,y) would be in the result for every x in the domain.

counterexample

Example 6. People who follows everyone.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-47
SLIDE 47

9 D

Even more examples of drc unsafe queries

Example 5. Set of pairs of people such that the first person follows Alice or the second person follows Bob.

Q follows all = {x ∣ ∀y[Follows(x,y)]} Q weird pairing = {x,y ∣ Follows(x, ‘Alice’) ∨ Follows(y, ‘Bob’)} unsafe

As long as there is a person y following Bob, then (x,y) would be in the result for every x in the domain.

counterexample

If the result is not empty under some particular domain, then adding an alien to the domain will make the result empty.

counterexample

Example 6. People who follows everyone.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-48
SLIDE 48

9 E

Even more examples of drc unsafe queries

Example 5. Set of pairs of people such that the first person follows Alice or the second person follows Bob.

Q follows all = {x ∣ ∀y[Follows(x,y)]} Q weird pairing = {x,y ∣ Follows(x, ‘Alice’) ∨ Follows(y, ‘Bob’)} unsafe unsafe

As long as there is a person y following Bob, then (x,y) would be in the result for every x in the domain.

counterexample

If the result is not empty under some particular domain, then adding an alien to the domain will make the result empty.

counterexample

Example 6. People who follows everyone. The result of query in Example 6 is guaranteed to be bounded even if the domain was infinite, but regardless of that, it is still domain-dependent (unsafe).

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-49
SLIDE 49

10

main problem

2

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Formulation of main verification problem and introducing the main verification tool.

slide-50
SLIDE 50

11 A

Main problem

Suppose that we have a database schema and a drc query of the form Q = {x1,x2, . . . ,xm ∣ P(x1,x2, . . . ,xm)

  • boolean expression

}

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-51
SLIDE 51

11 B

Main problem

Suppose that we have a database schema and a drc query of the form Q = {x1,x2, . . . ,xm ∣ P(x1,x2, . . . ,xm)

  • boolean expression

}

We will get into the structure of the boolean expression P later.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-52
SLIDE 52

11 C

Main problem

Suppose that we have a database schema and a drc query of the form Q = {x1,x2, . . . ,xm ∣ P(x1,x2, . . . ,xm)

  • boolean expression

} To verify that query Q is safe, we check that

We will get into the structure of the boolean expression P later.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-53
SLIDE 53

11 D

Main problem

Suppose that we have a database schema and a drc query of the form Q = {x1,x2, . . . ,xm ∣ P(x1,x2, . . . ,xm)

  • boolean expression

} To verify that query Q is safe, we check that

for every pair of domain sets D1 and D2, and for every database instance under the schema (which is also valid under both domains D1 and D2) We will get into the structure of the boolean expression P later.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-54
SLIDE 54

11 E

Main problem

Suppose that we have a database schema and a drc query of the form Q = {x1,x2, . . . ,xm ∣ P(x1,x2, . . . ,xm)

  • boolean expression

} To verify that query Q is safe, we check that

for every pair of domain sets D1 and D2, and for every database instance under the schema (which is also valid under both domains D1 and D2)

Then, the result of the query under the assumption of domain D1 (denoted Q[D1]) is equal to that under the assumption of domain D2 (denoted Q[D2]).

We will get into the structure of the boolean expression P later.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-55
SLIDE 55

11 F

Main problem

Suppose that we have a database schema and a drc query of the form Q = {x1,x2, . . . ,xm ∣ P(x1,x2, . . . ,xm)

  • boolean expression

} To verify that query Q is safe, we check that

for every pair of domain sets D1 and D2, and for every database instance under the schema (which is also valid under both domains D1 and D2)

Then, the result of the query under the assumption of domain D1 (denoted Q[D1]) is equal to that under the assumption of domain D2 (denoted Q[D2]).

i.e., the result is always the same, Q[D1] = Q[D2], for any pairs of domains D1 and D2.

We will get into the structure of the boolean expression P later.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-56
SLIDE 56

11 G

Main problem

Suppose that we have a database schema and a drc query of the form Q = {x1,x2, . . . ,xm ∣ P(x1,x2, . . . ,xm)

  • boolean expression

} To verify that query Q is safe, we check that

for every pair of domain sets D1 and D2, and for every database instance under the schema (which is also valid under both domains D1 and D2)

Then, the result of the query under the assumption of domain D1 (denoted Q[D1]) is equal to that under the assumption of domain D2 (denoted Q[D2]).

i.e., the result is always the same, Q[D1] = Q[D2], for any pairs of domains D1 and D2.

We will get into the structure of the boolean expression P later.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

We can model all of this in Alloy.

slide-57
SLIDE 57

12 A

What is Alloy Analyzer?

Alloy Analyzer is a tool for modeling objects with specifications regarding their related structure, and formally verifying whether some properties hold for such objects based on some

  • ther pre-assumed properties.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-58
SLIDE 58

12 B

What is Alloy Analyzer?

Alloy Analyzer is a tool for modeling objects with specifications regarding their related structure, and formally verifying whether some properties hold for such objects based on some

  • ther pre-assumed properties.

Model signature definitions

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-59
SLIDE 59

12 C

What is Alloy Analyzer?

Alloy Analyzer is a tool for modeling objects with specifications regarding their related structure, and formally verifying whether some properties hold for such objects based on some

  • ther pre-assumed properties.

Model signature definitions Assumed facts or properties

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-60
SLIDE 60

12 D

What is Alloy Analyzer?

Alloy Analyzer is a tool for modeling objects with specifications regarding their related structure, and formally verifying whether some properties hold for such objects based on some

  • ther pre-assumed properties.

Model signature definitions Assumed facts or properties Target asserted property

?

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-61
SLIDE 61

12 E

What is Alloy Analyzer?

Alloy Analyzer is a tool for modeling objects with specifications regarding their related structure, and formally verifying whether some properties hold for such objects based on some

  • ther pre-assumed properties.

Model signature definitions Assumed facts or properties Target asserted property

?

Actually, Alloy Analyzer will attempt to find a counterexample to the asserted property. If Alloy does not find a counterexample, it does not mean that the asserted property is true.

*

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-62
SLIDE 62

12 F

What is Alloy Analyzer?

Alloy Analyzer is a tool for modeling objects with specifications regarding their related structure, and formally verifying whether some properties hold for such objects based on some

  • ther pre-assumed properties.

Model signature definitions Assumed facts or properties Target asserted property

?

Actually, Alloy Analyzer will attempt to find a counterexample to the asserted property. If Alloy does not find a counterexample, it does not mean that the asserted property is true.

*

The tool was developed by Daniel Jackson and his team at the Massachusetts Institute of Technology (mit).

http://alloy.mit.edu/

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-63
SLIDE 63

13 A

Task summary

For a given database tables R1, . . . ,Rk and a given drc query Q,

Coming up next ...

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-64
SLIDE 64

13 B

Task summary

For a given database tables R1, . . . ,Rk and a given drc query Q,

we provide a method to translate the tables into Alloy model signature

Coming up next ...

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-65
SLIDE 65

13 C

Task summary

For a given database tables R1, . . . ,Rk and a given drc query Q,

we provide a method to translate the tables into Alloy model signature and the query into an Alloy function.

Coming up next ...

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-66
SLIDE 66

13 D

Task summary

For a given database tables R1, . . . ,Rk and a given drc query Q, We also provide additional components to set-up the verification task in Alloy to determine whether the given query is safe or not.

we provide a method to translate the tables into Alloy model signature and the query into an Alloy function.

Coming up next ...

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-67
SLIDE 67

13 E

Task summary

For a given database tables R1, . . . ,Rk and a given drc query Q, We also provide additional components to set-up the verification task in Alloy to determine whether the given query is safe or not.

we provide a method to translate the tables into Alloy model signature and the query into an Alloy function. model signatures for domain sets, scalar values, and optional query result

Additional components include

and safety assertion statement for the query.

Coming up next ...

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-68
SLIDE 68

13 F

Task summary

For a given database tables R1, . . . ,Rk and a given drc query Q, We also provide additional components to set-up the verification task in Alloy to determine whether the given query is safe or not.

we provide a method to translate the tables into Alloy model signature and the query into an Alloy function. model signatures for domain sets, scalar values, and optional query result

Additional components include

and safety assertion statement for the query.

Coming up next ...

1 2 3 4 5

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-69
SLIDE 69

14

translation to

3.1

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

We demonstrate how to translate database schema and drc queries into Alloy syntax with an example.

alloy model

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

slide-70
SLIDE 70

15 A

Domain sets and scalar values

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

1

slide-71
SLIDE 71

15 B

Domain sets and scalar values

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

1

1 sig Superparticle {} { 2 Superparticle = Universe.Element 3 } 4 5 abstract sig Universe { Element: some Superparticle } 6

  • ne sig UniverseAlpha, UniverseBeta extends Universe {}

7 8 some sig Particle in Superparticle {} { 9 Particle = UniverseAlpha.Element & UniverseBeta.Element 10 }

This definition is always static for all verification tasks. We need to be able to consider different domain sets in order to ultimately determine if a query is domain-dependent.

slide-72
SLIDE 72

15 C

Domain sets and scalar values

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

1

1 sig Superparticle {} { 2 Superparticle = Universe.Element 3 } 4 5 abstract sig Universe { Element: some Superparticle } 6

  • ne sig UniverseAlpha, UniverseBeta extends Universe {}

7 8 some sig Particle in Superparticle {} { 9 Particle = UniverseAlpha.Element & UniverseBeta.Element 10 }

a set of all possible scalar values across all domains a collection of exactly two domain sets 1st domain 2nd domain a set of scalar values allowed in the actual database instances

This definition is always static for all verification tasks. We need to be able to consider different domain sets in order to ultimately determine if a query is domain-dependent.

slide-73
SLIDE 73

15 D

Domain sets and scalar values

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

1

1 sig Superparticle {} { 2 Superparticle = Universe.Element 3 } 4 5 abstract sig Universe { Element: some Superparticle } 6

  • ne sig UniverseAlpha, UniverseBeta extends Universe {}

7 8 some sig Particle in Superparticle {} { 9 Particle = UniverseAlpha.Element & UniverseBeta.Element 10 }

fact: each Superparticle must belong to at least one universe fact: Particle is the intersection of both universes the field of Universe representing the subset of Superparticle

This definition is always static for all verification tasks. We need to be able to consider different domain sets in order to ultimately determine if a query is domain-dependent.

slide-74
SLIDE 74

16 A

Database instances

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

2

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-75
SLIDE 75

16 B

Database instances

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

2

11

  • ne sig Table {

12 Follows: Particle -> Particle 13 }

Each database table is declared as a field of the main signature Table, and the multiplicity must reflect the number of columns in the table.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-76
SLIDE 76

16 C

Database instances

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

2

11

  • ne sig Table {

12 Follows: Particle -> Particle 13 }

definition of the table Follows with 2 columns

Each database table is declared as a field of the main signature Table, and the multiplicity must reflect the number of columns in the table.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-77
SLIDE 77

16 D

Database instances

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

2

Each database table is declared as a field of the main signature Table, and the multiplicity must reflect the number of columns in the table.

11

  • ne sig Table {

12 Follows: Particle -> Particle, 13 User: set Particle /* assume we have another table */ 14 }

If there is more than 1 table in the schema, then the field signature of each table must be separated

by comma.

hypothetical!

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-78
SLIDE 78

16 E

Database instances

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

2

Each database table is declared as a field of the main signature Table, and the multiplicity must reflect the number of columns in the table.

11

  • ne sig Table {

12 Follows: Particle -> Particle, 13 User: set Particle /* assume we have another table */ 14 }

If there is more than 1 table in the schema, then the field signature of each table must be separated

by comma.

If the table has exactly 1 column, then the field signature is set Particle.

Otherwise, it is the keyword Particle repeated with the number of times equal to the number of columns, separated by ->.

hypothetical!

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-79
SLIDE 79

16 F

Database instances

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

2

11

  • ne sig Table {

12 Follows: Particle -> Particle 13 }

Each database table is declared as a field of the main signature Table, and the multiplicity must reflect the number of columns in the table.

If there is more than 1 table in the schema, then the field signature of each table must be separated

by comma.

If the table has exactly 1 column, then the field signature is set Particle.

Otherwise, it is the keyword Particle repeated with the number of times equal to the number of columns, separated by ->.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-80
SLIDE 80

17 A

Query function

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

3

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-81
SLIDE 81

17 B

Query function

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

3

14

  • ne sig Constant {

15 Alice: Particle 16 } 17 18 fun query[u: Universe]: set Superparticle { 19 { x: u.Element | not (x -> Constant.Alice in Table.Follows) } 20 }

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

the input to the query function in Alloy is the domain set

slide-82
SLIDE 82

17 C

Query function

definition of constant appeared in query

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

3

14

  • ne sig Constant {

15 Alice: Particle 16 } 17 18 fun query[u: Universe]: set Superparticle { 19 { x: u.Element | not (x -> Constant.Alice in Table.Follows) } 20 }

The translation of boolean expression is mostly straightforward.

  • utput signature (same format as table’s

field signature) boolean expression

Non-highlighted codes are always static for all verification tasks.

*

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

all identifiers separated by commas

slide-83
SLIDE 83

17 D

Query function

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

3

14

  • ne sig Constant {

15 Alice: Particle 16 } 17 18 fun query[u: Universe]: set Superparticle { 19 { x: u.Element | not (x -> Constant.Alice in Table.Follows) } 20 }

The translation of boolean expression is mostly straightforward.

For a conjunction (∧), a disjunction (∨), a negation (¬), a conditional (⇒), a bi-conditional (⇔), or a

universal (∀) or existential (∃) quantification of other boolean expressions; the translation propagates down the expression tree.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-84
SLIDE 84

17 E

Query function

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

3

14

  • ne sig Constant {

15 Alice: Particle 16 } 17 18 fun query[u: Universe]: set Superparticle { 19 { x: u.Element | not (x -> Constant.Alice in Table.Follows) } 20 }

The translation of boolean expression is mostly straightforward.

For a conjunction (∧), a disjunction (∨), a negation (¬), a conditional (⇒), a bi-conditional (⇔), or a

universal (∀) or existential (∃) quantification of other boolean expressions; the translation propagates down the expression tree.

For a boolean predicate in terms of table name; the tuple is constructed using arrow products (->), and the

set member operation (in) checks if the tuple belongs to the specified table.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-85
SLIDE 85

18

Query function Translating boolean expression

3

1 TranslateBooleanExp(P): 2 if P is a table-name predicate T (x1, x2, . . . , xm): 3 return "${x1} → ${x2} → . . . → ${xm} in Table.${T }" 4 else if P is the equality predicate x1 = x2: 5 return "(${x1} = ${x2})" 6 else if P has the form ¬Q: 7 return "(not ${TranslateBooleanExp(Q)})" 8 else if P has the form Q ∨ R: 9 return "(${TranslateBooleanExp(Q)} or ${TranslateBooleanExp(R)})" 10 else if P has the form Q ∧ R: 11 return "(${TranslateBooleanExp(Q)} and ${TranslateBooleanExp(R)})" 12 else if P has the form Q ⇒ R: 13 return "(${TranslateBooleanExp(Q)} implies ${TranslateBooleanExp(R)})" 14 else if P has the form Q ⇔ R: 15 return "(${TranslateBooleanExp(Q)} iff ${TranslateBooleanExp(R)})" 16 else if P has the form ∃y[Q]: 17 return "(some ${y}: u.Element | ${TranslateBooleanExp(Q)})" 18 else if P has the form ∀y[Q]: 19 return "(all ${y}: u.Element | ${TranslateBooleanExp(Q)})"

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-86
SLIDE 86

19 A

Safety verification for query

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

4

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-87
SLIDE 87

19 B

Safety verification for query

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

4

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

21 assert queryIsSafe { 22 all u, u’: Universe | query[u] = query[u’] 23 } 24 check queryIsSafe for 4

This definition is always static for all verification tasks.

slide-88
SLIDE 88

19 C

Safety verification for query

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

4

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

21 assert queryIsSafe { 22 all u, u’: Universe | query[u] = query[u’] 23 } 24 check queryIsSafe for 4

This definition is always static for all verification tasks.

Except for the upper limit of the number of object of each model to be constructed by Alloy Analyzer while

looking for counterexample.

upper limit of number of objects

slide-89
SLIDE 89

19 D

Safety verification for query

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

4

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

21 assert queryIsSafe { 22 all u, u’: Universe | query[u] = query[u’] 23 } 24 check queryIsSafe for 4

This definition is always static for all verification tasks.

Except for the upper limit of the number of object of each model to be constructed by Alloy Analyzer while

looking for counterexample.

All of the Alloy codes up to this point is sufficient for the verification.

Unless the visualization of the counterexample is wanted.

slide-90
SLIDE 90

20 A

Optional results placeholder

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

5

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-91
SLIDE 91

20 B

Optional results placeholder

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

5

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

25 abstract sig Result { 26 Output: set Superparticle 27 } 28

  • ne sig ResultAlpha, ResultBeta extends Result {} {

29 ResultAlpha.@Output = query[UniverseAlpha] 30 ResultBeta.@Output = query[UniverseBeta] 31 }

This definition is always static for all verification tasks.

slide-92
SLIDE 92

20 C

Optional results placeholder

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

5

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

25 abstract sig Result { 26 Output: set Superparticle 27 } 28

  • ne sig ResultAlpha, ResultBeta extends Result {} {

29 ResultAlpha.@Output = query[UniverseAlpha] 30 ResultBeta.@Output = query[UniverseBeta] 31 }

This definition is always static for all verification tasks.

Except for the signature fo the Output field of the query Result object, which will be exactly the same as

the output signature of the Alloy function query.

3

  • utput signature of the result
slide-93
SLIDE 93

20 D

Optional results placeholder

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

5

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

25 abstract sig Result { 26 Output: set Superparticle 27 } 28

  • ne sig ResultAlpha, ResultBeta extends Result {} {

29 ResultAlpha.@Output = query[UniverseAlpha] 30 ResultBeta.@Output = query[UniverseBeta] 31 }

This definition is always static for all verification tasks.

Except for the signature fo the Output field of the query Result object, which will be exactly the same as

the output signature of the Alloy function query.

3

The output is binded to the query result when the domain is applied.

fact: the output for each case of a domain set is binded to the result of the query under that domain

slide-94
SLIDE 94

21

Summarized Alloy code

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

  • SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

1 /* Scalar values */ 2 sig Superparticle {} { 3 Superparticle = Universe.Element 4 } 5 6 /* Domains */ 7 abstract sig Universe { Element: some Superparticle } 8

  • ne sig UniverseAlpha, UniverseBeta extends Universe {}

9 10 /* Common domain */ 11 some sig Particle in Superparticle {} { 12 Particle = UniverseAlpha.Element & UniverseBeta.Element 13 } 14 15 /* Database Instance */ 16

  • ne sig Table {

17 Follows: Particle -> Particle 18 } 19 20 /* Constant Values */ 21

  • ne sig Constant {

22 Alice: Particle 23 } 24 /* Lists all people who are not following Alice */ 25 fun query[u: Universe]: set Superparticle { 26 { x: u.Element | not (x -> Constant.Alice in Table.Follows) } 27 } 28 29 /* Safety assertion */ 30 assert queryIsSafe { 31 all u, u’: Universe | query[u] = query[u’] 32 } 33 34 /* Results placeholder */ 35 abstract sig Result { 36 Output: set Superparticle 37 } 38

  • ne sig ResultAlpha, ResultBeta extends Result {} {

39 ResultAlpha.@Output = query[UniverseAlpha] 40 ResultBeta.@Output = query[UniverseBeta] 41 } 42 43 /* Invoke the verification on the assertion */ 44 check queryIsSafe for 4

slide-95
SLIDE 95

22 A

Verification outcome

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

|

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Once the code is run, Alloy Analyzer finds a counterexample.

slide-96
SLIDE 96

22 B

Verification outcome

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

|

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Once the code is run, Alloy Analyzer finds a counterexample.

Superparticle0 Element ResultAlpha Output ResultBeta UniverseAlpha UniverseBeta Follows Follows Superparticle1 Superparticle2 (Alice) Element Element Element Element

slide-97
SLIDE 97

22 C

Verification outcome

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

|

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Once the code is run, Alloy Analyzer finds a counterexample.

Superparticle0 Element ResultAlpha Output ResultBeta UniverseAlpha UniverseBeta Follows Follows Superparticle1 Superparticle2 (Alice)

Particles

Element Element Element Element

slide-98
SLIDE 98

22 D

Verification outcome

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

|

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Once the code is run, Alloy Analyzer finds a counterexample.

Superparticle0 Element ResultAlpha Output ResultBeta UniverseAlpha UniverseBeta Follows Follows Superparticle1 Superparticle2 (Alice) Element Element Element Element

slide-99
SLIDE 99

22 E

Verification outcome

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

|

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Once the code is run, Alloy Analyzer finds a counterexample.

Superparticle0 Element ResultAlpha Output UniverseAlpha Follows Follows Superparticle1 Superparticle2 (Alice) Element Element

UniverseAlpha has 3 elements: Superparticle0, Superparticle1, and Superparticle2 (a.k.a Alice). Superparticle0 is the only person not

following Alice so it is the only person in the output.

slide-100
SLIDE 100

22 F

Verification outcome

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

|

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Once the code is run, Alloy Analyzer finds a counterexample.

ResultBeta UniverseBeta Follows Follows Superparticle1 Superparticle2 (Alice) Element Element

UniverseBeta has only 2 elements: Superparticle1 and Superparticle2 (or Alice).

Both are following Alice so the result is empty.

slide-101
SLIDE 101

22 G

Verification outcome

Q not following Alice = {x ∣ ¬ Follows(x, ‘Alice’)}

Example 4. People who do not follow Alice.

|

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Once the code is run, Alloy Analyzer finds a counterexample.

Superparticle0 Element ResultAlpha Output ResultBeta UniverseAlpha UniverseBeta Follows Follows Superparticle1 Superparticle2 (Alice) Element Element Element Element

Therefore, this query is unsafe (domain-dependent).

slide-102
SLIDE 102

23

translation to

3.2

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

We demonstrate how this verification process can help us debug unsafe queries with another example.

alloy model

Q follows all = {x ∣ ∀y[Follows(x,y)]}

Example 6. People who follows everyone.

slide-103
SLIDE 103

24 A

Fixing the query

Q follows all = {x ∣ ∀y[Follows(x, y)]}

Example 6. People who follows everyone.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-104
SLIDE 104

24 B

Fixing the query

Q follows all = {x ∣ ∀y[Follows(x, y)]}

Example 6. People who follows everyone.

Need to make sure that we only consider idols in the database, i.e., they must have at least one follower.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-105
SLIDE 105

24 C

Fixing the query

Q follows all = {x ∣ ∀y[Follows(x, y)]}

Example 6. People who follows everyone.

Need to make sure that we only consider idols in the database, i.e., they must have at least one follower.

So here is the fixed version of the query.

Q follows all = {x ∣ ∀y[Follows(x,y)]} Q follows all v2 = {x ∣ ∀y[∃z[Follows(z,y)] ⇒ Follows(x,y)]}

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-106
SLIDE 106

24 D

Fixing the query

Q follows all = {x ∣ ∀y[Follows(x, y)]}

Example 6. People who follows everyone.

Need to make sure that we only consider idols in the database, i.e., they must have at least one follower.

So here is the fixed version of the query.

Q follows all = {x ∣ ∀y[Follows(x,y)]} Q follows all v2 = {x ∣ ∀y[∃z[Follows(z,y)] ⇒ Follows(x,y)]} Now let us check if the improved query is indeed safe.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-107
SLIDE 107

25

Summarized Alloy code

Q follows all v2 = {x ∣ ∀y[∃z[Follows(z, y)] ⇒ Follows(x, y)]}

Example 6. People who follows everyone.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

1 /* Scalar values */ 2 sig Superparticle {} { 3 Superparticle = Universe.Element 4 } 5 6 /* Domains */ 7 abstract sig Universe { Element: some Superparticle } 8

  • ne sig UniverseAlpha, UniverseBeta extends Universe {}

9 10 /* Common domain */ 11 some sig Particle in Superparticle {} { 12 Particle = UniverseAlpha.Element & UniverseBeta.Element 13 } 14 15 /* Database Instance */ 16

  • ne sig Table {

17 Follows: Particle -> Particle 18 } 19 20 /* Lists all follows who follows every idols */ 21 fun query[u: Universe]: set Superparticle { 22 { x: u.Element | all y: u.Element | 23 (some z: u.Element | z -> y in Table.Follows) 24 implies (x -> y in Table.Follows) } 25 } 26 /* Safety assertion */ 27 assert queryIsSafe { 28 all u, u’: Universe | query[u] = query[u’] 29 } 30 31 /* Results placeholder */ 32 abstract sig Result { 33 Output: set Superparticle 34 } 35

  • ne sig ResultAlpha, ResultBeta extends Result {} {

36 ResultAlpha.@Output = query[UniverseAlpha] 37 ResultBeta.@Output = query[UniverseBeta] 38 } 39 40 /* Invoke the verification on the assertion */ 41 check queryIsSafe for 4

slide-108
SLIDE 108

26 A

Verification outcome

Q follows all v2 = {x ∣ ∀y[∃z[Follows(z, y)] ⇒ Follows(x, y)]}

Example 6. People who follows everyone.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Once the code is run, Alloy Analyzer still finds a counterexample.

slide-109
SLIDE 109

26 B

Verification outcome

Q follows all v2 = {x ∣ ∀y[∃z[Follows(z, y)] ⇒ Follows(x, y)]}

Example 6. People who follows everyone.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Once the code is run, Alloy Analyzer still finds a counterexample.

By browsing all counterexamples, we found that the table Follows is always empty.

slide-110
SLIDE 110

26 C

Verification outcome

Q follows all v2 = {x ∣ ∀y[∃z[Follows(z, y)] ⇒ Follows(x, y)]}

Example 6. People who follows everyone.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Once the code is run, Alloy Analyzer still finds a counterexample.

By browsing all counterexamples, we found that the table Follows is always empty. So ∃z[Follows(z,y)] ⇒ Follows(x,y) is vacuously true.

slide-111
SLIDE 111

26 D

Verification outcome

Q follows all v2 = {x ∣ ∀y[∃z[Follows(z, y)] ⇒ Follows(x, y)]}

Example 6. People who follows everyone.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Once the code is run, Alloy Analyzer still finds a counterexample.

By browsing all counterexamples, we found that the table Follows is always empty. So ∃z[Follows(z,y)] ⇒ Follows(x,y) is vacuously true. And thus the boolean expression of the set comprehension always holds.

slide-112
SLIDE 112

26 E

Verification outcome

Q follows all v2 = {x ∣ ∀y[∃z[Follows(z, y)] ⇒ Follows(x, y)]}

Example 6. People who follows everyone.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Once the code is run, Alloy Analyzer still finds a counterexample.

By browsing all counterexamples, we found that the table Follows is always empty. So ∃z[Follows(z,y)] ⇒ Follows(x,y) is vacuously true. And thus the boolean expression of the set comprehension always holds.

We forgot to check that each person in the result must follow at least one person.

slide-113
SLIDE 113

26 F

Verification outcome

Q follows all v2 = {x ∣ ∀y[∃z[Follows(z, y)] ⇒ Follows(x, y)]}

Example 6. People who follows everyone.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

Once the code is run, Alloy Analyzer still finds a counterexample.

By browsing all counterexamples, we found that the table Follows is always empty. So ∃z[Follows(z,y)] ⇒ Follows(x,y) is vacuously true. And thus the boolean expression of the set comprehension always holds.

We forgot to check that each person in the result must follow at least one person. Q follows all v3 = {x ∣ ∃w[Follows(x,w)] ∧ ∀y[∃z[Follows(z,y)] ⇒ Follows(x,y)]} Q follows all v2 = {x ∣ ∀y[∃z[Follows(z,y)] ⇒ Follows(x,y)]}

slide-114
SLIDE 114

27 A

Once the code is fixed

20 /* Lists all follows who follows every idols */ 21 fun query[u: Universe]: set Superparticle { 22 { x: u.Element | all y: u.Element | 23 (some z: u.Element | z -> y in Table.Follows) 24 implies (x -> y in Table.Follows) } 25 } 20 /* Lists all follows who follows every idols */ 21 fun query[u: Universe]: set Superparticle { 22 { x : u.Element | 23 (some w: u.Element | x -> w in Table.Follows) and 24 (all y: u.Element | 25 (some z: u.Element | z -> y in Table.Follows) 26 implies (x -> y in Table.Follows)) } 27 }

Q follows all v3 = {x ∣ ∃w[Follows(x, w)] ∧ ∀y[∃z[Follows(z, y)] ⇒ Follows(x, y)]}

Example 6. People who follows everyone.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

slide-115
SLIDE 115

27 B

Once the code is fixed

20 /* Lists all follows who follows every idols */ 21 fun query[u: Universe]: set Superparticle { 22 { x: u.Element | all y: u.Element | 23 (some z: u.Element | z -> y in Table.Follows) 24 implies (x -> y in Table.Follows) } 25 } 20 /* Lists all follows who follows every idols */ 21 fun query[u: Universe]: set Superparticle { 22 { x : u.Element | 23 (some w: u.Element | x -> w in Table.Follows) and 24 (all y: u.Element | 25 (some z: u.Element | z -> y in Table.Follows) 26 implies (x -> y in Table.Follows)) } 27 }

Q follows all v3 = {x ∣ ∃w[Follows(x, w)] ∧ ∀y[∃z[Follows(z, y)] ⇒ Follows(x, y)]}

Example 6. People who follows everyone.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

This time, Alloy Analyzer no longer finds a counterexample.

slide-116
SLIDE 116

27 C

Once the code is fixed

20 /* Lists all follows who follows every idols */ 21 fun query[u: Universe]: set Superparticle { 22 { x: u.Element | all y: u.Element | 23 (some z: u.Element | z -> y in Table.Follows) 24 implies (x -> y in Table.Follows) } 25 } 20 /* Lists all follows who follows every idols */ 21 fun query[u: Universe]: set Superparticle { 22 { x : u.Element | 23 (some w: u.Element | x -> w in Table.Follows) and 24 (all y: u.Element | 25 (some z: u.Element | z -> y in Table.Follows) 26 implies (x -> y in Table.Follows)) } 27 }

Q follows all v3 = {x ∣ ∃w[Follows(x, w)] ∧ ∀y[∃z[Follows(z, y)] ⇒ Follows(x, y)]}

Example 6. People who follows everyone.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

This time, Alloy Analyzer no longer finds a counterexample.

41 check queryIsSafe for 4 41 check queryIsSafe for 12

Even bumping up the upper limit of the number of objects, no counterexample is found.

slide-117
SLIDE 117

27 D

Once the code is fixed

20 /* Lists all follows who follows every idols */ 21 fun query[u: Universe]: set Superparticle { 22 { x: u.Element | all y: u.Element | 23 (some z: u.Element | z -> y in Table.Follows) 24 implies (x -> y in Table.Follows) } 25 } 20 /* Lists all follows who follows every idols */ 21 fun query[u: Universe]: set Superparticle { 22 { x : u.Element | 23 (some w: u.Element | x -> w in Table.Follows) and 24 (all y: u.Element | 25 (some z: u.Element | z -> y in Table.Follows) 26 implies (x -> y in Table.Follows)) } 27 }

Q follows all v3 = {x ∣ ∃w[Follows(x, w)] ∧ ∀y[∃z[Follows(z, y)] ⇒ Follows(x, y)]}

Example 6. People who follows everyone.

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

This time, Alloy Analyzer no longer finds a counterexample.

41 check queryIsSafe for 4 41 check queryIsSafe for 12

We might conclude that this latest version of the query is safe.

Based on the assumption that if a counterexample exists, then a small one exists.

41 check queryIsSafe for 4

Even bumping up the upper limit of the number of objects, no counterexample is found.

41 check queryIsSafe for 12

slide-118
SLIDE 118

28

conclusion

4

SAFETY CHECKING FOR DRC QUERIES USING ALLOY ANALYZER | ABHABONGSE JANTHONG

What have we done and what is next?

slide-119
SLIDE 119

29 A

Conclusion

What we did: Establish that we could use Alloy Analyzer to verity if a drc query is safe under a given database schema.

slide-120
SLIDE 120

29 B

Conclusion

What we did: Establish that we could use Alloy Analyzer to verity if a drc query is safe under a given database schema. What can we do next:

slide-121
SLIDE 121

29 C

Conclusion

What we did: Establish that we could use Alloy Analyzer to verity if a drc query is safe under a given database schema. What can we do next:

Automate the translation process by implementing a translator.

slide-122
SLIDE 122

29 D

Conclusion

What we did: Establish that we could use Alloy Analyzer to verity if a drc query is safe under a given database schema. What can we do next:

Automate the translation process by implementing a translator. Add support for all scalar value comparison operators, to reflect total ordering.

slide-123
SLIDE 123

29 E

Conclusion

What we did: Establish that we could use Alloy Analyzer to verity if a drc query is safe under a given database schema. What can we do next:

Automate the translation process by implementing a translator. Add support for all scalar value comparison operators, to reflect total ordering. Extend the framework to support bounded integer operations.

slide-124
SLIDE 124

29 F

Conclusion

What we did: Establish that we could use Alloy Analyzer to verity if a drc query is safe under a given database schema. What can we do next:

Automate the translation process by implementing a translator. Add support for all scalar value comparison operators, to reflect total ordering. Extend the framework to support bounded integer operations. Add support for the modeling of functional dependencies in database schema.

slide-125
SLIDE 125

30

References

[AB88] Serge Abiteboul and Catriel Beeri. On the power of languages for the manipulation of complex objects. Research Report RR-0846, INRIA, 1988. [AHV95] Serge Abiteboul, Richard Hull, and Victor Vianu, editors. Foundations of Databases: The Logical Level, chapter 5. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1st edition, 1995. [Cod72] Edgar F Codd. Relational completeness of data base sublanguages. IBM Corporation, 1972. [CP09] Alcino Cunha and Hugo Pacheco. Mapping between alloy specifications and database implementations. In Proceedings of the 2009 Seventh IEEE International Conference on Software Engineering and Formal Methods, SEFM ’09, pages 285–294, Washington, DC, USA, 2009. IEEE Computer Society. [Fag82] Ronald Fagin. Horn clauses and database dependencies. J. ACM, 29(4):952–985, October 1982. [Jac12] Daniel Jackson. Software Abstractions: Logic, Language, and Analysis. The MIT Press, 2012. [NB11] Jaideep Nijjar and Tevfik Bultan. Bounded verification of ruby on rails data models. In Proceedings of the 2011 International Symposium on Software Testing and Analysis, ISSTA ’11, pages 67–77, New York, NY, USA, 2011. ACM. [NBB15] Jaideep Nijjar, Ivan Bocić, and Tevfik Bultan. Data model property inference, verification, and repair for web applications. ACM

  • Trans. Softw. Eng. Methodol., 24(4):25:1–25:27, September 2015.

[Ull83] Jeffrey D. Ullman. Principles of Database Systems. W. H. Freeman & Co., New York, NY, USA, 2nd edition, 1983. [WDSG06] Lin Wang, Gillian Dobbie, Jing Sun, and Lindsay Groves. Validating ora-ss data models using alloy. In Proceedings of the Australian Software Engineering Conference, ASWEC ’06, pages 231–242, Washington, DC, USA, 2006. IEEE Computer Society.