-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathUserGuideCommonLogic.tex
1660 lines (1383 loc) · 74.5 KB
/
UserGuideCommonLogic.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass{article}
\setlength{\textwidth}{16cm}
\setlength{\topmargin}{-1cm}
\setlength{\evensidemargin}{0cm}
\setlength{\oddsidemargin}{0cm}
\setlength{\textheight}{22.5cm}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{charter} % very clean and readable font
\usepackage{courier}
\usepackage{unicode-chars}
\usepackage[british]{babel}
\usepackage[hide]{ed} % set to hide for producing a released version
\usepackage{alltt}
\usepackage{casl}
\usepackage{xspace}
\usepackage{color}
\usepackage{url}
\usepackage{threeparttable,hhline}
\usepackage{tabularx}
\usepackage{paralist}
\usepackage{lstsemantic} % loads listings and defines some languages
\lstset{basicstyle=\ttfamily,columns=fixed}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage[pdfborder=0 0 0,bookmarks,
pdfauthor={Till Mossakowski, Christian Maeder, Mihai Codescu, Eugen Kuksa, Christoph Lange},
pdftitle={Hets for Common Logic Users}]
{hyperref} %% do not load more packages after this line!!
\input{xy}
\xyoption{v2}
\newcommand{\QUERY}[1]%{}
{\marginpar{\raggedright\hspace{0pt}\small #1\\~}}
\newcommand{\eat}[1]{}
\newenvironment{EXAMPLE}[1][] {\par#1\begin{EXAMPLEFORMAT}\begin{ITEMS}}
{\end{ITEMS}\end{EXAMPLEFORMAT}\par}
\newcommand{\IEXT}[1] {\\#1\I}
\newcommand{\IEND} {\I\END}
\newenvironment{EXAMPLEFORMAT} {}{}
%% Added by MB to have some extra vertical space after the ``main'' examples
%% following the points (and some others in the text):
\newenvironment{BIGEXAMPLE} {\begin{EXAMPLE}} {\end{EXAMPLE}\medskip}
\newenvironment{DETAILS}[1][] {#1\begin{DETAILSFORMAT}}{\end{DETAILSFORMAT}}
\newenvironment{DETAILSFORMAT} {}{}
\newenvironment{META}[1][] {#1\begin{METAFORMAT}}{\end{METAFORMAT}}
\newenvironment{METAFORMAT} {\medskip\vrule\hspace{1ex}\vrule\hspace{1ex}%
\begin{minipage}{0.9\textwidth}\it}
{\end{minipage}\par\medskip}
\newcommand{\SLIDESMALL} {}
\newcommand{\SLIDESONLY}[1] {}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% SIMULATING SMALL-CAPS FOR BOLD, EMPH
\newcommand{\normalTEXTSC}[2]{{#1\scriptsize#2}}
%% NOT \newcommand{\normalTEXTSC}[2]{{\normalsize#1\scriptsize#2}}
\newcommand{\largeTEXTSC} [2]{{\large #1\small #2}}
\newcommand{\LargeTEXTSC} [2]{{\Large #1\normalsize#2}}
\newcommand{\LARGETEXTSC} [2]{{\LARGE #1\large #2}}
\newcommand{\hugeTEXTSC} [2]{{\huge #1\Large #2}}
\newcommand{\HugeTEXTSC} [2]{{\Huge #1\LARGE #2}}
%\newcommand {\CASL}{\normalTEXTSC{C}{ASL}\xspace}
\newcommand{\largeCASL} {\largeTEXTSC{C}{ASL}\xspace}
\newcommand{\LargeCASL} {\LargeTEXTSC{C}{ASL}\xspace}
\newcommand{\LARGECASL} {\LARGETEXTSC{C}{ASL}\xspace}
\newcommand {\hugeCASL} {\hugeTEXTSC{C}{ASL}\xspace}
\newcommand {\HugeCASL} {\HugeTEXTSC{C}{ASL}\xspace}
%\newcommand {\CoFI}{CoFI\xspace}
\newcommand {\MAYA}{\normalTEXTSC{M}{AYA}\xspace}
\newcommand{\largeMAYA} {\largeTEXTSC{M}{AYA}\xspace}
\newcommand {\Hets}{\normalTEXTSC{H}{ETS}\xspace}
\newcommand{\largeHets} {\largeTEXTSC{H}{ETS}\xspace}
\newcommand{\LARGEHets} {\LARGETEXTSC{H}{ETS}\xspace}
\newcommand {\Cats}{\normalTEXTSC{C}{ATS}\xspace}
\newcommand{\largeCats} {\largeTEXTSC{C}{ATS}\xspace}
\newcommand {\ELAN}{\normalTEXTSC{E}{LAN}\xspace}
\newcommand{\largeELAN} {\largeTEXTSC{E}{LAN}\xspace}
\newcommand {\HOL}{\normalTEXTSC{H}{OL}\xspace}
\newcommand{\largeHOL} {\largeTEXTSC{H}{OL}\xspace}
\newcommand {\Isabelle}{\normalTEXTSC{I}{SABELLE}\xspace}
\newcommand{\largeIsabelle} {\largeTEXTSC{I}{SABELLE}\xspace}
\newcommand {\SPASS}{\normalTEXTSC{S}{PASS}\xspace}
\newcommand {\Horn}{\normalTEXTSC{H}{ORN}}
%%%%% Klaus macros
\newcommand{\CASLDL}{\textmd{\textsc{Casl-DL}}\xspace}
\newcommand{\Dolce}{\textmd{\textsc{Dolce}}\xspace}
\newcommand{\SHOIN}{$\mathcal{SHOIN}$(\textbf{D})\xspace}
\newcommand{\SROIQ}{$\mathcal{SROIQ}$(\textbf{D})\xspace}
\newcommand{\DL}{DL\xspace}
%%%%% end of Klaus macros
%% Use \ELAN-\CASL, \HOL-\CASL, \Isabelle/\HOL
\newcommand{\LCF}{LCF\xspace}
\newcommand{\ASF}{ASF\xspace}
%%\newcommand {\ASF}{\normalTEXTSC{A}{SF}\xspace}
%%\newcommand{\largeASF} {\largeTEXTSC{A}{SF}\xspace}
\newcommand{\SDF}{SDF\xspace}
%%\newcommand {\SDF}{\normalTEXTSC{S}{DF}\xspace}
%%\newcommand{\largeSDF} {\largeTEXTSC{S}{DF}\xspace}
\newcommand {\ASFSDF}{\normalTEXTSC{A}{SF}+\normalTEXTSC{S}{DF}\xspace}
\newcommand{\largeASFSDF} {\largeTEXTSC{A}{SF}+\largeTEXTSC{S}{DF}\xspace}
\newcommand {\HasCASL}{\normalTEXTSC{H}{AS}\normalTEXTSC{C}{ASL}\xspace}
\newcommand{\largeHasCASL} {\largeTEXTSC{H}{AS}\largeTEXTSC{C}{ASL}\xspace}
%% Do NOT use \ASF+\SDF (it gives a superfluous space in the middle)
\newcommand{\CCC}{CCC\xspace}
\newcommand{\CoCASL}{\normalTEXTSC{C}{O}\normalTEXTSC{C}{ASL}\xspace}
\newcommand{\CspCASL}{\normalTEXTSC{C}{SP}-\normalTEXTSC{C}{ASL}\xspace}
\newcommand{\Csp}{\normalTEXTSC{C}{SP}\xspace}
\newcommand{\CcsCASL}{CCS-\normalTEXTSC{C}{ASL}\xspace}
\newcommand{\CASLLtl}{\normalTEXTSC{C}{ASL}-\normalTEXTSC{L}{TL}\xspace}
\newcommand{\CASLChart}{\normalTEXTSC{C}{ASL}-\normalTEXTSC{C}{HART}\xspace}
\newcommand{\SBCASL}{\normalTEXTSC{S}{B}-\normalTEXTSC{C}{ASL}\xspace}
\newcommand{\HetCASL}{\normalTEXTSC{H}{ET}\normalTEXTSC{C}{ASL}\xspace}
\newcommand{\ModalCASL}{\normalTEXTSC{M}{odal}\normalTEXTSC{C}{ASL}\xspace}
\begin{document}
\title{{\bf \protect{\LARGEHets} for Common Logic Users}\\
-- Version 0.99 --}
\author{Till Mossakowski, Christian Maeder,
Mihai Codescu, Eugen Kuksa, Christoph Lange\\[1em]
DFKI GmbH, Bremen, Germany.\\[1em]
Comments to: \href{mailto:hets-users@informatik.uni-bremen.de}{hets-users@informatik.uni-bremen.de} \\
(the latter needs subscription to the mailing list)
}
\maketitle
\setcounter{tocdepth}{1}
\tableofcontents
\section{Introduction}
Common Logic (CL) is an ISO standard published as ``ISO/IEC 24707:2007
--- Information technology — Common Logic (CL): a framework for a family
of logic-based languages'' \cite{CommonLogic:oldfashioned}. CL is based on untyped first-order
logic, but extends first-order logic in two ways: \begin{inparaenum}[(1)]\item any term can be
used as function or predicate, and \item sequence markers allow
for talking about sequences of individuals directly\end{inparaenum}.\footnote
{Strictly speaking, only the second feature goes beyond first-order
logic.}
The Heterogeneous Tool Set (\Hets) is an open source software providing
several kinds of tool support for Common Logic:
\begin{itemize}
\item a parser for the Common Logic Interchange Format (CLIF) --- CLIF
is a Lisp-like syntax for CL;
\item a connection of CL to well-known first-order theorem provers
like SPASS, darwin and Vampire, such that logical consequences
of CL theories can be proved;
\item a connection of CL to the higher-order provers Isabelle/HOL
and Leo-II in order to perform induction proofs in theories
involving sequence markers;
\item a connection to first-order model finders like darwin that
allow one to find models for CL theories;
\item support for proving interpretations between CL theories to be correct;
\item a translation that eliminates the use of CL modules\footnote{Actually, we are using a revised semantics for modules, as proposed
recently in~\cite{NH:CommonLogicHoratio}.}. Since the semantics of CL modules
is special to CL, this elimination of modules is necessary before
sending CL theories to a standard first-order prover;
\item a translation of the Web Ontology Language OWL to CL;
\item a translation of propositional logic to CL.
\end{itemize}
This guide will introduce you to these functionalities of \Hets.
For the full functionalities of \Hets, see the \Hets user guide
\cite{HetsUserGuide}.
\section{The Heterogeneous Tool Set and Its Input Languages}
The central idea of the Heterogeneous Tool Set (\protect\Hets) is to
provide a general framework for formal methods integration and proof
management. One can think of \Hets acting like a motherboard where
different expansion cards can be plugged in, the expansion cards here
being individual logics (with their analysis and proof tools) as well
as logic translations. The \Hets motherboard already has plugged in
a number of expansion cards (e.g., the theorem provers Isabelle, SPASS
and more, as well as model finders). Hence, a variety of tools is
available, without the need to hard-wire each tool to the logic at
hand.
\begin{figure}
\begin{center}
\includegraphics[width=0.45\textwidth]{hets-motherboard}
\end{center}
\caption{The \Hets motherboard and some expansion cards}
\end{figure}
\Hets consists of logic-specific tools for the parsing and static
analysis of the different involved logics, as well as a
logic-independent parsing and static analysis tool for structured and
architectural specifications and libraries. The latter of course needs
to call the logic-specific tools whenever a basic specification is
encountered.
\Hets is based on the theory of institutions \cite{GoguenBurstall92},
which formalise the notion of a logic. The theory behind \Hets is laid
out in \cite{Habil}. A short overview of \Hets is given in
\cite{MossakowskiEA06,MossakowskiEtAl07b}.
\Hets supports a number of input languages directly, such as Common
Logic and OWL2 and \HetCASL. They will be described in the next
sections.
\subsection{Common Logic and the Common Logic Interchange Format (CLIF)}
CLIF is specified in Annex A of the Common Logic standard
\cite{CommonLogic:oldfashioned}. \Hets can directly read in files in
CLIF syntax, and also recursively reads in any imported files (cf.\ Sect.~\ref{relationsInCL} for the syntax).
Common Logic itself does not support the specification of logical
consequences, nor relative theory interpretations, nor other
features that speak about structuring and comparing logical
theories. Michael Gr\"uninger has suggested certain special annotations comments for
this purpose, which are supported by \Hets, see
Sect.~\ref{relationsInCL}. Alternatively, CLIF syntax can be used
for specifications within \HetCASL files, or CLIF files can be referred to within \HetCASL
files. \HetCASL is a structuring language supporting relative theory
interpretations and other things, see Sect.~\ref{HetCASL} below.
\subsection{OWL2}
OWL2 is a W3C standard \cite{w3c:owl2-overview}.
\Hets can directly read in OWL2 files in all syntaxes (called ``serialisations'') that the OWL API supports \cite{OWLAPI:URL}, including
the native OWL XML syntax \cite{w3c:owl2-xml}, the human-readable
Manchester syntax \cite{w3c:owl2-manchester}, as well as RDF \cite{w3c:owl2-RDF-mapping}. The RDF data model has multiple possible syntaxes itself, including RDF/XML \cite{w3c04:rdf-xml} and the text-oriented Turtle syntax \cite{w3c:turtle}.
Since OWL2 does not support relative theory interpretations and other
structuring features, such things can only be expressed in \HetCASL
files. For this purpose, OWL2 Manchester syntax can be used within
\HetCASL files, or OWL2 files can be referred to within \HetCASL files.
\subsection{HetCASL}
\label{HetCASL}
For heterogeneous specification, \Hets offers the Heterogeneous
language \HetCASL. \HetCASL is not so much a logic, but a meta
language that can express relations of theories written in different
logics, like logical consequences, relative interpretations of
theories, conservative extensions, translations of theories
along logic translations, etc.
\HetCASL generalises the structuring
constructs of
\CASL (Common Algebraic Specification Language \cite{CASL-UM,CASL/RefManual}) to arbitrary logics
(if they are formalised as institutions and plugged into
the \Hets motherboard), as well as to heterogeneous
combinations of specifications written in different logics.
See
Fig.~\ref{fig:lang} for a simple subset of the
\HetCASL syntax, where \emph{basic specifications} are unstructured
specifications or modules written in a specific logic. The graph of
currently supported logics and logic translations (the latter are also
called comorphisms) is shown in Fig.~\ref{fig:LogicGraph}, and the
degree of support by \Hets in Fig.~\ref{fig:Languages}.
% We give an ad hoc listing language definition of EBNF here. This should probably go into lstlang0.sty.
\begin{lstlisting}[float,label={fig:lang},caption={Syntax of a simple subset of the heterogeneous specification language. \texttt{BASIC-SPEC} and \texttt{SYMBOL-MAP} have a logic specific syntax, while \texttt{ID} stands for some form of identifiers.},basicstyle=\ttfamily\small,morecomment={[l]{\%\%\ }},morekeywords={then,with,logic,spec,end,view,to},escapeinside={<>}]
SPEC ::= BASIC-SPEC %% logic-specific syntax, e.g. CLIF or Manchester syntax
| SPEC then SPEC %% extension of a spec with new symbols and axioms
| SPEC then %implies SPEC %% annotation: extension is logically implied
| SPEC with SYMBOL-MAP %% renaming of SPEC along SYMBOL-MAP
| SPEC with logic ID %% translation of SPEC to a different logic
DEFINITION ::= logic ID %% select a new logic for subsequent items
| spec ID = SPEC end %% give the name ID to SPEC
| view ID : SPEC to SPEC = SYMBOL-MAP end
%% interpretation of theories
| view ID : SPEC to SPEC = logic ID end
%% dto., but across different logics
LIBRARY = DEFINITION*
\end{lstlisting}
With \emph{heterogeneous structured specifications}, it is possible to
combine and rename specifications, hide parts thereof, and also
translate them to other logics. \emph{Architectural specifications}
prescribe the structure of implementations. \emph{Specification
libraries} are collections of named structured and architectural
specifications. \emph{Refinements} express the fact the a specification
is becoming more specific. All this is supported by \HetCASL.
For details, see \cite{Mossakowski04,Habil,CASL/RefManual}.
\section{Logics supported by Hets}
\Hets supports a variety of different logics. The following are most important for use with Common Logic:
\begin{figure}
\begin{center}
\includegraphics[width=.9\textwidth]{CLgraph}
\end{center}
\caption{Graph of logics related to Common Logic that are currently supported by \Hets.}
\label{fig:LogicGraph}
\end{figure}
\begin{description}
\item[Common Logic] is an ISO standard published as ``ISO/IEC 24707:2007 - Information technology — Common Logic (CL): a framework for a family of logic-based languages'' \cite{CommonLogic:oldfashioned}. It is based on first-order logic, but extends first-order
logic in several ways. The Common Logic
Interchange Format (CLIF) provides a Lisp-like syntax for Common
Logic. \Hets currently only supports parsing CLIF. If you need
other dialects, send us a message and we will add them.
\item[OWL2] is the Web Ontology Language recommended by the
World Wide Web Consortium (W3C, \url{http://www.w3c.org}); see \cite{w3c:owl2-overview}. It is
used for knowledge representation on the Semantic Web
\cite{berners:2001:SWeb}.
Hets calls an external OWL2 parser
written in Java to obtain the abstract syntax for an OWL file and its
imports. The Java parser also does a first analysis classifying
the OWL ontology into the sublanguages OWL Full (all of OWL, under the RDF semantics, undecidable \cite{w3c:owl2-rdf-based-semantics}), OWL DL (all of OWL, under the direct semantics \cite{w3c:owl2-direct-semantics}), and the so-called OWL Profiles (i.e.\ proper sublanguages) OWL EL, OWL QL, and OWL RL \cite{w3c:owl2-profiles}.
Hets supports all except OWL Full.
The
structuring of the OWL imports is displayed as a Development Graph.
\item[Propositional] is classical propositional logic, with
the zChaff SAT solver \cite{Herbstritt03} connected to it.
\item[SoftFOL] \cite{LuettichEA06a} offers several automated theorem
proving (ATP) systems for first-order logic with equality: \begin{inparaenum}[(1)]\item \SPASS
\cite{WeidenbachEtAl02}, see \url{http://www.spass-prover.org};
\item Darwin \cite{Baumgartner:etal:Darwin:IJAIT:2005}, see \url{http://combination.cs.uiowa.edu/Darwin};
\item Vampire \cite{RiazanovV02} see \url{http://www.vprover.org};
\item Eprover \cite{Schulz:AICOM-2002}, see \url{http://www.eprover.org};
\item E-KRHyper \cite{DBLP:conf/cade/PelzerW07}, see \url{http://www.uni-koblenz.de/~bpelzer/ekrhyper}, and
\item
MathServe Broker\footnote{which chooses an appropriate ATP upon a
classification of the FOL problem} \cite{ZimmerAutexier06}.
\end{inparaenum}
These together comprise some of the most advanced theorem provers
for first-order logic. SoftFOL is essentially the first-order
interchange language TPTP \cite{DBLP:conf/lpar/Sutcliffe10},
see \url{http://www.tptp.org}.
\item[CASL] extends many sorted first-order logic with partial
functions and subsorting. It also provides induction sentences,
expressing the (free) generation of datatypes.
For more details on \CASL see \cite{CASL/RefManual,CASL-UM}.
For Common Logic, \CASL can be seen as kind of transitional hub, linking
Common Logic to other logics, most importantly SoftFOL.
\item[\Isabelle] \cite{NipPauWen02} is the logic of the interactive
theorem prover Isabelle for higher-order logic.
\item[THF] is an interchange language for higher-order logic
\cite{DBLP:conf/cade/BenzmullerRS08}, similar to what TPTP
is for first-order logic. \Hets connects THF to the automated
higher-order prover Leo-II.
\item[HasCASL] is a higher order extension of \CASL allowing
polymorphic datatypes and functions. It is closely related to the
programming language Haskell and allows program constructs being
embedded in the specification. For Common Logic, \HasCASL
is mainly interesting as a transitional hub for paths
to the provers Isabelle and Leo-II.
\item[RelScheme] is a logic for relational databases \cite{DBLP:journals/ao/SchorlemmerK08}.
\end{description}
Various logics are supported with proof tools. Proof support for the
other logics can be obtained by using logic translations to a
prover-supported logic. For Common Logic, the paths to SoftFOL
are particularly interesting, because this offers an interface
to standard first-order provers. Moreover, the paths to THF
and Isabelle offer interfaces to higher-order provers, which
is essential if you want to prove inductive theorems about
sequences.
An introduction to \CASL can be found in the \CASL User Manual
\cite{CASL-UM}; the detailed language reference is given in
the \CASL Reference Manual \cite{CASL/RefManual}. These documents
explain both the \CASL logic and language of basic specifications as
well as the logic-independent constructs for structured and
architectural specifications. The corresponding document explaining the
\HetCASL language constructs for \emph{heterogeneous} structured specifications
is the \HetCASL language summary \cite{Mossakowski04}; a formal
semantics as well as a user manual with more examples are in preparation.
Some of \HetCASL's heterogeneous constructs will be illustrated
in Sect.~\ref{sec:HetSpec} below.\\
For further information on logics supported by \Hets, see the \Hets user guide
\cite{HetsUserGuide}.
\section{Logic translations supported by Hets}
\label{comorphisms}
Logic translations (formalised as institution comorphisms
\cite{GoguenRosu02}) translate from a given source logic to a given
target logic. More precisely, one and the same logic translation
may have several source and target \emph{sub}logics: for
each source sublogic, the corresponding sublogic of the target
logic is indicated.
In more detail, the following list of logic translations involving Common Logic
is currently supported by \Hets:\\
\noindent\begin{tabularx}{\textwidth}{|l|X|}\hline
CommonLogic2CASL & Coding Common Logic to \CASL. Module elimination
is applied before translating to \CASL. \\\hline
CommonLogic2CASLCompact & Coding compact Common Logic to \CASL.
Compact Common Logic is a sublogic of Common Logic
where no sequence markers occur. Module elimination
is applied before translating to \CASL. We recommend
using this comorphism whenever possible because it
results in simpler specifications.\\\hline
CommonLogicModuleElimination & Eliminating modules from a Common Logic theory
resulting in an equivalent specification without
modules. \\\hline
OWL22CommonLogic & Inclusion of OWL2 description logic \\\hline
Prop2CommonLogic & Inclusion of propositional logic \\\hline
SoftFOL2CommonLogic & Inclusion of first order logic \\\hline
CASL2SoftFOL & Coding of CASL.SuleCFOL=E to SoftFOL \cite{LuettichEA06a},
mapping types to soft types \\\hline
CASL2SoftFOLInduction & Same as CASL2SoftFOL but with instances of induction
axioms for all proof goals \\\hline
CASL2SoftFOLInduction2 & Similar to CASL2SoftFOLInduction but replaces goals with induction premises \\\hline
CASL2Propositional & Translation of propositional FOL \\\hline
\end{tabularx}\\
Those comorphisms can be chained, e.g., for theorem proving, you can translate
Common Logic to SoftFOL with \texttt{CommonLogic2CASLCompact;CASL2SoftFOLInduction}
since there is no prover for Common Logic or \CASL.
For further information on logic translations supported by \Hets, see the \Hets
user guide \cite{HetsUserGuide}.
\section{Getting started}
The latest \Hets version can be obtained from the
\Hets tools home page
\begin{quote}
\url{http://www.dfki.de/sks/hets}
\end{quote}
Since \Hets is being
improved constantly, it is recommended always to use the latest version.
\Hets is currently available (on Intel architectures only) for Linux
and Mac OS X.
There are several possibilities to install \Hets.
\begin{enumerate}
\item
The best support is currently given via Ubuntu packages.
For Ubuntu Lucid Lynx, enter the following into a terminal:
\begin{lstlisting}
sudo apt-add-repository ppa:hets/hets
sudo apt-add-repository \
"deb http://archive.canonical.com/ubuntu lucid partner"
sudo apt-get update
sudo apt-get install hets
\end{lstlisting}
For later Ubuntu versions, replace lucid by maverick, natty or oneiric.
This will also install quite a couple of tools for proving requiring about
800 MB of disk space. For a minimal installation use \texttt{apt-get install
hets-core} instead of \texttt{hets}.
\item For Mac OS X 10.6 (Snow Leopard) we provide a meta package
\texttt{Hets.mpkg} based on MacPorts that will be extended by further tools
for proving in the future.
\item
Then we have Java based \Hets installer that we may drop in the future.
Download a \texttt{.jar} file and start it with
\begin{lstlisting}
java -jar file.jar
\end{lstlisting}
Note that you need Sun/Oracle Java 1.4.2 or later. On a Mac, you can just
double-click on the \texttt{.jar} file, but you have to install the MacPorts
\texttt{libglade2} package (and all its dependencies) yourself. In order to
speed this up we provide a meta package \texttt{libglade2.mpkg}, too.
The installer will lead you through the installation with
a graphical interface. It will download and install further
software (if not already installed on your computer):
\medskip
{\small
\begin{tabularx}{\linewidth}{|l|l|X|}\hline
Hets-lib & specification library & \url{http://www.cofi.info/Libraries}\\\hline
uDraw(Graph) & graph drawing & \url{http://www.informatik.uni-bremen.de/uDrawGraph/en/}\\\hline
Tcl/Tk & graphics widget system & (version 8.4 or 8.5 must be installed before)\\\hline
\SPASS & theorem prover & \url{http://spass.mpi-sb.mpg.de/}\\\hline
Darwin & theorem prover & should be installed manually from \url{http://combination.cs.uiowa.edu/Darwin/}\\\hline
\Isabelle & theorem prover & \url{http://www.cl.cam.ac.uk/Research/HVG/Isabelle/}\\\hline
(X)Emacs & editor (for Isabelle) & (must be installed manually)\\\hline
\end{tabularx}
}
\medskip
\item
If you do not have Sun/Oracle Java, you can just download the hets binary.
You have to unpack it with \texttt{bunzip2} and then put it into
some place covered by your \texttt{PATH} environment variable. You also have to
install the above mentioned software and set
several environment variables, as explained on the installation page.
\item
You may compile \Hets from the sources (they are licensed under GPL),
please follow the
link ``Hets: source code and information for developers''
on the \Hets web page, download the sources (as tarball or from
svn), and follow the
instructions in the \texttt{INSTALL} file, but be prepared to take some time.
\end{enumerate}
Depending on your application further tools are supported and may be
installed in addition:
\medskip
{\small
\begin{tabularx}{\linewidth}{|l|l|X|}\hline
zChaff & SAT solver & \url{http://www.princeton.edu/~chaff/zchaff.html} \\\hline
minisat & SAT solver & \url{http://minisat.se/} \\\hline
Pellet & OWL reasoner & \url{http://clarkparsia.com/pellet/} \\\hline
E-KRHyper & theorem prover
& \url{http://userpages.uni-koblenz.de/~bpelzer/ekrhyper/} \\\hline
Reduce & computer algebra system
& \url{http://www.reduce-algebra.com/} \\\hline
Maude & rewrite system & \url{http://maude.cs.uiuc.edu/} \\\hline
VSE & theorem prover & (non-public) \\\hline
Twelf & & \url{http://twelf.plparty.org/} \\\hline
\end{tabularx}
}
\section{Analysis of Specifications}
Consider the following Common Logic text written in CLIF:
\medskip
\begin{lstlisting}[language=clif]
(P x)
(and (P x) (Q y))
(or (Cat x) (Mat y))
(not (On x y))
(if (P x) (Q x))
(exists (z) (and (Pet x) (Happy z) (Attr x z)))
\end{lstlisting}
\Hets can be used for parsing and
checking static well-formedness of specifications.
\index{parsing}%
\index{static!analysis}%
\index{analysis, static}%
Let us assume that the example is in a file named
\texttt{Cat-AllInOne.clif}.\footnote{This file can be found in the \texttt{CommonLogic/Examples} directory in the \Hets library \cite{hets-library:URL}.}
Then you can check the well-formedness of the
specification by typing (into some shell):
\begin{quote}
\texttt{hets Cat-AllInOne.clif}
\end{quote}
\Hets checks both the correctness of this specification
with respect to the CLIF syntax, as
well as its correctness with respect to the static semantics.
The following flags are available in this context:
\begin{description}
\item[\texttt{-p}, \texttt{-{}-just-parse}] Just do the parsing
-- the static analysis is skipped and no development graph is created.
\item[\texttt{-s}, \texttt{-{}-just-structured}] Do the parsing and the
static analysis of (heterogeneous) structured specifications, but
leave out the analysis of basic specifications. This can be used
for prototyping issues, namely to quickly produce a development graph
showing the dependencies among the specifications (cf.
Sect.~\ref{sec:DevGraph}) even if the individual specifications are
not correct yet.
\item[\texttt{-L DIR}, \texttt{-{}-hets-libdir=DIR}]
Use \texttt{DIR} as a colon separated list of directories for specification libraries (equivalently, you can set the variable \texttt{HETS\_LIB} before
calling \Hets).
\end{description}
There are more flags which can be used with \Hets, see \cite{HetsUserGuide}.
\section{Heterogeneous Specification} \label{sec:HetSpec}
\Hets accepts plain text input files (for the
presented logics) with the following endings:
\\
\begin{tabular}{|l|c|c|}\hline
filename extension & default logic & structuring language\\\hline
\texttt{.casl} & \CASL & \CASL \\\hline
\texttt{.het} & \CASL & \CASL \\\hline
\texttt{.owl} & OWL2 & OWL2 \\\hline
\texttt{.clf} or \texttt{.clif} & CommonLogic & custom, see Sect.~\ref{relationsInCL} \\\hline
\end{tabular}
\medskip
Although the endings \texttt{.casl} and \texttt{.het} are
interchangeable, the former should be used for libraries of
homogeneous \CASL specifications and the latter for \HetCASL libraries
of heterogeneous specifications (that use the \CASL structuring
constructs). Within a \HetCASL library, the current logic can be changed, e.g.,
to Common Logic in the following way:
\begin{lstlisting}[morekeywords=logic]
logic CommonLogic
\end{lstlisting}
The subsequent specifications are then parsed and analysed as
Common Logic specifications. Within such specifications,
it is possible to use references to named \CASL specifications;
these are then automatically translated along the default
embedding of \CASL into Common Logic (cf.\ Fig.~\ref{fig:LogicGraph}).
(There are also heterogeneous constructs
for explicit translations between logics, see \cite{Mossakowski04}.)
The endings \texttt{.clf} and \texttt{.clif} are available for directly reading in
Common Logic CLIF texts, as in the example of \texttt{Cat-AllInOne.clif}.
By contrast, in \HetCASL libraries (ending with \texttt{.het}),
the logic Common Logic has to be chosen explicitly, and the \CASL structuring
syntax needs to be used:
\begin{lstlisting}[language=hetcasl,alsolanguage=clif]
library Cat
logic CommonLogic
spec Pred =
. (P x)
(and (P x) (Q y))
spec Cat =
. (or (Cat x) (Mat y))
(not (On x y))
(if (P x) (Q x))
spec PetHappy =
Pred and Cat then
. (exists (z) (and (Pet x) (Happy z) (Attr x z)))
end
\end{lstlisting}
Note that the dot at the beginning of a line indicates that a new text begins.
Hence, it is possible to have multiple texts in a \CASL specification.
This specification is the \HetCASL-structured equivalent to the following three
CLIF files:\footnote{Note that the ``cl:text'' syntax specified in the Common Logic standard \cite{CommonLogic:oldfashioned} has subsequently been recorded as a defect \cite{CommonLogicDefects:oldfashioned}, in favor of ``cl-text''. \Hets supports both.}\\
\begin{description}
\item[Pred.clif:]~\\
\begin{lstlisting}[language=clif]
(cl-text Pred
(P x)
(and (P x) (Q y))
)
\end{lstlisting}
\item[Cat.clif:]~\\
\begin{lstlisting}[language=clif]
(cl-text Cat
(or (Cat x) (Mat y))
(not (On x y))
(if (P x) (Q x))
)
\end{lstlisting}
\item[Spec.clif:]~\\
\begin{lstlisting}[language=clif]
(cl-text PetHappy
(cl-imports Pred) (cl-imports Cat)
(exists (z) (and (Pet x) (Happy z) (Attr x z)))
)
\end{lstlisting}
\end{description}
Both can be directly used with \Hets, where the former content would be in a
file with the extension \texttt{.het} and the latter in a file with one of the extensions
\texttt{.clf} or \texttt{.clif}.\footnote{These files can be found in the \texttt{CommonLogic/Examples} directory in the \Hets library \cite{hets-library:URL}.} This specification is divided into three
parts, which are linked to each other. These links and some more information can
be seen in the development graph of the file.
\section{Development Graphs}\label{sec:DevGraph}
Development graphs are a simple kernel formalism for (heterogeneous)
structured theorem proving and proof management.
A development graph consists of a set of nodes (corresponding to whole
structured specifications or parts thereof), and a set of edges
called \emph{definition links}, indicating the dependency of each
involved structured specification on its subparts. Each node is
associated with a signature and some set of local axioms. The axioms
of other nodes are inherited via definition links. Definition links
are usually drawn as black solid arrows, denoting an import of another
specification.
Complementary to definition links, which \emph{define} the theories of
related nodes, \emph{theorem links} serve for \emph{postulating}
relations between different theories. Theorem links are the central
data structure to represent proof obligations arising in formal
developments.
Theorem links can be \emph{global} (drawn as solid arrows) or
\emph{local} (drawn as dashed arrows): a global theorem link
postulates that all axioms of the source node (including the inherited
ones) hold in the target node, while a local theorem link only postulates
that the local axioms of the source node hold in the target node.
Both definition and theorem links can be \emph{homogeneous},
i.e.\ stay within the same logic, or \emph{heterogeneous}, i.e.\ %% such that
the logic changes along the arrow.
Theorem links are initially displayed in red.
The \emph{proof calculus} for development graphs
\cite{MossakowskiEtAl05,Habil} is given by rules
that allow for proving global theorem links by decomposing them
into simpler (local and global) ones. Theorem links that have been
proved with this calculus are drawn in green by {\Hets}. Local theorem links can
be proved by turning them into \emph{local proof goals}. The latter
can be discharged using a logic-specific calculus as given by an
entailment system for a specific institution. Open local
proof goals are indicated by marking the corresponding node in the
development graph as red; if all local implications are proved, the
node is turned into green. This implementation ultimately is based
on a theorem \cite{Habil} stating soundness and relative completeness
of the proof calculus for heterogeneous development graphs.
Details can be found in the \CASL Reference Manual \cite[IV:4]{CASL/RefManual}
and in \cite{Habil,MossakowskiEtAl05,MossakowskiEtAl07b}.
The following options let \Hets display the development graph of
a specification library:
\begin{description}
\item[\texttt{-g}, \texttt{-{}-gui}] shows the development graph in a GUI window
\item[\texttt{-u}, \texttt{-{}-uncolored}] no colours in shown graphs
\end{description}
The following additional options also apply typical rules from the development
graph calculus to the final graph and save applying these rules via the GUI.
\begin{description}
\item[\texttt{-A}, \texttt{-{}-apply-automatic-rule}] apply the automatic
strategy to the development graph. This is what you usually want in order to
get goals within nodes for proving.
\item[\texttt{-N}, \texttt{-{}-normal-form}] compute all normal forms for nodes
with incoming hiding links. (This may take long and may not be implemented
for all logics.)
\end{description}
For a summary of the types of nodes and links occurring in
development graphs, see the \Hets user guide \cite{HetsUserGuide}.\\
Most of the pull-down menus of the development graph window are
uDraw(Graph)-specific layout menus; their function can be looked up in
the uDraw(Graph) documentation\footnote{see
\url{http://www.informatik.uni-bremen.de/uDrawGraph/en/service/uDG31\_doc/}.}.
The Edit menu is the only exception.
With choosing Edit→Proofs→Auto-DG prover, you can can prove red theorem
links (which may be generated by relative interpretations of theories).
Actually, this will generate new proof obligations at some node,
which then can be discharged there.
Moreover, the nodes and links of the
graph have attached pop-up menus, which appear when clicking (and
holding) the right mouse button.
The node menus ``Prove'' and ``Check consistency'' are the most
important ones. With ``Add sentence'', you can add axioms and
proof goals on the fly.
For a detailed explanation of the menus
see the \Hets User Guide \cite{HetsUserGuide}.
\subsection{Relations between Common Logic Texts}
\label{relationsInCL}
\Hets supports several relations between Common Logic Texts. However only one of
them, the importation, is defined in ISO/IEC 24707:2007 \cite{CommonLogic:oldfashioned}, and has a syntax within Common Logic. All the other relations are
unofficial extensions used e.g.\ by the Common Logic Repository COLORE \cite{Colore}, and represented externally of Common Logic texts. COLORE currently represents them in external XML documents, and any required symbol maps in external CLIF files. \Hets, in contrast, allows for declaring them as \emph{views} within \HetCASL files, outside of specifications, as can be seen from the syntax specification in List.~\ref{fig:lang}.
\begin{description}
\item[Importation] \label{descr:link_import}
is defined in ISO/IEC 24707:2007 \cite{CommonLogic:oldfashioned} as virtual copying of a
resource. In \Hets a whole file is ``copied'' into the importing
specification. Hets cannot currently handle cyclic imports. If you really need
them, send us a message at \href{mailto:hets@informatik.uni-bremen.de}{hets@informatik.uni-bremen.de}, and we will fix it.
Using CLIF, you can import \texttt{someFile.clif} via
\begin{lstlisting}[language=clif]
(cl-imports someFile.clif)
\end{lstlisting}
Omitting the file extension will also succeed. In this case \Hets will look
for a file called \texttt{someFile.clif} in first place and then for
\texttt{someFile.clf} in the current directory and then in the library paths.
\Hets also supports URIs for importing resources. The allowed URI schemes are
\texttt{file:}, \texttt{http:} and \texttt{https:}.
\begin{lstlisting}[language=clif]
(cl-imports file:///absolute/path/to/someFile.clif)
(cl-imports http://someDomain.com/path/to/someFile.clif)
(cl-imports https://someDomain.com/path/to/someFile.clif)
\end{lstlisting}
The importation is indicated by a global definition link (black arrow) in the
development graph.
\item[Relative interpretation]
is formally defined in \cite{colore-fois}. Informally, one module relatively interprets those “modules whose theorems are preserved within the current module through [a] mapping. There exists a mapping between modules such that all theorems of the other module hold in the current module after the mapping is applied.” \cite{Colore-metadata}
\Hets represents relative interpretation by a theorem link
(red arrow) in the development graph.
The \HetCASL syntax for relative interpretations is
\begin{quote}
\textbf{view} \textit{v} : \textit{someCLText} \textbf{to} \textit{someTargetCLText} \textbf{end}
\end{quote}
or
\begin{quote}
\textbf{view} \textit{v} : \{ \textit{someCLText} \textbf{with} \textit{<symbol map (see below)>} \} \textbf{to} \textit{someTargetCLText} \textbf{end}
\end{quote}
where a symbol map allows for renaming symbols, e.g.
\begin{quote}
\textit{name1Old} |-> \textit{name1New}, \textit{name2Old} |-> \textit{name2New}.
\end{quote}
We provide a concrete examples in Sect.~\ref{sec:examples} below.
Just as with imports (see above), \Hets supports different types
of references to resources here, such as URIs.
\item[Non-conservative extension] is informally defined as follows: One module non-conservatively extends other modules, if its “axioms entail new facts for the shared lexicon of the [other] module(s). [That is, the] shared lexicon between the current module and a [non-conservatively extended] module are not logically equivalent with respect to their modules.” \cite{Colore-metadata}.
\Hets represents non-conservative extension by a theorem link (red arrow) in the development graph.\ednote{CL: show the Hets view syntax}
Just as with imports (\ref{descr:link_import}), \Hets supports different types
of references to resources here, as e.g. URIs.
%TODO: briefly describe colore-relations.
%TODO: include other colore-relations
\item[Inclusion]
is not a relation between theories. However inclusion can useful. It is used
to show other theories in the development graph, without any connection
to the current theory.
For loading such theories, \HetCASL employs the same syntax as for loading theories that are connected to other theories, i.e.\ on loading theories, \Hets does not care about their relations:
\begin{quote}
\textbf{from} \textit{library} \textbf{get} \textit{spec$_1$}, \dots, \texttt{spec$_n$}
\end{quote}
\end{description}
Except for importation and inclusion, you can specify an optional symbol map
(name map) in a relation.\footnote{While the ``copy'' semantics of Common Logic importations does not permit renamings, \HetCASL's extension mechanism offers an alternative possibility to reuse ontologies and rename some of their symbols, using the ``\textit{importedSpec} \textbf{with} \textit{name1Old} |-> \textit{name1New}, \textit{name2Old} |-> \textit{name2New} \textbf{then} \textit{importingSpec}'' syntax.}
Names from the target file are mapped to names from the current
file (including the translation file, if the relation uses one). Note that is is possible to use cyclic relations in \Hets. Only the cyclic
importation is not supported.
\subsection{Examples}
\label{sec:examples}
This section introduces several typical examples of using Common Logic ontologies with \Hets.
\subsubsection{Renaming Symbols with Symbol Maps}
\label{sec:renam-symb-with}
This example has two almost identical Common Logic texts, \texttt{upper.clif} and
\texttt{lower.clif}; these can be found in the \texttt{CommonLogic/Examples} directory in the \Hets library \cite{hets-library:URL}. The only difference in the actual axioms is that
\texttt{upper.clif} uses uppercase predicates while \texttt{lower.clif}
uses lowercase predicates:
\begin{description}
\item[upper.clif:]~\\
\begin{lstlisting}[language=clif]
(cl-text upper
(forall (x y) (iff (A x y)
(B x y)))
)
\end{lstlisting}
\item[lower.clif:]~\\
\begin{lstlisting}[language=clif]
(cl-text lower
(forall (x y) (iff (a x y)
(b x y)))
)
\end{lstlisting}
\end{description}
The heterogeneous library \texttt{CommonLogic/Examples/SymbolMap.het} in the \Hets library \cite{hets-library:URL} establishes a mapping (actually: a relative interpretation) between these two Common Logic texts:
\begin{lstlisting}[language=hetcasl]
library SymbolMap
logic CommonLogic
from upper get upper
from lower get lower
view v : { lower with a |-> A , b |-> B } to upper
view w : { upper with A |-> a , B |-> b } to lower
\end{lstlisting}
A symbol map only needs to list those names that differ between the source
and the target ontology; the other names (none in this concrete case) are implicitly the same. A mapping of a single name is defined with
``\texttt{nameInTargetFile |-> nameInCurrentFile}''; multiple mappings are
separated by commas. Note that in Common Logic, a comma can be part of a name.
Hence a space must be placed between the separation-comma and a name.
\subsubsection{Relative Interpretation in COLORE}\label{sec:relat-interpr}
We give two examples for relative interpretation: one from COLORE (in this section), and one standalone one (in Sect.~\ref{sec:rel-intpr-standalone}).
The COLORE \cite{Colore} module \texttt{Region\-Boolean\-Contact\-Algebra} relatively interprets the module \texttt{Atomless\-Boolean\-Lattice}. These two modules specify axioms about booleans; thus, they have the same signature. In the graph of imports, they have several common imported modules (e.g.\ \texttt{Bounded\-Distributive\-Lattice}), but no common importing module, as can be seen from Fig.~\ref{fig:colore-graph}.
\begin{figure}
\begin{center}
\includegraphics[width=.75\textwidth]{colore-subset}
\end{center}
\caption{Boolean algebras and lattices in COLORE (subgraph)}
\label{fig:colore-graph}
\end{figure}
For use with \Hets, we have made a dump of the COLORE contents available in \texttt{CommonLogic/colore} in the \Hets library \cite{hets-library:URL}. The \HetCASL variant of expressing the relative interpretation can be found in \texttt{CommonLogic/Examples/COLORE-RelativeInterpretation}. Here, it is not necessary to rename symbols, as both modules have the same signature.
For easier understanding, the \HetCASL implementation includes literal copies of the \texttt{Region\-Boolean\-Contact\-Algebra} and \texttt{Atomless\-Boolean\-Lattice} modules; actually, they could as well have been included from their respective files using \texttt{from ... get ...}.
\begin{lstlisting}[language=hetcasl,alsolanguage=clif]
library COLORE-RelativeInterpretation
logic CommonLogic
from CommonLogic/colore/lat/BooleanLattice get BooleanLattice
from CommonLogic/colore/ca/BooleanContactAlgebra get BooleanContactAlgebra
spec AtomlessBooleanLattice =
BooleanLattice
then
. (forall (x)
(exists (y)
(and (not (= y 0))
(leq y x))))
end
spec RegionBooleanContactAlgebra =
BooleanContactAlgebra
then
. (forall (x)
(if (and (not (= x 0))
(not (= x 1)))
(exists (y)
(and (complement x y)
(C x y)))))
end
view v : AtomlessBooleanLattice to RegionBooleanContactAlgebra
\end{lstlisting}
\subsubsection{Relative Interpretation (Standalone Example)}\label{sec:rel-intpr-standalone}
This example defines a partial order twice: once as an extension of a strict partial order, and once directly. Then, we connect both definitions by a view that expresses the relative interpretation.
The source is available as \texttt{CommonLogic/Examples/Partial\_Orders.het} directory in the \Hets library \cite{hets-library:URL}.
\begin{lstlisting}[language=hetcasl,alsolanguage=clif]
logic CommonLogic
spec Strict_Partial_Order =
%% strict
. (forall (x)
(not (lt x x)))
%% asymmetric
. (forall (x y)
(if (lt x y)
(not (lt y x))))
%% transitive
. (forall (x y z)
(if (and (lt x y)
(lt y z))
(lt x z)))
end
spec Partial_Order_From_Strict_Partial_Order =