for ASL Nikos Mylonakis LSI Department Universitat Politecnica de Catalunya Abstract

Similar documents
Behavioural theories and the proof of. LIENS, C.N.R.S. U.R.A & Ecole Normale Superieure, 45 Rue d'ulm, F{75230 Paris Cedex 05, France

Order Sorted Algebra. Japan Advanced Institute of Science and Technology. March 8, 2008

Quasi-Boolean Encodings and Conditionals in Algebraic Specification

Symbolic Graphs for Attributed Graph Constraints

Design of abstract domains using first-order logic

1 Introduction A general problem that arises in dierent areas of computer science is the following combination problem: given two structures or theori

Lecture 2: Syntax. January 24, 2018

Boolean Algebra and Propositional Logic

Boolean Algebra and Propositional Logic

6 Coalgebraic modalities via predicate liftings

Interpolation in Logics with Constructors

Equational Logic. Chapter Syntax Terms and Term Algebras

Compositionality in SLD-derivations and their abstractions Marco Comini, Giorgio Levi and Maria Chiara Meo Dipartimento di Informatica, Universita di

Tableau Calculus for Local Cubic Modal Logic and it's Implementation MAARTEN MARX, Department of Articial Intelligence, Faculty of Sciences, Vrije Uni

Reinhold Heckmann. FB 14 { Informatik. D-6600 Saarbrucken. Bundesrepublik Deutschland. September 10, Abstract

Observational Logic. Rolf Hennicker*, Michel Bidoit**

Theoretical Computer Science

2 logic, such as those for resolution and hyperresolution. A number of recent developments serve as the motivation for the current paper. In [2, 3], i

A Precise Semantics for Ultraloose. Specications. Alastair D. Reid. Submitted for the degree of. Master of Science

example like a b, which is obviously not true. Using our method, examples like this will quickly halt and say there is no solution. A related deciency

Model Theory in the Univalent Foundations

An Algebraic View of the Relation between Largest Common Subtrees and Smallest Common Supertrees

On the specification and verification of model transformations

The Morita-equivalence between MV-algebras and abelian l-groups with strong unit

The non-logical symbols determine a specific F OL language and consists of the following sets. Σ = {Σ n } n<ω

A probability logic for reasoning about quantum observations

Electronic Notes in Theoretical Computer Science 18 (1998) URL: 8 pages Towards characterizing bisim

2 C. A. Gunter ackground asic Domain Theory. A poset is a set D together with a binary relation v which is reexive, transitive and anti-symmetric. A s

1 CHAPTER 1 INTRODUCTION 1.1 Background One branch of the study of descriptive complexity aims at characterizing complexity classes according to the l

An Alternative To The Iteration Operator Of. Propositional Dynamic Logic. Marcos Alexandre Castilho 1. IRIT - Universite Paul Sabatier and

Mind the gap! Abstract versus concrete models of specifications

1. Propositional Calculus

In a second part, we concentrate on interval models similar to the traditional ITL models presented in [, 5]. By making various assumptions about time

hal , version 1-21 Oct 2009

1. Propositional Calculus

Adding a temporal dimension to a logic. Abstract. We introduce a methodology whereby an arbitrary logic system L can be enriched

Logic Part I: Classical Logic and Its Semantics

Automated Synthesis of Tableau Calculi

Abstract. In this paper we study clausal specications over built-in algebras. To keep things simple, we consider built-in algebras only that

Transformation Rules for Locally Stratied Constraint Logic Programs

Amalgamation in the semantics of CASL

Topos Theory. Lectures 21 and 22: Classifying toposes. Olivia Caramello. Topos Theory. Olivia Caramello. The notion of classifying topos

Stochastic dominance with imprecise information


signicant in view of the fact that in many applications existential queries are of main interest. It also plays an important role in the problem of nd

On the Duality between Observability and Reachability

Vector Space Basics. 1 Abstract Vector Spaces. 1. (commutativity of vector addition) u + v = v + u. 2. (associativity of vector addition)

Contents 1 Introduction A historical note : : : : : : : : : : : : : : : : : : : : : : : : : Modal logic : : : : : : : : : : : : : : : : :

Category theory for computer science. Overall idea

How to Pop a Deep PDA Matters

Automated Reasoning Lecture 5: First-Order Logic

Relating Abstract Datatypes and Z-Schemata

4.1 Notation and probability review

Bi-rewrite Systems. Universitat Politecnica de Catalunya. Consejo Superior de Investigaciones Cientcas. Abstract

The Essentially Equational Theory of Horn Classes

modal logic can easily be used but the drawback that the translation does not generalise to arbitrary functors. Therefore, the second approach is to u

Linear Algebra (part 1) : Vector Spaces (by Evan Dummit, 2017, v. 1.07) 1.1 The Formal Denition of a Vector Space

Wojciech Penczek. Polish Academy of Sciences, Warsaw, Poland. and. Institute of Informatics, Siedlce, Poland.

The equivalence axiom and univalent models of type theory.

ii

Relativizing Tarskian Variables

A simple propositional calculus for compact Hausdor spaces

SKETCHY NOTES FOR WEEKS 7 AND 8

1. Introduction and preliminaries

Lecture 9. Model theory. Consistency, independence, completeness, categoricity of axiom systems. Expanded with algebraic view.

DISJOINT-UNION PARTIAL ALGEBRAS

Extremal Cases of the Ahlswede-Cai Inequality. A. J. Radclie and Zs. Szaniszlo. University of Nebraska-Lincoln. Department of Mathematics

Extremal problems in logic programming and stable model computation Pawe l Cholewinski and Miros law Truszczynski Computer Science Department Universi

distinct models, still insists on a function always returning a particular value, given a particular list of arguments. In the case of nondeterministi

3.1 Basic properties of real numbers - continuation Inmum and supremum of a set of real numbers

University of Oxford, Michaelis November 16, Categorical Semantics and Topos Theory Homotopy type theor

Solvability of Word Equations Modulo Finite Special And. Conuent String-Rewriting Systems Is Undecidable In General.

logic, cf. [1]. Another area of application is descriptive complexity. It turns out that familiar logics capture complexity classes over classes of (o

Interpolation theorems, lower bounds for proof. systems, and independence results for bounded. arithmetic. Jan Krajcek

AN EXTENSION OF THE PROBABILITY LOGIC LP P 2. Tatjana Stojanović 1, Ana Kaplarević-Mališić 1 and Zoran Ognjanović 2

A categorical model for a quantum circuit description language

Informatics and Mathematical Modelling, Techn. University of Denmark, Lyngby

Joseph Muscat Universal Algebras. 1 March 2013

Informal Statement Calculus

F UR. On Extra Variables in (Equational) Logic. Michael Hanus. MPI{I{94{246 September 1994

An Institution for Event-B

New concepts: Span of a vector set, matrix column space (range) Linearly dependent set of vectors Matrix null space

Implicational F -Structures and Implicational Relevance. Logics. A. Avron. Sackler Faculty of Exact Sciences. School of Mathematical Sciences

Non-elementary Lower Bound for Propositional Duration. Calculus. A. Rabinovich. Department of Computer Science. Tel Aviv University

PART I. Abstract algebraic categories

TABLEAU SYSTEM FOR LOGIC OF CATEGORIAL PROPOSITIONS AND DECIDABILITY

Preface These notes were prepared on the occasion of giving a guest lecture in David Harel's class on Advanced Topics in Computability. David's reques

An Introduction to the Theory of Coalgebras

In this paper, we take a new approach to explaining Shostak's algorithm. We rst present a subset of the original algorithm, in particular, the subset

7 RC Simulates RA. Lemma: For every RA expression E(A 1... A k ) there exists a DRC formula F with F V (F ) = {A 1,..., A k } and

Every formula evaluates to either \true" or \false." To say that the value of (x = y) is true is to say that the value of the term x is the same as th

Regular Path Expressions in Feature Logic y ROLF BACKOFEN. We examine the existential fragment of a feature logic, which is extended by regular path

The rest of the paper is organized as follows: in Section 2 we prove undecidability of the existential-universal ( 2 ) part of the theory of an AC ide

03 Review of First-Order Logic

The nite submodel property and ω-categorical expansions of pregeometries

YDE VENEMA, Faculteit Wiskunde en Informatica, Vrije Universiteit, Postbus 7161, Amsterdam, The Netherlands, and Centrum voor

Part II. Logic and Set Theory. Year

Dependent Type Theories. Lecture 4. Computing the B-sets for C-systems CC(RR)[LM]. The term C-systems of type theories.

2 PLTL Let P be a set of propositional variables. The set of formulae of propositional linear time logic PLTL (over P) is inductively dened as follows

Multiplicative Conjunction and an Algebraic. Meaning of Contraction and Weakening. A. Avron. School of Mathematical Sciences

Transcription:

A higher-order behavioural algebraic institution for ASL Nikos Mylonakis LSI Department Universitat Politecnica de Catalunya March 20, 2000 Abstract In this paper, we generalise the semantics of ASL including the three behavioural operators presented in [3] for a xed but arbitrary algebraic institution. After that, we dene a behavioural algebraic institution which is used to give an alternative semantics of the behavioural operators, to de- ne the normal forms of the both semantics of behavioural operators and to relate both semantics. Finally, we present a higher-order behavioural algebraic institution. 1 Introduction ASL is a specication language which was originally dened by a set of speci- cation operators which determined the set of specication expressions of the language. The most important operators of the original denition were operators to build structured specications from smaller specications or to make some modications from a given specication, like for example the renaming of a given specication. This language was not originally designed to be used directly but as a basis to dene the semantics of higher level specication languages. Two specication languages which used ASL to dene their semantics were EML and PLUSS. A specic kind of operator which appeared in ASL was an operator which was used to behaviourally abstract a given specication closing its model-theoretical semantics by an equivalence relation between algebras. Later on, dierent operators related to the one just described were developed. We will refer to these operators as behavioural operators. In this paper we give a general semantic framework for behavioural operators. In a general setting, these operators are parameterized by xed but arbitrary equivalence relations. There have been dened three dierent kinds of behavioural operators in ASL. We will refer to them as the abstract operator, the behaviour operator and the quotient operator. All of them have a specication as an argument and they transform the model-theoretic semantics of the argument specication. 1

Intuitively, theabstract operator extends the class of models of the argument specication with those models which are equivalent (by an equivalence relation between models) to some model belonging to the model-theoretical semantics of the argument specication. The class of models of the behaviour operator is dened by those models whose behaviour (denoted also as a model and dened via a congruence relation on values within a model) belongs to the class of models of the argument specication of the operator. Finally, the class of models of the quotient operator is dened by the closure under isomorphism of the quotient of the models associated to the semantics of the argument specication of the operator. A formal semantics of these operators is given in [3] by dening their signature and their model-theoretical semantics. They use a rst-order logic with equality to dene the sentences of specications. Apart from giving the semantics of the operators, a theory which establishes dierent equivalences between the semantics of these operators is presented. In [7], an alternative semantics for the behavioural operators is given using just at specications as argument specications. They use higher-order logic as specication logic and a similar theory as in [3] to relate the semantics of the behaviour and abstract operator is developed. Since both semantics are quite independent of the specication logic of the specication language, it seems reasonable to make a generalisation of the semantics of these operators for an arbitrary but xed institution. These institutions have to satisfy specic properties in order to include these operators in a version of ASL with structuring operators and they are a restricted version of semiexact institutions presented in [9]. We refer to these institutions as algebraic institutions (AIN S) andthetwo main restrictions are that the category of signatures is the category of rst-order relational signatures and the model functor of these institutions assigns to every rst-order relational signature the category of -algebras which we will denote as Alg() instead of an arbitrary category of models Mod(). This is necessary because these institutions are used to dene the semantics of dierent set of ASL operators including behavioural operators which we will denote as BASLker languages. The signatures of the specication expressions of BASLker languages are rstorder signatures since the semantics ofsomeofthebehavioural operators are dened using a xed but arbitrary partial -congruence and therefore using the internal structure of rst-order signatures. These languages also include the common operators of another set of operators of ASL which we will denote as ASLker languages. These common operators are base specications (with syntax < >), a sum operator to dene structured specications and an export operator. These restrictions are not needed to dene the semantics of the common operators of ASLker languages and see [2] for the semantics of these operators in a xed but arbitrary semiexact institution. In [2], the semantics of the behavioural operators of BASLker languages is given just for an institution of innitary rst-order logic and for concrete observational equivalences. See also [1] for an abstract categorical framework to relate the semantics of the 2

behavioural operators which is not required for our purposes. In order to dene a certain kind of proof systems for the deduction of sentences from ASLker languages, it is required additionally a normalisation function on specication expressions where the normal forms of specications are dened in terms of the export operator (with syntax < 0 > j ). This normalisation function is also useful to relate the semantics of[3] and[7]. We call any set of operators dened with a normalisation function and including at least the common operators of ASLker languages as ASLnf language. To generalise the semantics of [3] and [7], we dene a new institution which we will refer as behavioural algebraic institution (BAINS) which incorporates additional components to a xed but arbitrary algebraic institution (AIN S) in order to dene the semantics of the behaviour operator of [7] and the normalisation function of the behavioural operators with the semantics of [3]. The structure of the paper is as follows: rst we introduce the abstract concept of algebraic institution and then we present a concrete higher-order algebraic institution. Then, we give the semantics of the behavioural operators and how to relate them in an arbitrary but xed algebraic institution following the ideas of [3] and[2]. Next, we present behavioural algebraic institutions, a normalisation function for the behavioural operators presented previously and a relationship between the semantics of [3] and[7]. Finally, we present concrete equivalence relations and a concrete behavioural algebraic institution using the concrete equivalences and the higher-order algebraic institution presented in the rst section. 2 Semiexact algebraic institutions In this section, we will present the abstract semantic framework to dene the semantics of dierent operators of ASL including the behavioural operators. We will assume predened basic concepts of institutions, which can be found in [4], [5], or in [8]. Denition 2.1 An algebraic institution (AIN S) is an institution which consists of: The category of rst-order relational signatures AlgSig whose objects are rst-order relational signatures and morphisms are signature morphisms. a functor Sen AINS : AlgSig! Set the functor Alg : AlgSig op! Cat where: { for any 2jAlgSigj, Alg() is the category of -algebras { for any morphism :! 0 in AlgSig, Alg() is the reduct functor j : Alg( 0 )! Alg(): 3

for each 2 jalgsigj a satisfaction relation such that j= AINS : jalg()j Sen AINS () { the satisfaction condition holds for any signature morphism :! 0 and for any formula 2 Sen AINS ().This condition is formally dened as: 8A 2jAlg( 0 )j:aj= AINS 0 Sen AINS ()(), Aj j= AINS { an abstract satisfaction condition holds for any formula in Sen AINS (): 8A B 2jAlg()j:A = B ) (A j= AINS, B j= AINS ) Notation and comments: The main dierences between algebraic institutions and the original denition of institutions is that the category of signatures is not an arbitrary category but the category of rst-order relational signatures and that it is added the abstract satisfaction condition which almost all institutions satisfy. We will normally refer to rst-order relational signatures just as relational signatures. For any relational signature =(S Op P r) 2jAlgSigj, the functions Sorts(), Ops() and Prs() will return S, Op and Pr respectively. For any relational signature = (S Op P r), ifpr = we will dene it just by = (S Op) and it will be normally referred just as signature. For any relational signature =(S Op P r) 2jAlgSigj and for a xed but arbitrary S-sorted innite denumerable set of variables XT (X) will denote the -term algebra freely generated byx and P (X) will denote the set of terms of the form p(t 1 ::: tn) where p : s 1 ::: s n 2 Prs() and t 1 2 T s1 (X) ::: t n 2 T sn (X) For any algebra A 2 Alg AINS () and a S-sorted valuation : X! A, I : T (X)! A will denote the unique extension to a -morphism of the valuation, and for the case of p(t 1 ::: t n ) 2 P (X), I (p(t 1 ::: t n )) will hold if and only if (I t 1 ::: I t n ) 2 p A. We will refer to them as the interpretations of terms and predicates associated to. We will assume predened the function S f(x 1 v 1 ) ::: (x n v n )g which given a valuation : X! A and a set of pairs of the form f(x 1 v 1 ) ::: (x n v n )g such that x i 2 X si and v i 2 A si for any i 2 [1::n], itwillreturn the usual update of the valuation with the given set of pairs. If 0, we will normally denote by :,! 0 the obvious embedding morphism and we will normally refer to it as inclusion. 4

Since it is well known that AlgSig has pushouts, the pushout object of any pair of morphisms : 0! 1, 0 : 0! 2 in AlgSig (where 0 1 2 2jAlgSigj) will be denoted in general as PO( : 0! 0 0 : 0! 00 ) and if the pair of morphisms are both inclusions the pushout object will be normally denoted as 1 + 0 2 and the pushout morphisms as (inl : 1! 1 + 0 2 inr : 2! 1 + 0 2 ). In this last case, we can assume in general that either inl or inr are inclusions but not both. We will also drop usually the subscript of the functor Sen AINS subscripts of j= AINS if it can be inferred from the context. We will also refer as and the j= AINS : jalg()j P(Sen AINS ()) the obvious extension of the satisfaction relation to a set of sentences. For any signatures 0 2jAlgSigj and for any signature morphism :! 0, the morphism Sen AINS () :Sen AINS ()! Sen AINS ( 0 ) will be normally denoted just by : Sen AINS ()! Sen AINS ( 0 ). Denition 2.2 An institution INS =(Sign INS Sen INS : Sign INS! Set Mod INS : Sign op INS! Cat <j= INS > 2SignINS ) is semiexact if for any pushout in Sign INS (inl : 1! 0 inr: 2! 0 ) of any pair of morphisms ( : 0! 1 0 : 0! 2 ) and for any models M 1 2 Mod INS ( 1 ) M 2 2 Mod INS ( 2 ) such that M 1 j = M 2 j 0 there exists an unique model M 2 Mod INS ( 0 ) such that Mj inl = M 1 and Mj inr = M2. Notation: This denition is equivalent to the denition of semiexact institution presented in [4]. Proposition 2.3 Any xed but arbitrary algebraic institution AIN S is semiexact. Now we present a concrete higher-order algebraic institution HOL. Before presenting it, we give some basic denitions which will be used in its denition. Denition 2.4 For each =(S Op P r) 2jAlgSigj, the set Types HOL ()is inductively dened by the following set of rules: If s 2 S then s 2 T ypes HOL (). If 1 2 Types HOL () ::: n 2 Types HOL () and n 0 then [ 1 ::: n ] 2 Types HOL (). 5

Notation: The type [] will be normally denoted by Prop. For any signature morphism :! 0,wewillalsodenoteby the usual renaming function between types : T ypes HOL ()! T ypes HOL ( 0 ). Denition 2.5 The semantic function J K A is inductively dened foranytype 2 Types HOL () and for any -algebra A as follows: JsK A = A s J[ 1 ::: n ]K A = P(J 1 K A ::: J n K A ) Notation: The semantics of Prop is a set of two elements: the empty set and the set with the empty tuple. These two elements will be denoted as and tt respectively. Denition 2.6 The set Sen HOL ( X HOL ) for a xed but arbitrary Types HOL ()-sorted innite denumerable set of variables X HOL and for every 2 Types HOL () is inductively dened by the following set of rules: If x 2 X HOL then x 2 Sen HOL ( X HOL ). If f : s 1 ::: s n! s 2 Ops(), t 1 2 T s1 (<X HOL s > s2s ) ::: t n 2 T sn (<X HOL s > s2s ) then f(t 1 ::: t n ) 2 Sen HOL ( X HOL s). If p : s 1 ::: s n 2 Prs(), t 1 2 T s1 (<X HOL s > s2s ) ::: t n 2 T sn (<X HOL s > s2s ) then p(t 1 ::: t n ) 2 Sen HOL ( X HOL Prop) If 1 ::: n 2 T ypes HOL () x 1 2 X HOL 1 ::: x n 2 X HOL n and 2 Sen HOL ( X HOL Prop) then (x 1 : 1 ::: x n : n ): 2 Sen HOL ( X HOL [ 1 ::: n ]). if 1 ::: n 2 T ypes HOL () t2 Sen HOL ( X HOL [ 1 ::: n ]) t 1 2 Sen HOL ( X HOL 1 ) ::: t n 2 Sen HOL ( X HOL n ) 6

then t(t 1 ::: t n ) 2 Sen HOL ( X HOL Prop). if 2 T ypes HOL (), x 2 X HOL and 2 Sen HOL ( X HOL Prop) then 8x : : 2 Sen HOL ( X HOL Prop). if 0 2 Sen HOL ( X Prop) then 0 2 Sen HOL ( X Prop). Notation: We will denote by Terms HOL ( X HOL ) the set [ 2Types HOL() Sen HOL ( X HOL ) For any signature morphism :! 0,wewillalsodenoteby the usual renaming function between terms : Terms HOL ( X HOL )! Terms HOL ( 0 X HOL ) such that for any type 2 Types HOL (), for any higher-order sentence 2 Sen HOL ( X HOL ), () 2 Sen HOL ( 0 X HOL ()). The usual denition of ;equality between terms in Terms HOL ( X HOL ) identifying also -convertible terms will be denoted by= and the usual substitution operation avoiding name clashes will be denoted by tft 0 =xg for any t 2 Terms HOL ( X HOL ) t 0 2 Sen HOL ( X HOL ) and x 2 X HOL. Denition 2.7 The function JtK A for any term t 2 Terms HOL ( X HOL ), for any algebra A 2 Alg(), foranyt ypes HOL ()-sorted valuation which for every 2 Types HOL (), has arity : X HOL! J K A is inductively 7

dened by the structure oft as follows: Jx K A = (x) Jf(t 1 ::: t n )K A = f A (Jt 1 K A ::: Jt n K A ) Jp(t 1 ::: t n )K A = if (Jt 1 K A ::: Jt n K A ) 2 p A then tt else J(x 1 : 1 ::: x n : n ):K A = f(v 1 ::: v n )jv 1 2 J 1 K A ::: v n 2 J n K A JK [f(x1 v 1) ::: (x n v n)g = ttg J(x 1 : 1 ::: x n : n ): (t 1 ::: t n )K A = JK [f(x1 Jt 1K A) ::: (x n Jt nk A)g A J 0 K A = if JK A = tt then JK A else tt J8x : :K A = if 8v 2 J K A :JK [f(x v)g A = tt then tt else Proposition 2.8 The tuple such that: HOL =(AlgSig Sen HOL Alg <j= HOL > 2jAlgSigj ) Sen HOL : AlgSig! Set is a functor dened in the following way: { For each 2jAlgSigj, thesetsen HOL () is dened as Sen HOL () = Sen HOL ( X HOL Prop) { For each signature morphism :! 0 the morphism Sen HOL () :Sen HOL ()! Sen HOL ( 0 ) is the usual renaming function between sentences using :! 0 and it will also be denoted just by. for each 2jAlgSigj, foralla 2jAlg()j, for all 2 Sen HOL (), the satisfaction relation A j= holds if and only if for any T ypes HOL ()- sorted valuation which for every 2 Types HOL (), has arity X HOL! J K A JK A = tt is an algebraic institution. Proof sketch: We have toprove that Sen HOL is a functor (which is straightforward) and we have to prove that the relation <j= HOL > 2jAlgSigj satises: the satisfaction condition which follows by induction on Terms HOL in a similar way as in the rst-order case. the abstract satisfaction condition holds extending the isomorphism between algebras to higher-order types in the obvious way. See [7] for details of the proofs. 8

3 Abstract semantics of dierent operators of ASL In this section, we will present the semantics of dierent operators of ASL including the behavioural operators presented in [3] as we briey explained in the introduction. Denition 3.1 An ASLker specication language with a xed but arbitrary algebraic institution AIN S is a specication language dened with a set of operators including basic specications,and export operator and an operator for structuring specications which we will refer as the sum operator. The syntax of these operators is the following: SP 0 ::= < > SP 1 j SP 1 + SP 2 where the signature = (S Op) 2 jalgsigj and Sen AINS (). Let ASLK be an ASLker specication language and let SPEX(ASLK) be the set of specication expressions of this language. The semantics of an ASLker language ASLK is inductively dened by the functions Signature : SPEX (ASLK)!jAlgSigj, Symbols : SPEX(ASLK)!jAlgSigj and Models : SPEX(ASLK)! Alg(Signature(SP)). The function Signature must return the signature with just the visible symbols of the given specication, whereas the function Symbols must return the signature with the visible and hidden symbols of the given specication. These functions must be inductively dened by specication expressions, and for the cases of the common operators the denition is as follows: Signature(< >) = Symbols(< >) = Models(< >) =fa j A j= AINS g where the signature = (S Op) 2jAlgSigj and jsen AINS ()j: 9

Signature(SPj )= Symbols(SPj )=Symbols(SP) Models(SPj )=faj j A 2 Models(SP)g where SP rangesoverspecication expressions, the signature = (S Op) 2 jalgsigj and Signature(SP) Signature(SP 1 + SP 2 )=Signature(SP 1 )+ Signature(SP 2 ) Symbols(SP 1 + SP 2 )=Symbols(SP 1 )+ Symbols(SP 2 ) Models(SP 1 + SP 2 )= fa j A 2 Alg(Signature(SP 1 )+ Signature(SP 2 )) Aj inl 2 Models(SP 1 ) Aj inr 2 Models(SP 2 )g where the signature = (S Op) 2 jalgsigj, SP 1 SP 2 ranges over specication expressions in SPEX(ASLK), Signature(SP 1 ), Signature(SP 2 ) and the pushouts and Signature(SP 1 )+ Signature(SP 2 ) Symbols(SP 1 )+ Symbols(SP 2 ) are the pushouts of the following diagram: Sym(SP 1 ) Sym(SP1 )+ Sym(SP 2 ) iss is Sign(SP 1 ) inl Sign(SP 1 )+ Sign(SP 2 ) i i 0 inr is Sign(SP2 ) 0 Sym(SP2 ) Since Signature(SP 1 )+ Signature(SP 2 ) is a pushout iss is the unique morphism with arity iss : Signature(SP 1 )+ Signature(SP 2 ),! Symbols(SP 1 )+ Symbols(SP 2 ) and the pushouts can be chosen in such a way that iss is an inclusion. 10

Comment: The functions Signature and Symbols are needed to dene dierent proof systems for ASLker languages. See [?] and [6] for the denition of these proof systems. Denition 3.2 Let ASL be anaslker specication language and Symbols nf a function with arity Symbols nf : SPEX(ASLN)!jAlgSigj. A function nf with arity nf : SPEX(ASLN)! SPEX(ASLN) is a normalisation function if the function nf and the function Symbols nf satisfy the following conditions which we will refer as normalisation conditions: For all SP 2 SPEX(ASLN), nf(sp) =< Symbols nf (SP) > j Signature(SP) for some jsen AINS (Symbols nf (SP))j. For all SP 2 SPEX(ASLN), Symbols(SP) Symbols nf (SP). A 2 Models(nf(SP)), A 2 Models(SP) Comment: If the ASLnf language just contains the common operators of these languages, the function Symbols nf coincides with the functions Symbols, but this will not be the case for example for the common operators of BASLnf specication languages presented in later sections. The function Symbols nf is also needed to dene certain kind of proof systems associated to the ASLnf specications languages presented in next denition. Denition 3.3 An ASLnf specication language is an ASLker specication language whose semantic denition also requires the denition of a normalisation function nf together with the function Symbols nf. The functions nf and Symbols nf must also be dened by induction on specication expressions and 11

the denition for the common operators is as follows: nf(< >) =< > j Symbols nf (< >) = where the signature = (S Op) 2 jalgsigj and jsen AINS ()j nf(sp 1 + SP 2 )=< 0 1 + 0 2 inl( 1 ) [ inr( 2 ) > j 1+ 2 Symbols nf (SP 1 + SP 2 )= 0 1 + 0 2 where nf(sp 1 )=< 0 1 1 > j 1, nf(sp 2 )=< 0 2 2 > j 2 and inl and inr are xed but arbitrary pushouts of i 1 :,! Signature(SP 1 ) and i 2 :,! Signature(SP 2 ) nf(spj )=< 0 > j Symbols nf (SP) = 0 where nf(sp) =< 0 > j 00. Notation: In the following, ASL will range over an ASLker or an ASLnf specication language. Proposition 3.4 The nf function of the previous denition satises the normalisation conditions. Proof sketch: The proof is by an easy induction on specication expressions. Denition 3.5 Let ASL be anaslker or an ASLnf specication language with an arbitrary but xed algebraic institution AIN S. For any specication expression SP 2 SPEX(ASL) and for any sentence 2 Sen(Signature(SP)) the satisfaction relation j= AINS Signature(SP) is dened as follows: SP j= AINS Signature(SP), 8A 2 Models(SP):A j= AINS Signature(SP) Denition 3.6 Assume that 2 jalgsigj. A partial -congruence on a - algebra A (normally denoted by A ) is dened for every sort s in S as a relation which given any -algebra A, returns a symmetric and transitive relation (normally denoted as s A ) with domain s A s A.This relation is compatible with every operation f A : s 1A ::: s na! s A where f 2 Ops(). This means that 12

for every v 1 w 1 2 s 1A, :::, v n w n 2 s na,ifv 1 s1 A w 1, :::, v n sn A w n then f A (v 1 ::: v n ) s A f A (w 1 ::: w n ), and it is also compatible withe every predicate p A : s 1A ::: s na which means that for every v 1 w 1 2 s 1A, :::, v n w n 2 s na,ifv n w n 2 s na,ifv 1 s1 A w 1, :::, v n sn A w n then p A (v 1 ::: v n ), p A (w 1 ::: w n ) Notation: A family of partial -congruences < A > A2Alg() will be denoted just by. Denition 3.7 Assume that 2jAlgSigj, leta be a-algebra and let A be apartial -congruence. The domain of A is dened for any sort s 2 S as follows: Dom s ( A ) = fv j v A s Denition 3.8 Let =(S Op) be a signature, let A be a-algebra and let A beapartial -congruences. For any s 2 S and for any v 2 Dom s ( A ),the class [v] A is dened as follows: [v] A = fv 0 j v 0 A vg Denition 3.9 The quotient of an algebra A 2 jalg()j by a partial -congruence A is dened as: vg s A=A = f[v] A j v 2 s A for every sort s in g f A=A ([v 1 ] A ::: [v n ] A )=[f A (v 1 ::: v n )] A p A=A ([v 1 ] A ::: [v n ] A ), p A=A (v 1 ::: v n ) Denition 3.10 The behaviour of a -algebra A with respect to a partial congruence isdened by its quotient and denoted bybeh A (A) =Dom(A= A ). Denition 3.11 An equivalence relation between algebras of signature is a relation with domain included in jalg()jjalg()j which is reexive, symmetric and transitive, and it will be normally denoted by the symbol. In the following, we dene a list of semantic operators which are used for the denition the semantics of dierent operators for ASL. Denition 3.12 The operators on classes of models Iso, are formally dened as follows: Iso(C) =fa j9b 2 C:A = Bg =, Abs, Beh C== fa= A j A 2 Cg Abs (C) =fa j9b 2 C:A Bg Beh (C) =fa j A= A 2 Cg 13

Denition 3.13 A BASLker specication language is an ASLker specication language including the behaviour, abstract and quotient operators with syntax: SP 0 ::= behaviour SP wrt (behaviour) abstract SP by (abstract) SP= (quotient) and the following semantics: Signature(behaviour SP wrt ) =Signature(SP) Symbols(behaviour SP wrt ) =Symbols(SP) Models(behaviour SP wrt ) =Beh (Models(SP)) Signature(abstract SP by ) =Signature(SP) Symbols(abstract SP by ) =Symbols(SP) Models(abstract SP by ) =Abs (Models(SP)) Signature(SP= ) =Signature(SP) Symbols(SP= ) =Symbols(SP) M odels(sp= ) =Iso(M odels(sp)= ) where and denote xed but arbitrary family of partial Signature(SP)- congruences and equivalence relations respectively. Finally, we relate the semantics of the behavioural operators of BASLker languages, giving rst some properties on classes of -algebras and specications: Denition 3.14 A family of partial -congruences is isomorphism compatible if for all -algebras A and B, ifa = B then A= A = B= B Denition 3.15 An equivalence relation between -algebras is isomorphism protecting if for all -algebras A and B, A = B implies A B. Denition 3.16 A family of partial -congruences is weakly regular if for all A 2jAlg(), A= A is isomorphic to (A= A )=( A=A ). 14

Denition 3.17 An equivalence relation between -algebras () is factorizable by a family of partial -congruences if for all -algebras A and B, A B if and only if A= A = B= B. Proposition 3.18 If SP is closed under isomorphism, is isomorphism compatible and is isomorphism protecting then behaviour SP wrt and abstract SP by and SP= are closed under isomorphism. Proof: Assume that SP is closed under isomorphism, is isomorphism compatible and is isomorphism protecting. What we have toprove for the above operators Op(SP) is that 8A B 2 Alg(Signature(Op(SP))): A 2 Models(Op(SP)) ^ A = B ) B 2 Models(Op(SP)) where the case of the quotient operator is obvious by denition. 1. Op(SP) =behaviour SP wrt Assume that A B 2 Alg(Signature(SP)). By the denition of M odels(behaviour SP wrt ) and since A 2 M odels(behaviour SP wrt ) we know thata= 2 Models(SP) and our goal is equivalenttob= 2 Models(SP). Since is isomorphism compatible and instantiating it with A and B, we have that A = B ) A= A = B=B Since SP is closed under isomorphism and instantiating it with A= A and B= B,we've got that A= A 2 Models(SP) ^ A= A = B=B ) B= B 2 Models(SP) Using that A = B, the instantiation of is isomorphism compatible and the instantiation of SP is closed under isomorphism, we trivially prove our goal. 2. Op(SP) =abstract SP by Assume that A B 2 Alg(Signature(SP)). Since is isomorphism protecting, instantiating this proposition with A and B and using that A = B, wehave thatab. Since A B and using A 2 Models(abstract SP by ), we've got that B 2 M odels(abstract SP by ) Denition 3.19 Let ASL be an ASLker or ASLnf language. Two specications SP 1 SP 2 2 SPEX(ASL) are equal if the following holds: Signature(SP 1 ) = Signature(SP 2 ) 8A 2 Alg(Signature(SP 1 ):A 2 Models(SP 1 ), A 2 Models(SP 2 ) 15

Theorem 3.20 For any specication expression SP with signature (S Op) which is closed under isomorphism, for any family of partial -congruences () which is weakly regular and for any equivalence relation between -algebras () which is factorizable by, the following equivalence between specications holds: abstract SP by = behaviour (SP= ) wrt Proof: Let SP be a specication expression with signature which is closed under isomorphism, let be a weakly regular family of partial -congruences and let be an equivalence relation which is factorizable by. By the denition of equality of specications, we have to prove that: Signature(abstract SP by ) = Signature(behaviour SP= wrt ) which holds since Signature(abstract SP by ) = Signature(behaviour SP= wrt ) =Signature(SP) 8A 2 Alg(Signature(SP)):A 2 Models(abstract SP by ), A 2 Models(behaviour SP= wrt ) Assume that A 2 Alg(Signature(SP)) and assume that A 2 Models(abstract SP by ). By the denition of M odels(abstract SP by ), we have that 9B 2 M odels(sp):a B. Since is factorizable by we have that last proposition is equivalent to 9B 2 Models(SP):A= = B= By the denition of M odels(behaviour SP wrt ) and the denition of Models(SP= ) our goal is equivalent to A= 2 Iso(Models(SP)= ) which is true because by the denition of Iso(Models(SP)= ) our goal can be trivially proven equivalent to 9B 2 Models(SP):A= = B= 4 BASLnf specication languages In this section, we present the inductive denition of the normalisation function of the behavioural operators of BASLker specication languages using a xed but arbitrary institution which extends algebraic institutions with several 16

components such as a xed but arbitrary family of partial congruences, a behavioural satisfaction relation and dierent functions which are used to dene the normal forms of the behavioural operators. We will refer to these institutions as behavioural algebraic institutions. We also generalise the semantics of the behaviour operator with higher-order logic as specication logic of [7] using also behavioural algebraic institutions and we relate this semantics with the semantics of the behaviour operator of BASLker specication languages. In [6], the normalisation function of the behavioural operators with innitary rst-order logic as specication logic is presented. The equivalences of the behaviour and abstract operator are the observational and behavioural equality which are presented in the last section of this chapter. The normalisation functions of the behavioural and quotient operator are dened as the normalisation functions of structured specications, the semantics of which are equivalent to the semantics of the behaviour and quotient operator. In [7], the semantics of the behavioural operator is given in terms of a behavioural satisfaction relation which is denoted as j= where is a xed but arbitrary family of partial congruences and they use higher-order logic as specication logic. They also dene a relativization function which we will refer as brel relating standard and behavioural satisfaction in the following way: 8 2jAlgSigj:8A 2jAlg()j:8 2 Sen HOL (): A j=, A j= brel() The semantics of the behavioural operator is dened using the behavioural satisfaction relation in the following way: Models(behaviour < > wrt ) =fa 2 Alg() j A j= g This operator can only be applied to base specications and because of the relation between behavioural and standard satisfaction, the semantics of the behavioural operator can also be dened as: Models(behaviour < > wrt ) =fa 2 Alg() j A j= brel()g Since they also prove that 8 2jAlgSigj:8A 2jAlg()j:8 2 Sen HOL (): A= j=, A j= the relativization function brel also satises the following condition: 8 2jAlgSigj:8A 2jAlg()j:8 2 Sen HOL (): A= j=, A j= brel() 17

In order to dene the normalisation function of the behavioural operators of BASLker languages for an arbitrary algebraic institution and arbitrary equivalence relations, we have decided to dene them in terms of the normal form of the argument specication of the behavioural operators. The denition of the normal form will use functions on sentences based on the idea of relativization function presented in [7] and above for the behaviour and quotient operator. The normal form of the abstract operator will be dened as the normal form of the behaviour of the quotient of the argument specication of the abstract operator. It follows that this is the normal form of the abstract operator using theorem 3.20 as in [6]. The denition of the relativization functions for the normalisation functions of BASLker languages will need in general to extend the original signature of the specication with extra symbols. For example, an alternative denition of the normalisation function of the behaviour operator for the institution HOL and for an observational equality is based on [6], which, as we mentioned above, proves the equivalence between the semantics of the behaviour operator with the semantics of a structured specication. The symbols of the structured specication extends the symbols of the behavioural operator with, for example, a disjoint copy of the signature of the behaviour operator and symbols to denote the observational equality. A possible denition of the relativization functions uses the same symbols as the symbols of the structured specications. The conditions which must satisfy these relativization functions are more complicated than the condition which satises the relativization function of [7] presented below. Thus, we present in this section an institution which extends algebraic institutions with a behavioural satisfaction relation and two dierent functions on sentences for any inclusion i :,! 0 in AlgSig. These institutions will be referred as behavioural algebraic institution. One of this kind of functions will be denoted by brel[i bi[]] where i is an inclusion with arity i :,! 0 and bi[] is an inclusion with arity bi[] : 0,! 00 and these functions will be used to dene the normalisation functions of the behaviour operator. These functions can also be used to dene the normal form of the generalized semantics of the behaviour operator presented in [7] extended to structured specications. See subsection 5.4 for a concrete example of a denition of the inclusion bi[] and the function brel[i bi[]] in a behavioural algebraic institution with higher-order logic as algebraic institution. The inclusion i of the function brel[i bi[]] used in the normalisation function of the behaviour operator behaviour SP wrt of BASLker specication languages will have arity i : Signature(SP),! Symbols nf (SP) whereas the inclusion of the function brel used in the behaviour operator of [7] willbe the identity i : Symbols nf (SP),! Symbols nf (SP). The other kind of functions will be used to dene the normalisation function of the semantics of the quotient operator and it will be denoted as qrel[i qi[]] where i is an inclusion with arity i :,! 0 and qi[] is an inclusion with arity qi[]: 0! 00. The conditions which must satisfy these two kind of functions are presented 18

in the general denition of behavioural algebraic institutions (BAINS). See next section for proofs that these concrete functions satisfy the general conditions which are dened in BAINS. In this section, we present the denition of BAINS, the alternative and generalised version of the semantics of the behaviour operator of [7] and how to relate it with BASLker languages. Denition 4.1 A behavioural algebraic institution (BAINS) consists of an algebraic institution and additionally the following 6 components: For any signature 2 jalgsigj, a xed but arbitrary family of partial -congruences < A > A2jAlg()j. For each signature 2jAlgSigj abehavioural satisfaction relation j= BIASL : Alg() Sen BIASL (), which is related to the standard satisfaction by the behavioural satisfaction condition. This condition is dened as: 8A 2 Alg():8 2 Sen BIASL ():A= j= BIASL, A j= BIASL For each inclusion i :,! 0 in AlgSig, an inclusion bi[] : 0,! 00 and a function brel[ bi[]] : P(Sen BAINS ( 0 ))!P(Sen BAINS (bi[]( 0 ))) which satises the following conditions which we will refer as the behavioural relativization conditions: (1)8A 0 2jAlg( 0 )j:8 2P(Sen BAINS ( 0 )):8A 2jAlg()j: A 0 j = A= ^A 0 j= ) 9A 00 2jAlg(bi[]( 0 ))j:a 00 j 0 = A 000 ^ A 00 j= brel[i bi[]]() for a given 0 -algebra A 000 is dened as follows: and A 000 j = A A 000 s = A 0 s for any sort s 2 Sorts( 0 ) ; Sorts() f A 000 = f A 0 P A 000 = P A 0 for any sort f 2 Ops( 0 ) ; Ops() for any sort P 2 Pr( 0 ) ; Pr() (2)8A 00 2 Alg(bi[]( 0 )):8 2P(Sen BAINS ( 0 )): A 00 j= brel[i bi[]]() )9A 0 2jAlg( 0 )j:a 0 j = A 00 j =^A 0 j= For each inclusion i :,! 0 in AlgSig, an inclusion qi[] : 0,! 00 and a function qrel[i qi[]] : P(Sen BAINS ( 0 ))!P(Sen BAINS (qi[]( 0 ))) 19

which satises the following conditions which we will refer as the quotient relativization conditions: (1)8A 0 2jAlg( 0 )j:8 2P(Sen BAINS ( 0 )):A 0 j= 0 ) 9A 00 2 Alg(qi[]( 0 )):A 00 j = A 0 j =^A 00 j= qi[]( 0 ) qrel[i qi[]]() (2)8A 00 2 Alg(qi[]( 0 )):8 2P(Sen BAINS ( 0 )): A 00 j= qi[]( 0 ) qrel[i qi[]]() ) 9A 0 2jAlg( 0 )j:a 00 j = A 0 j =^A 0 j= 0 BAINS Remark: If the inclusion i is an identity (i :! ) then the rst behavioural relativization condition can be rewritten to: 8A 2jAlg()j:8 2P(Sen BAINS ()): A=j=,9A 0 2jAlg(bi[]())j:A 0 j = A ^ A 0 j= brel[i bi[]]() Denition 4.2 A BASLnf specication language is an ASLnf specication language over a behavioural algebraic institution BAINS with additionally the behaviour, abstract and quotient operator with the same additional semantic conditions as in BASLker and additionally the following conditions: Let nf(sp) be < 0 > j.then: nf(behaviour SP wrt ) = <Symbols nf (behaviour SP wrt ) brel[i bi[]]() > j Symbols nf (behaviour SP wrt ) = bi[]( 0 ) nf(abstract SP by ) = nf(behaviour SP= wrt ) Symbols nf (abstract SP by ) = Symbols nf (behaviour SP= wrt ) nf(sp= ) =<Symbols nf (SP= ) qrel[i qi[]]() > j Symbols nf (nf(sp= )) = qi[]( 0 ) where brel[i bi[]] : Sen BAINS ( 0 )! Sen BAINS (bi[]( 0 )) is a function which satises the behavioural relativization conditions where i has arity i :,! 0 20

and qrel[i qi[]] : Sen BAINS ( 0 )! Sen BAINS (qi[]( 0 )) is a function which satises the quotient relativization conditions. Theorem 4.3 BASLnf is an ASLnf specication language. Proof: The proof is by induction on specication expressions. Let behop denote any of the three behavioural operators. It is trivial to show that Signature(behop(SP)) = Signature(nf(behop(SP))) and that there exists an inclusion between 0 and Symbols nf (SP) for all the behavioural operators. Besides, we have to show that A 2 behop(sp), A 2 nf(behop(sp)) for every behavioural operator. We assume that nf(sp) =< 0 > j where 0 = Symbols nf (SP) and = Signature(SP) for every argument specication SP of any behavioural operator behop(sp). behaviour nf SP wrt : )) By the denition of the behaviour operator we know that: A 2 Models(behaviour SP wrt ), A=2 Models(SP) By the induction hypotheses, A=2M odels(sp) can be rewritten to: 9A 0 2jAlg( 0 )j:a 0 j = A= ^A 0 j= Let A 0 be the 0 -algebra such that A 0 j = A= ^A 0 j= By the rst behavioural relativization condition of the function brel[i bi[]], we can deduce that 9A 00 2 Alg(bi[]( 0 )):A 00 j = A 000 ^ A 00 j= brel[i bi[]]() where A 000 is dened as: A 000 j = A A 000 s = A 0 s for any sort s 2 Sorts( 0 ) ; Sorts() f A 000 = f A 0 for any sortf 2 Ops( 0 ) ; Ops() P A 000 = P A 0for any sort P 2 Pr( 0 ) ; Pr() And therefore we have that: A 2 Models(< bi[]( 0 ) brel[i bi[ 0 ]]() > j ) 21

and therefore A 2 Models(nf(behaviour SP wrt )). () By the denition of M odels(nf(behaviour SP wrt )) we know that 9A 0 2 Alg(bi[]( 0 )):A 0 j = A ^ A 0 j= 0 brel[i qi[]]() Let A 0 be a 0 -algebra such thata 0 j = A and A 0 j= 0 brel[i qi[]](). By the second condition of the behavioural relativization function we can deduce that 9A 00 2jAlg( 0 )j:a 00 j = A= ^A 00 j= and by the induction hypotheses we have that A 2 M odels(behaviour SP wrt ) SP= nf : )) By the denition of Models(SP= ), we knowthat A 2 Models(SP= ),9A 0 2jAlg()j:A = A 0 =^A 0 2 Models(SP) By the induction hypotheses, we can transform the right hand side part of the previous proposition to: 9A 00 2jAlg( 0 )j:a 00 j = A 0 ^ A = A 0 =^A 00 j= Let A 00 be a 0 -algebra such that A 00 j = A 0 ^ A = A 0 = ^A 00 j= By the condition of quotient relativization function we can deduce that 9A 000 2 Alg(qi[]( 0 )):A 000 j = A 0 =^ and therefore A 2 Models(nf(SP= )) ( ): A 000 j= 0 BAINS qrel[i qi[]]() By the denition of Models(nf(SP= )) we know that 9A 0 2 Alg(qi[]( 0 )):A 0 j = A ^ A 0 j= 0 qrel[i qi[]]() Let A 0 be a 0 -algebra such thata 0 j = A and A 0 j= 0 qrel[i qi[]](). By the second condition of the quotient relativization function we can deduce that 9A 00 2jAlg( 0 )j:a 0 j = A 00 j =^A 00 j= 0 BAINS and by the induction hypotheses we have that A 2 M odels(sp= ). 22

abstract SP by : We know by theorem 4.3.24 that abstract SP by = behaviour SP= wrt. Since we know by induction hypotheses that A 2 Models(nf(SP)), A 2 Models(SP), by the induction condition of the quotient operator we know that SP= = nf(sp= ) and by the induction condition of the behavioural operator we know that behaviour SP= wrt = nf(behaviour SP= wrt ). Thus abstract SP by = nf(abstract SP by ). Finally, we relate the semantics of the behaviour operator of BASLnf languages with the generalisation of the semantics of this operator given in [7]. In the section of further work of [7], general lines are given to dene the semantics of this operator for structured specications. The M odels function is dened using an auxiliar function as follows: Models(behaviour SP wrt ) =Mod (SP) and the auxiliar function Mod, following the underlying ideas of [7], can be dened for the common operators of ASLnf languges and for an arbitrary but xed behavioural institution BAINS as follows: Mod (< >) = fa 2 Alg() j A j= g Mod (SP 1 + SP 2 ) = fa j A 2 Alg(Signature(SP 1 )+ Signature(SP 2 )) Aj inl 2 Mod (SP 1 ) Aj inr 2 Mod (SP 2 )g Mod (SPj ) = faj j A 2 Mod (SP)g Note that the Mod is not dened for the behavioural operator. An alternative possible way to give semantics to the behaviour operator in ASLnf languages which is equivalent to the previous extension under the same 23

syntactic restrictions is as follows: Signature(behaviour nf SP wrt ) =Signature(SP) Symbols(behaviour nf SP wrt ) =Symbols(SP) Models(behaviour nf SP wrt ) = fa 2 Alg( 0 ) j A j= g nf(behaviour nf SP wrt ) = < Symbols nf (behaviour nf SP wrt ) brel[i bi[ 0 ]]() > j Symbols nf (behaviour nf SP wrt ) =bi[ 0 ]( 0 ) where nf(sp) =< 0 > j, brel[i bi[ 0 ]] : P(Sen BAISS ( 0 ))!P(Sen BAISS (bi[ 0 ]( 0 ))) is a function which satises the behavioural relativization condition, and i has arity i : 0,! 0. One way to see that this alternative semantics is equivalent to the one presented in [7] is to dene the ASLnf language ASLN with just the common operators of ASLnf languages and prove the following proposition for any SP 2 SPEX(ASLN): 8A 2 Models(SP): A 2 Mod (SP), A 2 Models(behaviour nf SP wrt ) which follows trivially by the behavioural relativization conditions. Finally, we can relate our alternative semantics with the semantics of the behaviour operator of BASLker languages with the following theorem: Theorem 4.4 Let BAINS be abehavioural algebraic institution. Let BSPL 1 be abaslnf specication language over BAINS and let BSPL 2 betheaslnf language with additionally the behaviour operator with the alternative semantics presented below and the same institution BAINS. Let SP 1 beaspecication expression of BSPL 1 and let SP 2 beaspecication expression of BSPL 2 such that A 2 Models(SP 1 ), A 2 Models(SP 2 ): nf(sp 1 )=nf(sp 2 )=< 0 > j 24

Under these assumptions the following holds: Proof: A 2 Models(behaviour nf SP 2 wrt ) ) A 2 Models(behaviour SP 1 wrt ) Assume that A 2 Models(behaviour nf SP 2 wrt ). By the denition of the semantics of this behavioural operator, the previous proposition is equivalent to 9A 0 2 Alg(bi[ 0 ]( 0 )):A 0 j = A ^ A 0 j= brel[i bi[ 0 ]]() By the behavioural relativization condition we can deduce that A 0 =j= and by the behavioural satisfaction condition we can deduce that A 0 j=. Since A 0 j = A we have thata 2 Models(behaviour SP 1 wrt ). Note that the left implication of the propositions which relate the class of models of the behavioural operators doesn't seem to hold since from our point of view it is necessary that an equivalent or more general condition to the following one 8A 00 2jAlg( 00 )j:8 2 Sen BAINS ( 00 ): 9A 2jAlg()j:A 00 j = A= ^ A 00 j= 00 BAINS ) 9A 0 2jAlg( 0 )j:a 00 j 0 = A 0 = ^ A 00 j= 00 BAINS must be satised for any pair of inclusions i :,! 0 i: 0,! 00 ofaxedbut arbitrary behavioural algebraic institutions and we have not succeeded to nd it for example for the institution of this kind with a higher-order logic presented in the next section. 5 BHOL: A behavioural algebraic institution In this section, we present a behavioural algebraic institution for HOL with a concrete family of partial congruence: the observational equality. First, we present the denition of the behavioural satisfaction relation for an arbitrary but xed family of partial congruences as in [7]. Then, we dene the observational equality for rst-order relational signatures which will be referred to as relational observational equality and for rst-order signatures which will be referred to as observational equality, but in both cases they will be denoted by the same symbol.the formulation of the observational equality is the same as in [3] or [6]. Next, we dene the relativisation functions for the institution HOL and nally we present the behavioural algebraic institution BHOL. 25

5.1 The behavioural satisfaction relation In order to dene the behavioural satisfaction relation for the algebraic institution HOL it is necessary to extend the given xed but arbitrary family of partial -congruences to higher-order types. We present this extension just for the general case because the instantiation to the relational observational equality isobvious. Denition 5.1 Let be a family of partial -congruences. The relation A [1 ::: n] : J [ 1 ::: n ]K A J [ 1 ::: n ]K A for any 1 2 Types HOL () ::: n 2 T ypes HOL () and for any A 2jAlg()j is dened as follows: p A [1 ::: n] p 0, 8v 1 v 0 1 2 J 1 K A :::::8v n v 0 n 2 J n K A : (v 1 ::: v n ) 2 p, (v 0 1 ::: v 0 n) 2 p 0 Denition 5.2 For any relational signature 2jAlgSigj, for any sort s 2 Sorts(), for any -algebra A, a value v 2 A s respects a partial -congruence if v A v. A predicate p 2 J [ 1 ::: n ]K A respects A [1 ::: n] for any 1 2 Types HOL () ::: n 2 Types HOL () if the following condition holds: 8v 1 v 0 1 2 J 1 K A :::::8v n v 0 n 2 J n K A : (v 1 ::: v n ) 2 p, (v 0 1 ::: v0 n) 2 p Proposition 5.3 A is a partial equivalence relation for any 2 T ypes HOL () Proof: See [7]. Denition 5.4 The semantic function J K A is inductively dened foranytype 2 Types HOL () and for any -algebra A as follows: JsK A = f v 2 A s j v respects g J[ 1 ::: n ]K = A fp 2P(J 1K A ::: J nk A j p respects g Notation: The semantics of Prop is a set of two elements: the empty set and the set with the empty tuple. These two elements will be denoted as and tt respectively. Denition 5.5 The function JtK A for any term t 2 Terms HOL( X HOL ), for any algebra A 2 Alg(), foranyt ypes HOL ()-sorted valuation which for every 2 Types HOL (), has arity : X HOL! J K A is inductively 26

dened by the structure oft 2 Terms( X) as follows: Jx K = A (x) Jf(t 1 ::: t n )K = A f A(Jt 1 K A ::: Jt nk ) A Jp(t 1 ::: t n )K = A if (Jt 1K A ::: Jt nk ) 2 A p A then tt else J(x 1 : 1 ::: x n : n ):K = A f(v 1 ::: v n )jv 1 2 J 1 K A ::: v n 2 J n K A JK [f(x 1 v 1) ::: (x n v n)g = ttg J(x 1 : 1 ::: x n : n ): (t 1 ::: t n )K A = JK [f(x 1 Jt 1K A ) ::: (xn JtnK A )g A J 0 K A = if JK A = tt then JK A else tt J8x : :K = A if 8v 2 J K A :JK = tt then tt else [f(x v)g A Denition 5.6 For each 2 jalgsigj, for all A 2 jalg()j, for all 2 Sen HOL (), the satisfaction relation A j= holds if and only if for any T ypes HOL ()-sorted valuation which for every 2 T ypes HOL (), has arity : X HOL! J K A, JK A = tt 5.2 The relational observational equality In this subsection, we dene the relational observational equality with relational signatures giving also a relational behavioural equality which is factorizable by the relational observational equality. Denition 5.7 Let be a relational signature in jalgsigj, let In and Obs be two set of sorts s.t. In Obs Sorts() and let X In beanin-sorted set of variables. The Sorts()-sorted set of contexts PC Obs (X In ) is dened foreach sort s as the set of terms P (X In [ z s ) such that z s is a free variable which satises the condition fz s g\x s =. This set is also denoted aspc Obs (X In z s ) for every sort s 2 S. Denition 5.8 Let be arelational signature injalgsigj, let Obs and In be two set of sorts s.t. Obs In Sorts() and In is sensible wrt.let A be a -algebra. The relational observational equality ( Obs In A ) is formally dened 27

for each sort s and for each v w 2 A[X In ] s as follows: v Obs In s A w, 8 8c 2 C Obs (X In z s ):8 2 X In! A[X In ]: I [f(zs v)g(c) = I [f(zs w)g(c) ^ >< 8pc 2 PC Obs (X In z s ):8 2 X In! A[X In ]: I [f(zs v)g(pc), I [f(zs w)g(pc) ifs 2 S ; Obs >: v = w ifs 2 Obs Notation: To denote an observational equality Obs In A we will normally drop the subscript denoting an algebra A if it can be inferred from the context. Proposition 5.9 Let be a relational signature in jalgsigj, let Obs and In be two set of sorts s.t. Obs In Sorts(). The relational observational equality ( Obs In )isafamilyofpartial -congruences. Proof: In the same way as in [3]. Proposition 5.10 Let be arelational signature injalgsigj, let Obs and In be two set of sorts s.t. Obs In Sorts() and let A be a-algebra. The relational observational equality ( Obs In A )isweakly regular. Proof: In a similar way asin[3]. Denition 5.11 Let be a signature,let In and Obs be two sets of sorts s.t. In Obs Sorts() and let X In beanin-sorted set of variables. The relational behavioural equality between -algebras Obs In is formally dened as: A Obs In B, 8t r 2 T (X In ):8 2 X In! A:8 2 X In! B: I (t) =I (r), I (t) =I (r) ^ 8p p 0 2 P (X In ):8 2 X In! A:8 2 X In! B: I (p), I (p 0 ), I (p), I (p 0 ) 28

Proposition 5.12 Let be a signature and let In and Obs be two sets of sorts s.t. In Obs Sorts(). Obs In is an equivalence relation. Proof: In a very similar way asin[3]. Proposition 5.13 Let be a signature, let In and Obs be two sets of sorts s.t. In Obs Sorts() and let A be a-algebra. Obs In is factorizable by Obs In A. Proof: In a similar way asin[3]. 5.3 The relativization functions One possible way to dene the functions which have to satisfy the behavioural relativization conditions is to dene for any inclusion i :,! 0, the inclusion bihol[]: 0,! bihol[]( 0 ) with a disjoint copyof 0 which we will denote as Copy 0 ( 0 ) and to dene the function brelhol[i bihol[]] : P(Sen BHOL ( 0 ))!P(Sen BHOL (bihol[]( 0 ))) in such away that if a bihol[]( 0 )-algebra A 00 satises the set of sentences brelhol[i bihol[]](), then A 00 must also satisfy the following condition: A 00 j Copy 0 () = A 00 j = Obs In ^ A 00 j Copy 0 ( 0 ) j= Copy 0 () This can be achieved by dening the set of sentences brelhol[i bihol[]]() as the union of Copy 0 () with an axiomatization in higher-order logic of the observational equality Obs In and an axiomatization of a pseudo epimorphism between A 00 j and A 00 j Copy 0 (). This axiomatization requires extra symbols to denote the observational equality and the pseudo epimorphism. The axiomatization of the observational equality is based on [7] and the axiomatization of the pseudo epimorphism is based on [6]. For example, for the signature of a base specication Container with sorts Container Elem Nat and Bool, operations : Container, insert : Elem Container! Container, union : Container Container! Container,::: which will be denoted by Contsign and set of sentences Contax including 8s : Container:union s = s 8s s 0 : Container:(union (insert e s) s 0 )(insert e (union s s 0 )) bihol[contsign] would be dened as: bihol[contsign](contsign) = Contsign [ Copy(Contsign)[ f s : s s j s 2 Sorts(Contsign)g [f s : s! Copy(s) j s 2 Sorts(Contsign)g 29