2014-04-09 12:39:29 +01:00
|
|
|
:- system_module( '$_strict_iso', [], ['$check_iso_strict_clause'/1,
|
|
|
|
'$iso_check_goal'/2]).
|
|
|
|
|
|
|
|
:- use_system_module( '$_errors', ['$do_error'/2]).
|
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
'$iso_check_goal'(V,G) :-
|
|
|
|
var(V), !,
|
2002-09-09 18:40:12 +01:00
|
|
|
'$do_error'(instantiation_error,call(G)).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$iso_check_goal'(V,G) :-
|
|
|
|
number(V), !,
|
2014-10-20 09:20:56 +01:00
|
|
|
'$do_error'(type_error(callable,V),G).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$iso_check_goal'(_:G,G0) :- !,
|
|
|
|
'$iso_check_goal'(G,G0).
|
|
|
|
'$iso_check_goal'((G1,G2),G0) :- !,
|
|
|
|
'$iso_check_a_goal'(G1,(G1,G2),G0),
|
|
|
|
'$iso_check_a_goal'(G2,(G1,G2),G0).
|
|
|
|
'$iso_check_goal'((G1;G2),G0) :- !,
|
|
|
|
'$iso_check_a_goal'(G1,(G1;G2),G0),
|
|
|
|
'$iso_check_a_goal'(G2,(G1;G2),G0).
|
2001-10-30 16:42:05 +00:00
|
|
|
'$iso_check_goal'((G1->G2),G0) :- !,
|
2001-04-09 20:54:03 +01:00
|
|
|
'$iso_check_a_goal'(G1,(G1->G2),G0),
|
|
|
|
'$iso_check_a_goal'(G2,(G1->G2),G0).
|
2001-10-30 16:42:05 +00:00
|
|
|
'$iso_check_goal'(!,_) :- !.
|
2001-04-09 20:54:03 +01:00
|
|
|
'$iso_check_goal'((G1|G2),G0) :-
|
2015-06-19 01:30:13 +01:00
|
|
|
current_prolog_flag(language, iso), !,
|
2002-09-09 18:40:12 +01:00
|
|
|
'$do_error'(domain_error(builtin_procedure,(G1|G2)), call(G0)).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$iso_check_goal'((G1|G2),G0) :- !,
|
|
|
|
'$iso_check_a_goal'(G1,(G1|G2),G0),
|
|
|
|
'$iso_check_a_goal'(G2,(G1|G2),G0).
|
|
|
|
'$iso_check_goal'(G,G0) :-
|
2015-06-19 01:30:13 +01:00
|
|
|
current_prolog_flag(language, iso),
|
2002-01-08 05:22:40 +00:00
|
|
|
'$system_predicate'(G,0),
|
2001-04-09 20:54:03 +01:00
|
|
|
(
|
|
|
|
'$iso_builtin'(G)
|
|
|
|
->
|
|
|
|
true
|
|
|
|
;
|
2002-09-09 18:40:12 +01:00
|
|
|
'$do_error'(domain_error(builtin_procedure,G), call(G0))
|
2001-04-09 20:54:03 +01:00
|
|
|
).
|
|
|
|
'$iso_check_goal'(_,_).
|
|
|
|
|
|
|
|
'$iso_check_a_goal'(V,_,G) :-
|
|
|
|
var(V), !,
|
2002-09-09 18:40:12 +01:00
|
|
|
'$do_error'(instantiation_error,call(G)).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$iso_check_a_goal'(V,E,G) :-
|
|
|
|
number(V), !,
|
2014-10-20 09:20:56 +01:00
|
|
|
'$do_error'(type_error(callable,E),call(G)).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$iso_check_a_goal'(_:G,E,G0) :- !,
|
|
|
|
'$iso_check_a_goal'(G,E,G0).
|
2001-05-30 18:04:07 +01:00
|
|
|
'$iso_check_a_goal'((G1,G2),E,G0) :- !,
|
|
|
|
'$iso_check_a_goal'(G1,E,G0),
|
|
|
|
'$iso_check_a_goal'(G2,E,G0).
|
|
|
|
'$iso_check_a_goal'((G1;G2),E,G0) :- !,
|
|
|
|
'$iso_check_a_goal'(G1,E,G0),
|
|
|
|
'$iso_check_a_goal'(G2,E,G0).
|
|
|
|
'$iso_check_a_goal'((G1->G2),E,G0) :- !,
|
|
|
|
'$iso_check_a_goal'(G1,E,G0),
|
|
|
|
'$iso_check_a_goal'(G2,E,G0).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$iso_check_a_goal'(!,_,_) :- !.
|
|
|
|
'$iso_check_a_goal'((_|_),E,G0) :-
|
2015-06-19 01:30:13 +01:00
|
|
|
current_prolog_flag(language, iso), !,
|
2002-09-09 18:40:12 +01:00
|
|
|
'$do_error'(domain_error(builtin_procedure,E), call(G0)).
|
2001-10-30 16:42:05 +00:00
|
|
|
'$iso_check_a_goal'((_|_),_,_) :- !.
|
2001-04-09 20:54:03 +01:00
|
|
|
'$iso_check_a_goal'(G,_,G0) :-
|
2015-06-19 01:30:13 +01:00
|
|
|
current_prolog_flag(language, iso),
|
2002-01-08 05:22:40 +00:00
|
|
|
'$system_predicate'(G,0),
|
2001-04-09 20:54:03 +01:00
|
|
|
(
|
|
|
|
'$iso_builtin'(G)
|
|
|
|
->
|
|
|
|
true
|
|
|
|
;
|
2002-09-09 18:40:12 +01:00
|
|
|
'$do_error'(domain_error(builtin_procedure,G), call(G0))
|
2001-04-09 20:54:03 +01:00
|
|
|
).
|
|
|
|
'$iso_check_a_goal'(_,_,_).
|
|
|
|
|
2001-10-30 16:42:05 +00:00
|
|
|
'$check_iso_strict_clause'((_:-B)) :- !,
|
2001-04-09 20:54:03 +01:00
|
|
|
'$check_iso_strict_body'(B).
|
2001-10-30 16:42:05 +00:00
|
|
|
'$check_iso_strict_clause'(_).
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
'$check_iso_strict_body'((B1,B2)) :- !,
|
|
|
|
'$check_iso_strict_body'(B1),
|
|
|
|
'$check_iso_strict_body'(B2).
|
|
|
|
'$check_iso_strict_body'((B1;B2)) :- !,
|
|
|
|
'$check_iso_strict_body'(B1),
|
|
|
|
'$check_iso_strict_body'(B2).
|
|
|
|
'$check_iso_strict_body'((B1->B2)) :- !,
|
|
|
|
'$check_iso_strict_body'(B1),
|
|
|
|
'$check_iso_strict_body'(B2).
|
|
|
|
'$check_iso_strict_body'(B) :-
|
|
|
|
'$check_iso_strict_goal'(B).
|
|
|
|
|
|
|
|
'$check_iso_strict_goal'(G) :-
|
2002-01-08 05:22:40 +00:00
|
|
|
'$system_predicate'(G,0), !,
|
2001-04-09 20:54:03 +01:00
|
|
|
'$check_iso_system_goal'(G).
|
|
|
|
'$check_iso_strict_goal'(_).
|
|
|
|
|
|
|
|
|
|
|
|
'$check_iso_system_goal'(G) :-
|
|
|
|
'$iso_builtin'(G), !.
|
|
|
|
'$check_iso_system_goal'(G) :-
|
2002-09-09 18:40:12 +01:00
|
|
|
'$do_error'(domain_error(builtin_procedure,G), G).
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
'$iso_builtin'(abolish(_)).
|
2012-03-23 14:42:26 +00:00
|
|
|
'$iso_builtin'(acylic_term(_)).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$iso_builtin'(arg(_,_,_)).
|
|
|
|
'$iso_builtin'(_=:=_).
|
|
|
|
'$iso_builtin'(_=\=_).
|
|
|
|
'$iso_builtin'(_>_).
|
|
|
|
'$iso_builtin'(_>=_).
|
|
|
|
'$iso_builtin'(_<_).
|
|
|
|
'$iso_builtin'(_=<_).
|
|
|
|
'$iso_builtin'(asserta(_)).
|
|
|
|
'$iso_builtin'(assertz(_)).
|
|
|
|
'$iso_builtin'(at_end_of_stream).
|
|
|
|
'$iso_builtin'(at_end_of_stream(_)).
|
|
|
|
'$iso_builtin'(atom(_)).
|
|
|
|
'$iso_builtin'(atom_chars(_,_)).
|
|
|
|
'$iso_builtin'(atom_codes(_,_)).
|
|
|
|
'$iso_builtin'(atom_concat(_,_,_)).
|
|
|
|
'$iso_builtin'(atom_length(_,_)).
|
|
|
|
'$iso_builtin'(atomic(_)).
|
|
|
|
'$iso_builtin'(bagof(_,_,_)).
|
|
|
|
'$iso_builtin'(call(_)).
|
2012-03-23 14:42:26 +00:00
|
|
|
'$iso_builtin'(call(_,_)).
|
|
|
|
'$iso_builtin'(call(_,_,_)).
|
|
|
|
'$iso_builtin'(call(_,_,_,_)).
|
|
|
|
'$iso_builtin'(call(_,_,_,_,_)).
|
|
|
|
'$iso_builtin'(call(_,_,_,_,_,_)).
|
|
|
|
'$iso_builtin'(call(_,_,_,_,_,_,_)).
|
|
|
|
'$iso_builtin'(call(_,_,_,_,_,_,_,_)).
|
|
|
|
'$iso_builtin'(callable(_)).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$iso_builtin'(catch(_,_,_)).
|
|
|
|
'$iso_builtin'(char_code(_,_)).
|
|
|
|
'$iso_builtin'(char_conversion(_,_)).
|
|
|
|
'$iso_builtin'(clause(_,_)).
|
|
|
|
'$iso_builtin'(close(_)).
|
|
|
|
'$iso_builtin'(close(_,_)).
|
2012-03-23 14:42:26 +00:00
|
|
|
'$iso_builtin'(compare(_,_,_)).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$iso_builtin'(compound(_)).
|
|
|
|
'$iso_builtin'((_,_)).
|
|
|
|
'$iso_builtin'(copy_term(_,_)).
|
|
|
|
'$iso_builtin'(current_char_conversion(_,_)).
|
|
|
|
'$iso_builtin'(current_input(_)).
|
|
|
|
'$iso_builtin'(current_op(_,_,_)).
|
|
|
|
'$iso_builtin'(current_output(_)).
|
|
|
|
'$iso_builtin'(current_predicate(_)).
|
|
|
|
'$iso_builtin'(current_prolog_flag(_,_)).
|
|
|
|
'$iso_builtin'(!).
|
|
|
|
'$iso_builtin'((_;_)).
|
|
|
|
'$iso_builtin'(fail).
|
2012-03-23 14:42:26 +00:00
|
|
|
'$iso_builtin'(false).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$iso_builtin'(findall(_,_,_)).
|
|
|
|
'$iso_builtin'(float(_)).
|
|
|
|
'$iso_builtin'(abort).
|
|
|
|
'$iso_builtin'(flush_output).
|
|
|
|
'$iso_builtin'(flush_output(_)).
|
|
|
|
'$iso_builtin'(functor(_,_,_)).
|
|
|
|
'$iso_builtin'(get_byte(_)).
|
|
|
|
'$iso_builtin'(get_byte(_,_)).
|
|
|
|
'$iso_builtin'(get_char(_)).
|
|
|
|
'$iso_builtin'(get_char(_,_)).
|
|
|
|
'$iso_builtin'(get_code(_)).
|
|
|
|
'$iso_builtin'(get_code(_,_)).
|
2012-03-23 14:42:26 +00:00
|
|
|
'$iso_builtin'(ground(_)).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$iso_builtin'(halt).
|
|
|
|
'$iso_builtin'(halt(_)).
|
|
|
|
'$iso_builtin'((_->_)).
|
|
|
|
'$iso_builtin'(integer(_)).
|
|
|
|
'$iso_builtin'(_ is _).
|
2012-03-23 14:42:26 +00:00
|
|
|
'$iso_builtin'(keysort(_,_)).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$iso_builtin'(nl).
|
|
|
|
'$iso_builtin'(nl(_)).
|
|
|
|
'$iso_builtin'(nonvar(_)).
|
|
|
|
'$iso_builtin'(\+(_)).
|
|
|
|
'$iso_builtin'(number(_)).
|
|
|
|
'$iso_builtin'(number_chars(_,_)).
|
|
|
|
'$iso_builtin'(number_codes(_,_)).
|
|
|
|
'$iso_builtin'(once(_)).
|
|
|
|
'$iso_builtin'(op(_,_,_)).
|
|
|
|
'$iso_builtin'(open(_,_,_)).
|
|
|
|
'$iso_builtin'(open(_,_,_,_)).
|
|
|
|
'$iso_builtin'(peek_byte(_)).
|
|
|
|
'$iso_builtin'(peek_byte(_,_)).
|
|
|
|
'$iso_builtin'(peek_char(_)).
|
|
|
|
'$iso_builtin'(peek_char(_,_)).
|
|
|
|
'$iso_builtin'(peek_code(_)).
|
|
|
|
'$iso_builtin'(peek_code(_,_)).
|
|
|
|
'$iso_builtin'(put_byte(_)).
|
|
|
|
'$iso_builtin'(put_byte(_,_)).
|
|
|
|
'$iso_builtin'(put_char(_)).
|
|
|
|
'$iso_builtin'(put_char(_,_)).
|
|
|
|
'$iso_builtin'(put_code(_)).
|
|
|
|
'$iso_builtin'(put_code(_,_)).
|
|
|
|
'$iso_builtin'(read(_)).
|
|
|
|
'$iso_builtin'(read(_,_)).
|
|
|
|
'$iso_builtin'(read_term(_,_)).
|
|
|
|
'$iso_builtin'(read_term(_,_,_)).
|
|
|
|
'$iso_builtin'(repeat).
|
|
|
|
'$iso_builtin'(retract(_)).
|
2012-03-23 14:42:26 +00:00
|
|
|
'$iso_builtin'(retractall(_)).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$iso_builtin'(set_input(_)).
|
|
|
|
'$iso_builtin'(set_output(_)).
|
|
|
|
'$iso_builtin'(set_prolog_flag(_,_)).
|
|
|
|
'$iso_builtin'(set_stream_position(_,_)).
|
|
|
|
'$iso_builtin'(setof(_,_,_)).
|
2012-03-23 14:42:26 +00:00
|
|
|
'$iso_builtin'(sort(_,_)).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$iso_builtin'(stream_property(_,_)).
|
|
|
|
'$iso_builtin'(sub_atom(_,_,_,_,_)).
|
2012-03-23 14:42:26 +00:00
|
|
|
'$iso_builtin'(subsumes_term(_,_)).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$iso_builtin'(_@>_).
|
|
|
|
'$iso_builtin'(_@>=_).
|
|
|
|
'$iso_builtin'(_==_).
|
|
|
|
'$iso_builtin'(_@<_).
|
|
|
|
'$iso_builtin'(_@=<_).
|
|
|
|
'$iso_builtin'(_\==_).
|
2012-03-23 14:42:26 +00:00
|
|
|
'$iso_builtin'(term_variables(_,_)).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$iso_builtin'(throw(_)).
|
|
|
|
'$iso_builtin'(true).
|
|
|
|
'$iso_builtin'(_\=_).
|
|
|
|
'$iso_builtin'(_=_).
|
|
|
|
'$iso_builtin'(unify_with_occurs_check(_,_)).
|
|
|
|
'$iso_builtin'(_384=.._385).
|
|
|
|
'$iso_builtin'(var(_)).
|
|
|
|
'$iso_builtin'(write(_)).
|
|
|
|
'$iso_builtin'(write(_,_)).
|
|
|
|
'$iso_builtin'(write_canonical(_)).
|
|
|
|
'$iso_builtin'(write_canonical(_,_)).
|
|
|
|
'$iso_builtin'(write_term(_,_)).
|
|
|
|
'$iso_builtin'(write_term(_,_,_)).
|
|
|
|
'$iso_builtin'(writeq(_)).
|
|
|
|
'$iso_builtin'(writeq(_,_)).
|
|
|
|
|