fix cases where you get repeated keys or a(X,X) keys in PFL.
This commit is contained in:
parent
46fbc539bf
commit
6cee85bd60
@ -87,7 +87,8 @@ gen_table(Table, Phi) :-
|
|||||||
|
|
||||||
|
|
||||||
all_tuples(Constraints, Tuple, Tuples) :-
|
all_tuples(Constraints, Tuple, Tuples) :-
|
||||||
setof(Tuple, Constraints^run(Constraints), Tuples).
|
findall(Tuple, run(Constraints), Tuples0),
|
||||||
|
sort(Tuples0, Tuples).
|
||||||
|
|
||||||
|
|
||||||
run([]).
|
run([]).
|
||||||
|
@ -153,12 +153,15 @@ process_arg(Sk, Id, _I) -->
|
|||||||
new_skolem(Sk,D) :-
|
new_skolem(Sk,D) :-
|
||||||
copy_term(Sk, Sk1),
|
copy_term(Sk, Sk1),
|
||||||
skolem(Sk1, D1),
|
skolem(Sk1, D1),
|
||||||
Sk1 =@= Sk,
|
functor(Sk1,N,A),
|
||||||
|
functor(Sk ,N,A),
|
||||||
!,
|
!,
|
||||||
( D1 = D -> true ; throw(pfl(permission_error(redefining_domain(Sk),D:D1)))).
|
( D1 = D -> true ; throw(pfl(permission_error(redefining_domain(Sk),D:D1)))).
|
||||||
new_skolem(Sk,D) :-
|
new_skolem(Sk,D) :-
|
||||||
interface_predicate(Sk),
|
functor(Sk ,N,A),
|
||||||
assert(skolem(Sk, D)).
|
functor(NSk ,N,A),
|
||||||
|
interface_predicate(NSk),
|
||||||
|
assert(skolem(NSk, D)).
|
||||||
|
|
||||||
interface_predicate(Sk) :-
|
interface_predicate(Sk) :-
|
||||||
Sk =.. SKAs,
|
Sk =.. SKAs,
|
||||||
|
Reference in New Issue
Block a user