arc-shell.texi 6.52 KB
Newer Older
point's avatar
point committed
1
2
@node The ARC command
@chapter The @code{arc} command
point's avatar
point committed
3
4

@arc{} has been designed as a command-line tool like shell programs used on 
point's avatar
point committed
5
Unix-like systems (e.g. @code{bash} or @code{csh}). If you execute the @arc{} 
6
command, the program simply displays a welcome banner and the prompt @code{arc>}:
point's avatar
point committed
7
8
9

@smallexample
$ arc
10
11
12
13
@i{arc 1.5}
@i{Copyright (c) 2002-2015 LaBRI - CNRS & University of Bordeaux.}
@i{All rights reserved.}
@i{This software is distributed under AltaRica Public License (see COPYING file).}
point's avatar
point committed
14

15
16
@i{Please report any bug to labri.altarica-bugs[at]diff.u-bordeaux.fr}
@i{or on project webpage http://altarica.labri.fr/}
point's avatar
point committed
17

point's avatar
point committed
18
@i{arc>}
point's avatar
point committed
19
20
21
22
23
24
25
26
27
@end smallexample

The user can add arguments to the @arc{} command. An argument that starts with 
a dash (@code{-}) is considered as an option; an argument that is not an option
is considered as a filename. The current version of @arc{} allows the following
options:

@table @option
@item -b 
28
29
This option indicates that @arc{} is used in batch mode i.e. it exits after 
the interpretation of all its arguments (files and options). 
point's avatar
point committed
30
31

@item -c @emph{script}
point's avatar
point committed
32
33
This option indicates to @arc{} that the next argument, @emph{script}, should 
be interpreted as a list of @code{arc} commands.
point's avatar
point committed
34
35

@item -d
36
This option exists only for debugging purposes; it enables the display of many
point's avatar
point committed
37
38
ugly messages.

39
40
41
42
@item -h or --help
Display the general syntax of @arc{} command-line arguments and the list of 
allowed options.

point's avatar
point committed
43
44
45
46
47
@item -q
This option specifies that @arc{} should be run in a @emph{quiet} mode i.e. 
eliminating verbose informating messages. In particular this option disables the
display of the ``Welcome'' banner.

48
49
50
51
52
@item -x 
This option enables enable command/response mode. This mode is used by GUI AltaRica studio. It implements a small query/response protocol.

@item -V or --version
This option displays the current version of @arc{}. If @code{-q} is not specified it prints out compilation options and many other data related to the current version in use.
point's avatar
point committed
53
54
55
56
@end table

@section Interactions with @arc{}

57
Depending of the installation host the @arc{} prompt might be compiled using
Point Gerald's avatar
Point Gerald committed
58
the @sc{readline} library (@bibcite{rl}) or not. This library is now used by
59
60
61
62
63
many prompt-based programs (e.g. Unix shells) to facilitate interactions with
the user. 

The @sc{readline} library memorizes commands executed by the user. When @arc{} 
exits this @i{history} is stored into a file named by default 
64
@file{~/.arc_history} but it can be changed using user preferences (see @ref{User preferences})). The next time @arc{} is started interactively, this file 
65
66
is reloaded and the user gets back commands of its previous session. 

point's avatar
point committed
67
Each command is essentially the identifier of the command followed by its
point's avatar
point committed
68
69
70
71
72
73
arguments. A semi-colon (@t{;}) can be used to separate several commands 
entered on the same command line. For instance, below three commands are 
executed from the same command line: the first one defines a new relation 
@code{R}, the second command displays the cardinality of @code{R} and the last
one outputs elements of @code{R}.
@smallexample
74
75
76
@i{arc>}eval EOF; card R ; show R
@i{eval>}R(i : [0,10]) := <n : [0,10]>(i = 3 * n);
@i{eval>}EOF
point's avatar
point committed
77
78
79
80
81
82
83
84
@i{R (i : [0, 10]) : 4 elements / 2 nodes}
@i{card (R) = 4}
@i{i = 0}
@i{i = 3}
@i{i = 6}
@i{i = 9}
@end smallexample

85
86
The reader familiar with previous version of @arc{} should have noticed that @command{eval} is used in a different way (see @refevalcmd).

