File: data__provenance.pro

package info (click to toggle)
spark 2011.0.deb-5
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 21,696 kB
  • sloc: ada: 171,145; cpp: 11,327; makefile: 1,027; yacc: 426; lex: 139; ansic: 119; sh: 16
file content (153 lines) | stat: -rw-r--r-- 5,971 bytes parent folder | download | duplicates (3)
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
% -----------------------------------------------------------------------------
%  (C) Altran Praxis Limited
% -----------------------------------------------------------------------------
% 
%  The SPARK toolset is free software; you can redistribute it and/or modify it
%  under terms of the GNU General Public License as published by the Free
%  Software Foundation; either version 3, or (at your option) any later
%  version. The SPARK toolset is distributed in the hope that it will be
%  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
%  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
%  Public License for more details. You should have received a copy of the GNU
%  General Public License distributed with the SPARK toolset; see file
%  COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy of
%  the license.
% 
% =============================================================================


%###############################################################################
% PURPOSE
%-------------------------------------------------------------------------------
% Provides access to all information related to the provenance of the target
% proof problem.
%###############################################################################


%###############################################################################
% MODULE
%###############################################################################

:- module(data__provenance, [get_provenance_framework/1,
                             add_provenance_framework/1,
                             get_provenance_proof_file_kind/1,
                             add_provenance_proof_file_kind/1,
                             get_provenance_date_time/2,
                             add_provenance_date_time/2,
                             get_provenance_banner/1,
                             add_provenance_banner/1,
                             get_provenance_subprogram_identifier/1,
                             add_provenance_subprogram_identifier/1,



                             path_functions/0,

                             save_data__provenance/0]).


%###############################################################################
% DEPENDENCIES
%###############################################################################

:- use_module('data__formats.pro', [add_state/2,
                                 add_type/2]).
:- use_module('ioutilities.pro', [write_terms_to_file/2]).
:- use_module('data__data_files.pro', [must_get_datafiles_debug/2]).


%###############################################################################
% TYPES
%###############################################################################

:- add_type('Framework',
            [spark,
             pascal]).


%###############################################################################
% DATA
%###############################################################################

:- add_state(get_provenance_framework,
             get_provenance_framework('Framework')).
:- dynamic(get_provenance_framework/1).

:- add_state(get_provenance_proof_file_kind,
             get_provenance_proof_file_kind('ProofFileKind')).
:- dynamic(get_provenance_proof_file_kind/1).

:- add_state(get_provenance_date_time,
             get_provenance_date_time('Date_Atom', 'Time_Atom')).
:- dynamic(get_provenance_date_time/2).

:- add_state(get_provenance_banner,
             get_provenance_banner('Line_AtomList')).
:- dynamic(get_provenance_banner/1).

:- add_state(get_provenance_subprogram_identifier,
             get_provenance_subprogram_identifier('SubprogramIdentifier_Atom')).
:- dynamic(get_provenance_subprogram_identifier/1).


%###############################################################################
% PREDICATES
%###############################################################################


%===============================================================================
% Add.
%===============================================================================

add_provenance_framework(Framework):-
    assert(get_provenance_framework(Framework)),
    !.

add_provenance_proof_file_kind(ProofFileKind):-
    assert(get_provenance_proof_file_kind(ProofFileKind)),
    !.

add_provenance_date_time(Date_Atom, Time_Atom):-
    assert(get_provenance_date_time(Date_Atom, Time_Atom)),
    !.

add_provenance_banner(Line_AtomList):-
    assert(get_provenance_banner(Line_AtomList)),
    !.

add_provenance_subprogram_identifier(SubprogramIdentifier_Atom):-
    assert(get_provenance_subprogram_identifier(SubprogramIdentifier_Atom)),
    !.
%===============================================================================


%===============================================================================
% save_data__provenance.
%===============================================================================

save_data__provenance:-
    must_get_datafiles_debug(data__provenance, DebugFile_Atom),
    write_terms_to_file(DebugFile_Atom,
                        [data__provenance:get_provenance_framework/1,
                         data__provenance:get_provenance_proof_file_kind/2,
                         data__provenance:get_provenance_date_time/2,
                         data__provenance:get_provenance_banner/1,
                         data__provenance:get_provenance_subprogram_identifier/1]),

    !.
%===============================================================================


%===============================================================================
% Refactor.
%===============================================================================

path_functions:-
    get_provenance_proof_file_kind(path_functions),
    !.

%===============================================================================


%###############################################################################
% END-OF-FILE