/****************************/ /* plug-in architecture */ /* of HCLP interpreter */ /* -----kernel module----- */ /* general hierarchy solver */ /* (c) R. Bart‡k */ /* 1996 */ /****************************/ % this module implements a general hierarchy solver using refining method % it is a second kernel component of plug-in architecture for HCLP % to get a complete constraint hierarchy solver, you need to define procedure % solve_level (in CompMod.pr) % consult a meta-interpreter part (MImod.pr) before using this module constr_to_hier(Const,Lab,[C@L|T],[C@L|NewT]):- stronger(L,Lab),!, % L is stronger than Lab constr_to_hier(Const,Lab,T,NewT). constr_to_hier(Const,L,[Cs@L|T],[[Const|Cs]@L|T]):-!. constr_to_hier(Const,Lab,T,[[Const]@Lab|T]). solve_constr_hier([TopLevel@L|WeakerLs],PartAnsws,Answ):- solve_level(TopLevel,PartAnsws,SubAnsws), solve_constr_hier(WeakerLs,SubAnsws,Answ). solve_constr_hier([],AnswList,Answ):- select_answer(Answ,AnswList).