point's avatar
point committed
87
Outputs of commands can be redirected into a file or into a pipe to another 
point's avatar
point committed
88
program. This mechanism uses the same notation than the one used by Unix 
point's avatar
point committed
89
90
91
92
93
94
95
96
97
shells:
@itemize
@item @i{cmd arg@ind{1} @dots{} arg@ind{n}} @code{>} @i{filename} outputs the
results of the command @i{cmd} into the file called @i{filename}. If 
@i{filename} does not exist it is created; else, it is made empty and 
overwritten.
@item @i{cmd arg@ind{1} @dots{} arg@ind{n}} @code{>>} @i{filename} outputs the
results of the command @i{cmd} at the end of the file called @i{filename}. If 
@i{filename} does not exist it is created.
point's avatar
point committed
98
@item @i{cmd arg@ind{1} @dots{} arg@ind{n}} @code{|} ''@i{program progarg@ind{1} ... progarg@ind{n}}'' outputs the results of the command @i{cmd} to the standard input of
point's avatar
point committed
99
100
101
102
@i{program} executed with arguments @i{progarg@ind{i}}. For instance
@example
apropos preferences | more
@end example
point's avatar
point committed
103
should display the list of user preferences using the pager command 
point's avatar
point committed
104
105
@command{more}.
@end itemize 
106
107
108
109
110
111

@section General purpose commands

@subsection @command{apropos}
@include apropos-cmd.texi

112
113
114
@subsection @command{cd}
@include cd-cmd.texi

115
116
117
@subsection @command{echo}
@include echo-cmd.texi

118
119
120
121
122
123
@subsection @command{eval}
@include eval-cmd.texi

@subsection @command{exit}
@include exit-cmd.texi

124
125
126
@subsection @command{gc}
@include gc-cmd.texi

127
128
129
130
131
132
133
134
135
136
137
138
@subsection @command{help}
@include help-cmd.texi

@subsection @command{info}
@include info-cmd.texi

@subsection @command{list}
@include list-cmd.texi

@subsection @command{load}
@include load-cmd.texi

139
140
141
@subsection @command{pwd}
@include pwd-cmd.texi

142
143
144
145
146
147
148
149
150
@subsection @command{remove}
@include remove-cmd.texi

@subsection @command{set}
@include set-cmd.texi

@subsection @command{show}
@include show-cmd.texi

Point Gerald's avatar
Point Gerald committed
151
152
@subsection @command{timer}
@include timer-cmd.texi
153

point's avatar
point committed
154
@section Commands related to AltaRica nodes
155
156
157
158

@subsection @command{ca}
@include ca-cmd.texi

Point Gerald's avatar
Point Gerald committed
159
160
161
@subsection @command{depgraph}
@include depgraph-cmd.texi

162
163
164
@subsection @command{flatten}
@include flatten-cmd.texi

Point Gerald's avatar
Point Gerald committed
165
166
167
@subsection @command{node-info}
@include node-info-cmd.texi

168
169
@subsection @command{obfuscate}
@include obfuscate-cmd.texi
170
171
172
173

@subsection @command{solve}
@include solve-cmd.texi

Point Gerald's avatar
Point Gerald committed
174
175
176
177
178
179
@subsection @command{stepper}
@include stepper-cmd.texi

@subsection @command{target-reduction}
@include target-reduction-cmd.texi

180
181
182
@subsection @command{to-lustre}
@include to-lustre-cmd.texi

point's avatar
point committed
183
184
185
@subsection @command{validate}
@include validate-cmd.texi

Point Gerald's avatar
Point Gerald committed
186
187
188
@subsection @command{chkctl}
@include chkctl-cmd.texi

Point Gerald's avatar
Point Gerald committed
189
@section Commands related to computations using exhaustive engine
190

Point Gerald's avatar
Point Gerald committed
191
192
@subsection @command{ts}
@include ts-cmd.texi
193

Point Gerald's avatar
Point Gerald committed
194
195
@subsection @command{ts-marks}
@include ts-marks-cmd.texi
196

Point Gerald's avatar
Point Gerald committed
197
198
@subsection @command{show-ts-marks}
@include show-ts-marks-cmd.texi
199

point's avatar
point committed
200
@section Commands related to @mecv{} relations
201
202
203
204
205
206
207
208
209
210
211
212
213

@subsection @command{card}
@include card-cmd.texi

@subsection @command{check-card}
@include check-card-cmd.texi

@subsection @command{pick}
@include pick-cmd.texi

@subsection @command{store}
@include store-cmd.texi

214
215
@section Computation of sequences and fault trees
@subsection @command{cuts} and @command{sequences}
Point Gerald's avatar
Point Gerald committed
216
@include cuts-cmd.texi
point's avatar
point committed
217

Point Gerald's avatar
Point Gerald committed
218
219
@section Experimental commands

220
221
@subsection @command{diag}
@include diag-cmd.texi
222

Point Gerald's avatar
Point Gerald committed
223
224
225
@subsection @command{sat}
@include sat-cmd.texi