set_data added

git-svn-id: https://projects.brucker.ch/su4sml/svn/su4sml/trunk@7933 3260e6d1-4efc-4170-b0a7-36055960796d
This commit is contained in:
Manuel Krucker 2008-05-09 14:37:06 +00:00
parent 1ff167b556
commit c104e1e43c
1 changed files with 43 additions and 24 deletions

View File

@ -425,6 +425,19 @@ fun is_pog (WFCPOG.WFPO wfpo) = case #apply wfpo of
WFCPOG.POG _ => true WFCPOG.POG _ => true
| _ => false | _ => false
fun set_data (new_data:Object.T table) (WFCPOG.WFPO{identifier,name,description,recommended,depends,recommends,apply,data}) =
WFCPOG.WFPO{
identifier = identifier,
name = name,
description=description,
recommended=recommended,
depends=depends,
recommends=recommends,
apply=apply,
data=new_data
}
fun check_wfc model wfc = fun check_wfc model wfc =
let let
@ -445,7 +458,7 @@ fun check_wfcs model wfcs =
then [(check_wfc model a)] then [(check_wfc model a)]
else else
let let
val depending_wfpos = List.map (get_wfpo supported) depends val depending_wfpos = List.map (set_data (get_wfpo supported)) depends
val depending_wfcs = List.filter (fn b => val depending_wfcs = List.filter (fn b =>
case (WFCPOG.apply_of b) of case (WFCPOG.apply_of b) of
WFCPOG.WFC(x) => true WFCPOG.WFC(x) => true
@ -473,30 +486,36 @@ fun generate_po model po =
res res
end end
fun generate_pos model pos = fun generate_pos model pos =
List.concat (map (fn (a as (WFCPOG.WFPO{identifier,name,description,recommended,depends,recommends,apply,data}:WFCPOG.wfpo)) => let
if (depends = []) val _ = trace function_calls ("WFCPOG_Registry.generate_pos\n")
then [(generate_po model a)] val res =
else List.concat (map (fn (a as (WFCPOG.WFPO{identifier,name,description,recommended,depends,recommends,apply,data}:WFCPOG.wfpo)) =>
let if (depends = [])
val depending_wfpos = List.map (get_wfpo supported) depends then [(generate_po model a)]
val depending_wfcs = List.filter (fn b => else
case (WFCPOG.apply_of b)of let
WFCPOG.WFC(x) => true val depending_wfpos = List.map (set_data (get_wfpo supported)) depends
| WFCPOG.POG(x) => false) depending_wfpos val depending_wfcs = List.filter (fn b =>
val depending_pos = List.filter (fn b => case (WFCPOG.apply_of b)of
case (WFCPOG.apply_of b) of WFCPOG.WFC(x) => true
WFCPOG.WFC(x) => false | WFCPOG.POG(x) => false) depending_wfpos
| WFCPOG.POG(x) => true) depending_wfpos val depending_pos = List.filter (fn b =>
val check = List.map (check_wfc model) depending_wfcs case (WFCPOG.apply_of b) of
in WFCPOG.WFC(x) => false
if (List.all (fn (wfc,x) => x = true) check) | WFCPOG.POG(x) => true) depending_wfpos
then (List.map (generate_po model) depending_pos)@[(generate_po model a)] val check = List.map (check_wfc model) depending_wfcs
else (* doesn't matter, because WFCPOG_WFC_FailedException is returned *) in
[] if (List.all (fn (wfc,x) => x = true) check)
end) pos) then (List.map (generate_po model) depending_pos)@[(generate_po model a)]
else (* doesn't matter, because WFCPOG_WFC_FailedException is returned *)
[]
end) pos)
val _ = trace function_ends ("WFCPOG_Registry.generate_pos\n")
in
res
end
fun create_wfc_tax i = (WFCPOG_Taxonomy_Constraint.WFCPOG_TAX_Data.put ({key=9,max_depth=i}) tax_workaround) fun create_wfc_tax i = (WFCPOG_Taxonomy_Constraint.WFCPOG_TAX_Data.put ({key=9,max_depth=i}) tax_workaround)
fun wf_is_supported_id wfpo_id = List.exists (fn w => wfpo_id = id_of w) supported_wfs fun wf_is_supported_id wfpo_id = List.exists (fn w => wfpo_id = id_of w) supported_wfs