Compatibility layer for different Prolog implementation -
which best way handle compatibility between 2 different prolog interpreters? i've read question , answers i'm looking methodology coping differently defined predicates (ie delete in swi not variable wise, while under yap is) , newly introduced predicates (ie remove_duplicates not present in library(lists) in swi).
at moment i'm writing file containing of predicates redefinitions of course gets 1 of 2 (or more two) compilers yield warning redefinition.
for sake of semplicity can assume prolog implementation i'm interested in swi , yap. nevertheless general can method highly appreciated.
i think iso prolog should common subset reference.
but libraries massive problem. indeed, experienced issue attempting port swi-prolog snippet yap.
... :- use_module(library(assoc)). :- use_module(library(aggregate)). ...
assoc library implemented differently in these systems, , not able make yap version work (if remember well, gen_assoc((r, c), gridc, char) had different semantic). also, library(aggregate) had problems under yap.
to conditionally compile among these 2 systems, attempted
/* file: prolog_impl.pl author: carlo,,, created: jan 26 2013 purpose: handle swi/yap portability issue */ :- module(prolog_impl, [swi/0, yap/0, prolog_impl/1]). swi :- prolog_impl(swi). yap :- prolog_impl(yap). prolog_impl(k) :- f =.. [k,_,_,_,_], current_prolog_flag(version_data, f).
but of course i'm not satisfied this. hope question bring answer problem.
Comments
Post a Comment