Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
verimag
synchrone
lutin
Commits
5393e777
Commit
5393e777
authored
May 28, 2010
by
Erwan Jahier
Browse files
Simplify sligthly the FGen.get interface by removing a redundant argument.
parent
93a3a0ec
Changes
9
Hide whitespace changes
Inline
Side-by-side
source/env_state.ml
View file @
5393e777
...
...
@@ -51,9 +51,6 @@ type t = {
(****************************************************************************)
open
LucProg
let
(
label_to_node
:
string
->
string
->
LucProg
.
node
)
=
fun
file
label
->
(* to avoid node label clashes, prepend the name of the file *)
...
...
source/fGen.ml
View file @
5393e777
...
...
@@ -360,9 +360,10 @@ and (wt_to_cont : Var.env_in -> Env_state.t -> wt -> wt_cont -> wt_cont) =
(****************************************************************************)
(* exported *)
let
(
get
:
Var
.
env_in
->
Env_state
.
t
->
LucProg
.
ctrl_state
list
->
t
list
)
=
fun
input
state
nll
->
let
(
get
:
Var
.
env_in
->
Env_state
.
t
->
t
list
)
=
fun
input
state
->
let
_
=
if
debug
then
(
print_string
"XXX get
\n
"
;
flush
stdout
)
in
let
nll
=
state
.
d
.
ctrl_state
in
List
.
map
(
fun
nl
->
let
wtl
=
List
.
map
(
get_wt
input
state
)
nl
in
...
...
source/fGen.mli
View file @
5393e777
...
...
@@ -57,16 +57,12 @@ type t
*)
val
get
:
Var
.
env_in
->
Env_state
.
t
->
LucProg
.
ctrl_state
list
->
t
list
(** [get input state ctrl_state] computes the sub-automata of the
global Lucky automaton made of the accessible nodes from nodes in
[ctrl_state]. Automata obtained from inner lists of nodes (in
[ctrl_state]) are composed (sequence). During that composition,
we check that formula conjunctions are still satisfiable.
val
get
:
Var
.
env_in
->
Env_state
.
t
->
t
list
(** [get input state] computes the formula generator from the
current control points.
nb: get returns the list of automata made of distinct output variables
(i;e;, independent automata)
*)
nb: get returns the list of formula generator dealing with
distinct output variables. *)
(** Raised by choose_one_formula no more transitions can be taken *)
...
...
source/luc4c.ml
View file @
5393e777
...
...
@@ -183,7 +183,7 @@ let (step: lucky_process -> step_mode -> unit) =
);
match
state_of_lp
lp
with
|
Some
(
st0
,
inp
,_
outp
)
->
let
ral
=
FGen
.
get
inp
st0
st0
.
d
.
ctrl_state
in
let
ral
=
FGen
.
get
inp
st0
in
let
(
st
,
(
outs
,
_locs
))
=
try
Lucky
.
env_step
...
...
source/luc4ocaml.ml
View file @
5393e777
...
...
@@ -131,7 +131,7 @@ let (convert_inputs_back : Var.env_in -> subst list) =
let
step
?
(
mode
=
StepInside
)
st0
inputs
=
let
inp
=
convert_inputs
inputs
in
let
ral
=
FGen
.
get
inp
st0
st0
.
d
.
ctrl_state
in
let
ral
=
FGen
.
get
inp
st0
in
let
(
st
,
(
outs
,
locs
))
=
try
Lucky
.
env_step
...
...
source/lucProg.mli
View file @
5393e777
...
...
@@ -104,7 +104,8 @@ type ctrl_state = node list
type
lucky_arc
=
Arc
of
node
*
arc_info
*
node
type
automata
=
{
(* XXX rename it "raw_source" *)
type
automata
=
{
file
:
string
;
init_node
:
node
;
inputs
:
(
Exp
.
var_tbl
*
LustreExp
.
vut
);
...
...
@@ -117,6 +118,7 @@ type automata = {
}
(** [parse_automata preprocessor file] parses [file] and returns the
[automata] it contains *)
val
parse
:
string
option
->
string
->
automata
...
...
source/luc_exe.ml
View file @
5393e777
...
...
@@ -273,7 +273,7 @@ and
let
next_state
=
if
options
.
boot
then
let
htbl
=
(
Hashtbl
.
create
0
)
in
let
ral
=
FGen
.
get
htbl
init_state
init_state
.
d
.
ctrl_state
in
let
ral
=
FGen
.
get
htbl
init_state
in
let
(
next_state
,
(
out
,
loc
))
=
try
Lucky
.
env_step
options
.
draw_mode
htbl
init_state
ral
...
...
@@ -338,7 +338,7 @@ and
in
let
(
input
,
state'
)
=
Rif
.
read
stdin
state
in
let
input_list
=
Hashtbl
.
fold
(
fun
vn
x
acc
->
(
vn
,
x
)
::
acc
)
input
[]
in
let
ral
=
FGen
.
get
input
state'
state
.
d
.
ctrl_state
in
let
ral
=
FGen
.
get
input
state'
in
let
(
next_state
,
(
out
,
loc
))
=
try
Lucky
.
env_step
options
.
draw_mode
input
state'
ral
...
...
source/lucky.ml
View file @
5393e777
...
...
@@ -150,7 +150,7 @@ let (env_try_do : Thickness.formula_draw_nb * Thickness.numeric -> env_in ->
let
(
env_try
:
Thickness
.
t
->
env_in
->
Env_state
.
t
->
FGen
.
t
list
->
FGen
.
t
list
*
(
env_out
*
env_loc
)
list
)
=
fun
(
bt
,
nt
)
input
state
ral
->
(* let ral = FGen.get input state
state.d.ctrl_state
in *)
(* let ral = FGen.get input state in *)
if
fst
bt
then
(* try all formula *)
let
rec
f
ral
acc
=
...
...
source/lurette.ml
View file @
5393e777
...
...
@@ -705,7 +705,7 @@ and
and
main_loop
t
s
p
k1
k2
k3
rif
input
state
write_luciole_inputs
read_luciole_outputs
luciole_outputs
=
let
ral
=
FGen
.
get
input
state
state
.
d
.
ctrl_state
in
let
ral
=
FGen
.
get
input
state
in
let
_
=
if
(
k1
=
0
&&
k2
=
0
&&
k3
=
0
&&
not
(
options
.
draw_all_vertices
))
then
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment