-
Notifications
You must be signed in to change notification settings - Fork 0
/
power-util-sig.sml
executable file
·39 lines (29 loc) · 1.3 KB
/
power-util-sig.sml
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
(* Needs excluded.sml (large data file) so probably shouldn't be
compiled into submissions? *)
signature POWER_UTIL =
sig
(* All inputs should be in lowercase! StringUtil.lcase! *)
val loadproblem : int -> Board.problem
val problems : unit -> Board.problem vector
val get_valid_prefix : Board.problem -> Word32.word -> string -> int
(* Given all the problems to try, and a solution, return the
(prefix size, problem index, seed) for which the prefix can be
longest while still being valid. *)
val longest_prefix : Board.problem vector -> string ->
int * int * Word32.word
(* get_score problem seed_value soln
Get the total number of points. Any error results in 0. *)
val get_score : Board.problem -> Word32.word -> string -> int
(* Can we legally execute the string at this point?
Undoes any modifications to state. *)
val can_execute : Board.state -> string -> bool
val execute : Board.state -> string -> unit
val is_excluded : string -> bool
val is_known : string -> bool
val is_invalid : string -> bool
val contains_known : string -> bool
(* Escape a solution string so that it can be placed in single-quotes
on a bash command-line. (It actually breaks out of those quotes
to emit single quote characters.) *)
val escape : string -> string
end