Myriam Desainte-Catherine and Camilo Rueda Laboratoire Bordelais de Recherche en Informatique (LaBRI) Université de Bordeaux MUSICAL Project October, 2014 1
the operational semantics of a programming language for the specification and interpretation of interactive scores. Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 1/32 1/32
i Instantaneous Transition The Synchrony Hypothesis Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 4/32 4/32
i Instantaneous Transition The Synchrony Hypothesis ReactiveIS It’s very intuitive Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 4/32 4/32
(Σ, ∆) where Σ is a signature of constants, functions and predicate symbols, and ∆ is a first-order theory over Σ (i.e., a set of first-order sentences over Σ having at least one model). Definition (Condition) Given a condition system (Σ, ∆), let C be the set of formulas (conditions) built over Σ with the set of distinguished predicates P = {WaitFromStart, WaitFromEnd, EndScenario, WaitEvent} and the grammar F, G, ... := true | A | F ∧ G | F ∨ G where A is an atomic formula, and the symbols ∧, ∨ and true denote logical conjunction, disjunction and the always true predicate, respectively. Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 10/32 10/32
the set of labels representing the names of TOs, and M the set of messages. Definition (Program Tree) A program is an edge-labelled tree P = ⟨N, E, ℓ, m, r⟩ where • N ⊆ N is the set of nodes, • E ⊆ N × B × N is the set of edges, • ℓ : N → C × C is a total function representing the start and the end conditions of the node, • m : N ⇀ M × M is a partial function representing the messages for starting and stopping an external application, and • r ∈ N is the root of the tree. Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 11/32 11/32
We can reuse the program tree and define partial functions. ����� ������� � ������ � ����� ������� � ������ � �� ����� ������� � ������ � �� Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 13/32 13/32
tree S = ⟨N, E, ℓ, r⟩ where • N, E and r are defined as in the Program Tree definition, • ℓ : N → Z+ × Z⊥ is a total function giving, for each node, its starting and ending times. Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 14/32 14/32
Dates start: 3 stop: ! B Dates start: 1 stop: 3 A Elaine said How do you stop a process? Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 15/32 15/32
Dates start: 3 stop: ! B Dates start: 1 stop: 3 A Dates start: 0 stop: ! Dates start: 3 stop: 5 B Dates start: 1 stop: 3 A stop(S,B,5) Elaine said How do you stop a process? Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 15/32 15/32
Dates start: 3 stop: ! B Dates start: 1 stop: 3 A Dates start: 0 stop: ! Dates start: 3 stop: 5 B Dates start: 1 stop: 3 A stop(S,B,5) Elaine said How do you start a process? Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 15/32 15/32
A ◁ − s is a subset of the relation s that contains all of the pairs whose first element is not in A. More formally A ◁ − s = { x → y | x → y ∈ s ∧ x ̸∈ A} Relation Overwrite The relational overwrite t ◁ − s is equal to t except all entries in t whose first element is in the domain of s are replaced by the corresponding entries in s. More formally, t ◁ − s = s ∪ (dom(s) ◁ − t) Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 16/32 16/32
path p ∈ L(S) and a time t ∈ Z+, stop(S, p, t) = ⟨N, E, ℓ ◁ − {n → (ts(n), t) | n ∈ k}, r⟩ where k = { n | n ∈ D(target(p)) ∧ te(n) = ⊥ } Starting a TO For a path p ∈ L(S) and a time t ∈ Z+, start(S, p, t) = ⟨N ∪ {n1}, E ∪ {n b − → n1}, ℓ ∪ {n1 → (t, ⊥)}, r⟩ where n1 / ∈ N, n = target(up(p)), b = last(p) Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 17/32 17/32
Current State Tree Current Output Current Input Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 19/32 19/32
Current State Tree Current Output Current Input Current Time Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 19/32 19/32
satisfies a condition F in the underlying condition system if ⟨P, S, I, O, t⟩ |= F, where ⟨P, S, I, O, t⟩ |= true ⟨P, S, I, O, t⟩ |= WaitFromStart(p, t1, t2) iff ∃n · n ∈ V (S) ∧ n = target(p) ∧ t1 ≤ t − ts (n) ≤ t2 ⟨P, S, I, O, t⟩ |= WaitFromEnd(p, t1, t2) iff ∃n · n ∈ V (S) ∧ n = target(p) ∧ te(n) ̸= ⊥ ∧ t1 ≤ t − te(n) ≤ t2 ⟨P, S, I, O, t⟩ |= EndScenario iff ∀p · p ∈ out(root(P)) ⇒ te(target(p)) ̸= ⊥ ⟨P, S, I, O, t⟩ |= WaitEvent(e) iff e ∈ I ⟨P, S, I, O, t⟩ |= F ∧ G iff ⟨P, S, I, O, t⟩ |= F and ⟨P, S, I, O, t⟩ |= G ⟨P, S, I, O, t⟩ |= F ∨ G iff ⟨P, S, I, O, t⟩ |= F or ⟨P, S, I, O, t⟩ |= G Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 20/32 20/32
O, t⟩ |= cs (target(p)) ⟨P, S, I, O, t⟩ −→ ⟨P, start(S, p, t), I, O ∪ {ms (target(p))}, t⟩ RSTOP p ∈ canStop(S) ⟨P, S, I, O, t⟩ |= ce(target(p)) ⟨P, S, I, O, t⟩ −→ ⟨P, stop(S, p, t), I, O ∪ {me(target(p))}, t⟩ RTIME ⟨P, S, I, ∅, t⟩ −→∗ ⟨P, S′, I, O, t⟩ ̸ −→ ⟨P, S, t⟩ I,O =⇒ ⟨P, S′, t + 1⟩ Table: Rules for the internal reduction −→ and the observable reduction =⇒. Notation γ ̸ −→ means that there is no γ′ such that γ −→ γ′. Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 21/32 21/32
S, I, O, t⟩ |= cs (target(p)) ⟨P, S, I, O, t⟩ −→ ⟨P, start(S, p, t), I, O ∪ {ms (target(p))}, t⟩ Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 22/32 22/32
S, I, O, t⟩ |= cs (target(p)) ⟨P, S, I, O, t⟩ −→ ⟨P, start(S, p, t), I, O ∪ {ms (target(p))}, t⟩ Salim said Which nodes can start? Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 22/32 22/32
S, I, O, t⟩ |= cs (target(p)) ⟨P, S, I, O, t⟩ −→ ⟨P, start(S, p, t), I, O ∪ {ms (target(p))}, t⟩ Salim said Which nodes can start? Friki said canStart(S, P) b = L(P) \ L(S) Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 22/32 22/32
I, O, t⟩ |= ce(target(p)) ⟨P, S, I, O, t⟩ −→ ⟨P, stop(S, p, t), I, O ∪ {me(target(p))}, t⟩ Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 23/32 23/32
I, O, t⟩ |= ce(target(p)) ⟨P, S, I, O, t⟩ −→ ⟨P, stop(S, p, t), I, O ∪ {me(target(p))}, t⟩ Salim said Which nodes can stop? Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 23/32 23/32
I, O, t⟩ |= ce(target(p)) ⟨P, S, I, O, t⟩ −→ ⟨P, stop(S, p, t), I, O ∪ {me(target(p))}, t⟩ Salim said Which nodes can stop? canStop ( S ) b = { p | p 2 L ( S ) ^ te( target ( p )) = ?} Friki said Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 23/32 23/32
and execution of interactive scores. • Tree structures are used to represent programs and execution states. • Trees provide a clear and intuitive representation of scores and the evolution of their execution. • Conditions defined as formulas of first-order logic allow to define more complex temporal relations in scores. • The operational semantics can be easily implemented in a programming language. Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 27/32 27/32
conditionals and loops) to the operational semantics. • We plan to take advantage of the formal semantics to develop techniques and tools for the verification of scores (i.e., the playability of the score and the maximum number of multimedia processes executed simultaneously). Arias, Desainte-Catherine and Rueda A Tree-Based Operational Semantics for Interactive Multimedia Scores 28/32 28/32
Myriam Desainte-Catherine and Camilo Rueda Laboratoire Bordelais de Recherche en Informatique (LaBRI) Université de Bordeaux MUSICAL Project October, 2014 1