```    1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%
3% Copyright 2005, Renate Schmidt, University of Manchester
4%
5%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6
7
8%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9%
10%    The key calculus determines which set of rules are used.
11%    Possible settings:
12
13set_calculus(Flag) :-
14    flag(calculus, _, Flag).
15
16get_calculus(Flag) :-
17    flag(calculus, Flag, Flag).
18
20    current_module(Calculus).
21
23    get_calculus(OldCalculus),
24    atom(OldCalculus),
25    abolish(eventualities/2),
26    abolish(simplify_X/2),
27    abolish(reduce_local/7),
28    set_calculus(Calculus),
29    use_module(Calculus).
30
32    set_calculus(Calculus),
33    use_module(Calculus).
34
35%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
36%
37%    The key negate_first can be either yes or no
38%    If set to yes, the problem is negated first
39%    (theory remains unchanged)
40%    Default: unset == no
41
42set_negate_first(Flag) :-
43    flag(negate_first, _, Flag).
44
45get_negate_first(Flag) :-
46    flag(negate_first, Flag, Flag).
47
48%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49%
50%    The key search_output_filename represents the file to which the
51%    derivation steps are output
52
53create_search_output_file :- !,
54    get_search_output_filename(Filename),
55    open(Filename, write, _).
56
57set_search_output_filename(Filename) :- !,
58    write('set search_output_filename to '), write(Filename), nl,
59    flag(search_output_filename, _, Filename).
60
61get_search_output_filename(Filename) :- !,
62    flag(search_output_filename, Filename, Filename).
63
64%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
65%
66%    The key test_output_filename represents the file to which the
67%    output of tests is written
68
69create_test_output_file :- !,
70    get_test_output_filename(Filename),
71    open(Filename, write, _, [alias(test_output)]).
72
73set_test_output_filename(Filename) :- !,
74    write('set test_output_filename to '), print(Filename), nl,
75    flag(test_output_filename, _, Filename).
76
77get_test_output_filename(Filename) :- !,
78    flag(test_output_filename, Filename, Filename).
79
80%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
81%
82%    The key output_format determines the format of the output
83%    Either: latex or txt
84
85set_output_format(Format) :-
86    flag(output_format, _, Format).
87
88get_output_format(Format) :-
89    flag(output_format, Format, Format)```