-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpb_of_newcpf.ml
61 lines (46 loc) · 1.88 KB
/
pb_of_newcpf.ml
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
(******************************************************************************
Rainbow, a termination proof certification tool
See the COPYRIGHTS and LICENSE files.
- Frederic Blanqui, 2010-06-15
convert a CPF problem into a Rainbow problem
******************************************************************************)
open Cpf0;;
open Problem;;
open Error;;
let option f = function
| None -> None
| Some x -> Some (f x);;
let list_option f = function
| None -> []
| Some x -> f x;;
let strategy = function
| Strategy_innermost -> Innermost
| Strategy_innermostLhss _ -> not_supported "innermostLhss"
| Strategy_outermost -> not_supported "outermost";;
let term = Prf_of_newcpf.term false;;
let cpf_rule (l, r) = Util.init_var_map ();
canonical_rule { trs_lhs = term l; trs_rhs = term r; trs_conds = [] };;
let rules = List.map cpf_rule;;
let equation (l, r) = term l, term r;;
let equations = List.map equation;;
let axiom e = Equation e;;
let axioms = List.map axiom;;
let input = function
| Input_trsInput (((rs, st), es), rels) ->
let rs = rules rs
and rels = list_option rules rels
and es = list_option equations es in
let am = arity_map_of_trs_rules (trs_rules_of_equations es @ rels @ rs) in
Trs { trs_symbols = symbset_of_map am;
trs_algebra = Signature am;
trs_axioms = axioms es;
trs_strategy = option strategy st;
trs_le_rules = rels;
trs_rules = rs }
| Input_dpInput (((_, _), _), _)
| Input_orderingConstraints _ -> not_supported "inputs other than TRSs"
| Input_completionInput _ -> not_supported "completionInput"
| Input_equationalReasoningInput _ -> not_supported "equationalReasoningInput"
| Input_complexityInput _ -> not_supported "complexityInput"
| Input_ctrsInput _ -> not_supported "ctrsInput";;
let problem (((i, _), _), _) = input i;;