Skip to content

Commit 7d59950

Browse files
committed
about to unbreak the compiler again
1 parent e130e11 commit 7d59950

15 files changed

+494
-160
lines changed

prolog/metta_lang/metta_compiler.pl

Lines changed: 98 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,31 @@
9595
:- dynamic(metta_compiled_predicate/3).
9696
:- multifile(metta_compiled_predicate/3).
9797

98+
%setup_mi_me(FnName,LenArgs,_InternalTypeArgs,_InternalTypeResult) :- !.
99+
setup_mi_me(FnName,LenArgs,InternalTypeArgs,InternalTypeResult) :-
100+
debug_info(always(setup_mi_me),setup_mi_me(FnName,LenArgs,InternalTypeArgs,InternalTypeResult)),
101+
must_det_lls((
102+
sum_list(LenArgs,LenArgsTotal),
103+
LenArgsTotalPlus1 is LenArgsTotal+1,
104+
findall(Atom0, (between(1, LenArgsTotalPlus1, I0) ,Atom0='$VAR'(I0)), AtomList0),
105+
create_prefixed_name('mc_',LenArgs,FnName,FnNameWPrefix),
106+
Hc =.. [FnNameWPrefix|AtomList0],
107+
create_prefixed_name('mi_',LenArgs,FnName,FnNameWMiPrefix),
108+
Hi =.. [FnNameWMiPrefix|AtomList0],
109+
create_prefixed_name('me_',LenArgs,FnName,FnNameWMePrefix),
110+
He =.. [FnNameWMePrefix|AtomList0],
111+
append(Eval,[RetVal],[FnName|AtomList0]),
112+
Bi = ci(true,FnName,LenArgsTotal,Eval,RetVal,true,Goal),
113+
% Bi =.. [ci,true,[],true,Goal],
114+
compiler_assertz(Hi:-((Goal=Hc),Bi)),
115+
compiler_assertz(He:-Hc))).
116+
117+
setup_library_call(Source,FnName,LenArgs,MettaTypeArgs,MettaTypeResult,InternalTypeArgs,InternalTypeResult) :-
118+
(transpiler_predicate_store(_,FnName,LenArgs,_,_,_,_) -> true ;
119+
compiler_assertz(transpiler_predicate_store(Source,FnName,LenArgs,MettaTypeArgs,MettaTypeResult,InternalTypeArgs,InternalTypeResult))),
120+
setup_mi_me(FnName,LenArgs,InternalTypeArgs,InternalTypeResult)
121+
.
122+
98123

99124
% =======================================
100125
% TODO move non flybase specific code between here and the compiler
@@ -209,6 +234,9 @@
209234
% N = expr code
210235
% C = common code tp be called before both the exec and expr cases
211236

237+
238+
as_p1_exec(X,X) :- \+ compound(X), !.
239+
% as_p1_exec(X,Y) :- as_p1_expr(X,S),eval(S,Y).
212240
as_p1_exec(ispu(URet),URet) :- !.
213241
as_p1_exec(ispuU(URet,UCode),URet) :- !, call(UCode).
214242
as_p1_exec(ispeEn(ERet,ECode,_),ERet) :- !, call(ECode).
@@ -217,8 +245,9 @@
217245
as_p1_exec(rtrace(T),TRet) :- !, rtrace(as_p1_exec(T,TRet)).
218246
as_p1_exec(call(P1,T),TRet) :- !, call(P1,as_p1_exec(T,TRet)).
219247
as_p1_exec(X,Y) :- as_p1_expr(X,S),eval(S,Y).
248+
%as_p1_exec(X,X) :- !.
220249

221-
250+
as_p1_expr(X,X) :- \+ compound(X), !.
222251
as_p1_expr(ispu(URet),URet) :- !.
223252
as_p1_expr(ispuU(URet,UCode),URet) :- !, call(UCode).
224253
as_p1_expr(ispeEn(_,_,NRet),NRet).
@@ -283,6 +312,8 @@
283312
must_use_compiler(Fn,disable_interp(Fn)):- nb_current(disable_interp,WasDC), member(Fn,WasDC).
284313
must_use_compiler(Fn,interp_disabled(Fn)):- use_evaluator(fa(Fn, _), interp, disabled).
285314

315+
ci(_,_,_,G):- call(G).
316+
286317
% Compiler is Disabled for Fn
287318
ci(PreInterp,Fn,Len,Eval,RetVal,_PreComp,_Compiled):- fail,
288319
once(must_use_interp(Fn,Why,TF)),
@@ -413,7 +444,7 @@
413444
;
414445
% new, insert clause
415446
current_compiler_context(CompCtx), % where expected to be stored (builtin,user,etc)
416-
compiler_assertz(transpiler_predicate_store(CompCtx,FnName,LenArgs,todo,todo,FinalLazyArgsAdj,FinalLazyRetAdj)),
447+
setup_library_call(CompCtx,FnName,LenArgs,todo,todo,FinalLazyArgsAdj,FinalLazyRetAdj),
417448
recompile_from_depends(FnName,LenArgs)
418449
).
419450

@@ -451,7 +482,7 @@
451482
recompile_from_depends(FnName,LenArgs) :-
452483
transpiler_debug(2,(format_e("recompile_from_depends ~w/~w\n",[FnName,LenArgs]))),
453484
%LenArgs is LenArgsPlus1-1,
454-
%create_mc_name(LenArgs,,FnName,FnNameWPrefix),
485+
%create_prefixed_name('mc_',LenArgs,,FnName,FnNameWPrefix),
455486
%findall(Atom0, (between(1, LenArgsPlus1, I0) ,Atom0='$VAR'(I0)), AtomList0),
456487
%H @.. [FnNameWPrefix|AtomList0],
457488
%transpiler_debug(2,format_e("Retracting stub: ~q\n",[H]) ; true),
@@ -486,8 +517,12 @@
486517
%format_e("recompile_from_depends_child ~w/~w\n",[Fn,Arity]),flush_output(user_output),
487518
ArityP1 is Arity+1,
488519
%retract(transpiler_predicate_store(_,Fn,Arity,_,_,_,_)),
489-
create_mc_name(Arity,Fn,FnWPrefix),
520+
create_prefixed_name('mc_',Arity,Fn,FnWPrefix),
490521
abolish(FnWPrefix/ArityP1),
522+
% create_prefixed_name('mi_',Arity,Fn,FnWMiPrefix),
523+
% abolish(FnWMiPrefix/ArityP1),
524+
% create_prefixed_name('me_',Arity,Fn,FnWMePrefix),
525+
% abolish(FnWMePrefix/ArityP1),
491526
% retract(transpiler_stub_created(Fn,Arity)),
492527
% create an ordered list of integers to make sure to do them in order
493528
findall(ClauseIDt,transpiler_clause_store(Fn,Arity,ClauseIDt,_,_,_,_,_,_),ClauseIdList),
@@ -525,7 +560,7 @@
525560
subst_varnames(HeadIsIn+AsBodyFnIn,HeadIs+AsBodyFn),
526561
%leash(-all),trace,
527562
get_curried_name_structure(HeadIs,FnName,Args,LenArgs),
528-
create_mc_name(LenArgs,FnName,FnNameWPrefix),
563+
create_prefixed_name('mc_',LenArgs,FnName,FnNameWPrefix),
529564
%ensure_callee_site(Space,FnName,LenArgs),
530565
remove_stub(Space,FnName,LenArgs),
531566
sum_list(LenArgs,LenArgsTotal),
@@ -534,11 +569,18 @@
534569
% retract any stubs
535570

536571
(transpiler_stub_created(FnName,LenArgs) ->
537-
retract(transpiler_stub_created(FnName,LenArgs)),
572+
(retract(transpiler_stub_created(FnName,LenArgs)),
538573
findall(Atom0, (between(1, LenArgsTotalPlus1, I0) ,Atom0='$VAR'(I0)), AtomList0),
539574
H @.. [FnNameWPrefix|AtomList0],
540575
transpiler_debug(2,format_e("Retracting stub: ~q\n",[H]) ; true),
541-
retractall(H)
576+
retractall(H),
577+
%create_prefixed_name('mi_',LenArgs,FnName,FnNameWMiPrefix),
578+
%H1 @.. [FnNameWMiPrefix|AtomList0],
579+
%retractall(H1),
580+
%create_prefixed_name('me_',LenArgs,FnName,FnNameWMePrefix),
581+
%H2 @.. [FnNameWMePrefix|AtomList0],
582+
%retractall(H2),
583+
true)
542584
; true),
543585

544586
%AsFunction = HeadIs,
@@ -570,7 +612,7 @@
570612
%precompute_typeinfo(HResult,HeadIs,AsBodyFn,Ast,TypeInfo),
571613

572614
%get_property_lazy(FinalLazyRet,FinalLazyOnlyRet),
573-
615+
setup_mi_me(FnName,LenArgs,FinalLazyArgsAdj,FinalLazyRetAdj),
574616
OldExpr = [defn,HeadIs,AsBodyFn],
575617

576618
combine_transform_and_collect(OldExpr, Assignments, _NewExpr, VarMappings),
@@ -599,7 +641,7 @@
599641
%(var(HResult) -> (Result = HResult, HHead = Head) ;
600642
% funct_with_result_is_nth_of_pred(HeadIs,AsFunction, Result, _Nth, Head)),
601643

602-
HeadAST=[assign,HResult,[fcall(FnName,LenArgs),Args2]],
644+
HeadAST=[assign,HResult,[hcall(FnName,LenArgs),Args2]],
603645
(transpiler_trace(FnName) -> Prefix=[[native(trace)]] ; Prefix=[]),
604646
append([Prefix|Code],CodeAppend),
605647
append(CodeAppend,FullCode,FullCode2),
@@ -1084,7 +1126,7 @@
10841126
;
10851127
(transpiler_enable_interpreter_calls ->
10861128
% create a stub to call the interpreter
1087-
(create_mc_name(LenArgs,Fn,Fp),
1129+
(create_prefixed_name('mc_',LenArgs,Fn,Fp),
10881130
(current_predicate(Fp/LenArgs) -> true ;
10891131
LenArgs1 is LenArgs+1,
10901132
findall(Atom0, (between(1, LenArgs1, I0) ,Atom0='$VAR'(I0)), AtomList0),
@@ -1171,7 +1213,8 @@
11711213
maplist(lazy_impedance_match, LazyResultParts, EvalArgs, RetResultsParts, ConvertedParts, RetResultsPartsN, ConvertedNParts, RetResults, Converteds),
11721214
append(Converteds,Converteds2),
11731215
%append(RetResults,[RetResult],RetResults2),
1174-
create_mc_name(LenArgs,'',Prefix),
1216+
% BEER this is where to change the call to another function
1217+
create_prefixed_name('mc_',LenArgs,'',Prefix),
11751218
invert_curried_structure(Fn,LenArgs,RetResults,RecurriedList),
11761219
append(Converteds2,[[transpiler_apply,Prefix,Fn,RecurriedList,RetResult,RetResultsParts, RetResultsPartsN, LazyResultParts,ConvertedParts, ConvertedNParts]],Converted),
11771220
assign_or_direct_var_only(Converteds2,RetResultN,list(RecurriedList),ConvertedN).
@@ -1360,7 +1403,30 @@
13601403
maybe_lazy_list(Caller,F,1,Args00,Args0),
13611404
%label_arg_types(F,1,Args0),
13621405
maplist(ast_to_prolog_aux(Caller,DontStub),Args0,Args1),
1363-
create_mc_name(LenArgs,F,Fp),
1406+
create_prefixed_name('mi_',LenArgs,F,Fp), % TODO
1407+
%label_arg_types(F,0,[A|Args1]),
1408+
%LenArgs1 is LenArgs+1,
1409+
append(Args1,[A],Args2),
1410+
R ~.. [f(FIn),Fp|Args2],
1411+
(Caller=caller(CallerInt,CallerSz),(CallerInt-CallerSz)\=(F-LenArgs),\+ transpiler_depends_on(CallerInt,CallerSz,F,LenArgs) ->
1412+
compiler_assertz(transpiler_depends_on(CallerInt,CallerSz,F,LenArgs)),
1413+
transpiler_debug(2,format_e("Asserting: transpiler_depends_on(~q,~q,~q,~q)\n",[CallerInt,CallerSz,F,LenArgs]))
1414+
; true)
1415+
%sum_list(LenArgs,LenArgsTotal),
1416+
%LenArgsTotalPlus1 is LenArgsTotal+1,
1417+
%((current_predicate(Fp/LenArgsTotalPlus1);member(F/LenArgs,DontStub)) ->
1418+
% true
1419+
%; check_supporting_predicates('&self',F/LenArgs))
1420+
%notice_callee(Caller,F/LenArgs)
1421+
)).
1422+
ast_to_prolog_aux(Caller,DontStub,[assign,A,[hcall(FIn,LenArgs),ArgsIn]],R) :- (fullvar(A); \+ compound(A)),callable(FIn),!,
1423+
must_det_lls((
1424+
FIn @.. [F|Pre], % allow compound natives
1425+
append(Pre,ArgsIn,Args00),
1426+
maybe_lazy_list(Caller,F,1,Args00,Args0),
1427+
%label_arg_types(F,1,Args0),
1428+
maplist(ast_to_prolog_aux(Caller,DontStub),Args0,Args1),
1429+
create_prefixed_name('mc_',LenArgs,F,Fp),
13641430
%label_arg_types(F,0,[A|Args1]),
13651431
%LenArgs1 is LenArgs+1,
13661432
append(Args1,[A],Args2),
@@ -1380,7 +1446,7 @@
13801446
must_det_lls((
13811447
maybe_lazy_list(Caller,F,1,ArgsIn,Args0),
13821448
maplist(ast_to_prolog_aux(Caller,DontStub),Args0,Args1),
1383-
create_mc_name(LenArgs,F,Fp),
1449+
create_prefixed_name('mc_',LenArgs,F,Fp),
13841450
append(Args1,[A],Args2),
13851451
R0 =..[Fp,XX],
13861452
R1=..[apply_fn,XX,Args2],
@@ -1396,7 +1462,7 @@
13961462
%label_arg_types(FIn,1,Args0),
13971463
maplist(ast_to_prolog_aux(Caller,DontStub),Args0,Args1),
13981464
append(LenArgsRest,LenArgs,LenArgsAll),
1399-
create_mc_name(LenArgsAll,FIn,Fp),
1465+
create_prefixed_name('mc_',LenArgsAll,FIn,Fp),
14001466
%label_arg_types(FIn,0,[A|Args1]),
14011467
%LenArgs1 is LenArgs+1,
14021468
R0 ~.. [xxx(4),Fp|Args1],
@@ -1443,7 +1509,7 @@
14431509
% label_arg_types(F,1,Args0),
14441510
% maplist(ast_to_prolog_aux(Caller,DontStub),Args0,Args1),
14451511
% length(Args0,LenArgs),
1446-
% create_mc_name(LenArgs,F,Fp),
1512+
% create_prefixed_name('mc_',LenArgs,F,Fp),
14471513
% label_arg_types(F,0,[A|Args1]),
14481514
% %LenArgs1 is LenArgs+1,
14491515
% append(Args1,[A],Args2),
@@ -1770,13 +1836,15 @@
17701836
correct_assertz(Info,Info).
17711837

17721838

1773-
is_prolog_code(Info):- strip_module(Info,_,Neck), compound(Neck), compound_name_arity(Neck,F,_),
1774-
(Neck == ':-' ; \+ compiler_data(F/_)),!.
1839+
is_prolog_rule(Info):- strip_module(Info,_,Neck), compound(Neck), compound_name_arity(Neck,F,_), F == ':-'.
1840+
is_compiler_data(Info):- strip_module(Info,_,Neck), compound(Neck), compound_name_arity(Neck,F,_), compiler_data(F/_),!.
17751841

17761842
compiler_assertz(Info):- is_list(Info),!,maplist(compiler_assertz,Info),fail.
17771843

17781844
compiler_assertz(Info):-
1779-
(is_prolog_code(Info)-> debug_info(assertz_code, t(Info)); debug_info(compiler_assertz, Info)),fail.
1845+
(is_prolog_rule(Info)-> debug_info(assertz_code, t(Info));
1846+
(is_compiler_data(Info)-> debug_info(assertz_compiler_data, t(Info));
1847+
debug_info(compiler_assertz, Info))),fail.
17801848

17811849
compiler_assertz(Info):- (once(correct_assertz(Info,InfoC))),Info\=@=InfoC,!,
17821850
debug_info(compiler_assertz,correct_assertz(ca)),
@@ -1809,6 +1877,8 @@
18091877
maybe_write_info(Info):- string(Info),!,writeln(Info).
18101878
maybe_write_info(Info):- \+ compound(Info),!, ppt(Info).
18111879
maybe_write_info(Info):- \+ \+ (no_conflict_numbervars(Info), maybe_write_info0(Info)).
1880+
maybe_write_info0((:-B)):- compound(B),gensym(top_call_,Sym),maybe_write_info0((Sym:-B)), maybe_write_info0((:- Sym)).
1881+
maybe_write_info0((:-B)):- into_plnamed((:- time(B)),Info2), !,nl,nl, no_conflict_numbervars(Info2), portray_clause(Info2), nl,nl.
18121882
maybe_write_info0((H:-B)):- into_plnamed((H:-B),Info2), !,nl,nl, no_conflict_numbervars(Info2),ppt(Info2), nl,nl.
18131883
maybe_write_info0(Info):- into_plnamed(Info,Info2), !, writeq(Info2),writeln('.').
18141884

@@ -1835,6 +1905,7 @@
18351905
writeln(":- include(library(metta_lang/metta_transpiled_header))."),
18361906
writeln("%:- ensure_loaded(library(metta_lang/metta_interp))."),
18371907
writeln(":- ensure_loaded(library(metta_rt)). % avoids starting the REPL"),
1908+
writeln(":- setup_library_calls."),
18381909
writeln(":- style_check(-discontiguous)."),
18391910
writeln(":- style_check(-singleton)."),
18401911
nl.
@@ -1862,7 +1933,7 @@
18621933

18631934
skip_redef_fa(Fn,Arity) :- integer(Arity),!,skip_redef_fa(Fn,[Arity]).
18641935
skip_redef_fa(Fn,LenArgs) :-
1865-
create_mc_name(LenArgs,Fn,FnWPrefix),
1936+
create_prefixed_name('mc_',LenArgs,Fn,FnWPrefix),
18661937
sum_list(LenArgs,LenArgsTotal),
18671938
LenArgsTotalPlus1 is LenArgsTotal+1,
18681939
functor(Info,FnWPrefix,LenArgsTotalPlus1),
@@ -2366,21 +2437,21 @@
23662437
true))))))),!.
23672438

23682439
%transpile_prefix('').
2369-
transpile_impl_prefix('mi_').
2440+
transpile_impl_prefix('mi__1_').
23702441
:- dynamic(is_transpile_impl_prefix/3).
23712442
transpile_impl_prefix(F,Arity,Fn):- is_transpile_impl_prefix(F,Arity,Fn)*->true;(transpile_impl_prefix(Prefix),FNArity is Arity-1,atomic_list_concat([Prefix,FNArity,'__',F],Fn),asserta(is_transpile_impl_prefix(F,Arity,Fn))).
23722443

2373-
transpile_call_prefix('mc_').
2444+
transpile_call_prefix('mc__1_').
23742445
:- dynamic(is_transpile_call_prefix/3).
23752446
transpile_call_prefix(F,Arity,Fn):- is_transpile_call_prefix(F,Arity,Fn)*->true;(transpile_call_prefix(Prefix),FNArity is Arity-1,atomic_list_concat([Prefix,FNArity,'__',F],Fn),asserta(is_transpile_call_prefix(F,Arity,Fn))).
23762447

23772448

23782449
prefix_impl_preds(Prefix,F,A):- prefix_impl_preds_pp(Prefix,F,A).
2379-
prefix_impl_preds('mc_',F,A):- is_transpile_call_prefix(F,A,Fn),current_predicate(Fn/A), \+ prefix_impl_preds_pp(_,F,A).
2380-
prefix_impl_preds('mi_',F,A):- is_transpile_impl_prefix(F,A,Fn),current_predicate(Fn/A), \+ prefix_impl_preds_pp(_,F,A).
2450+
prefix_impl_preds('mc__1_',F,A):- is_transpile_call_prefix(F,A,Fn),current_predicate(Fn/A), \+ prefix_impl_preds_pp(_,F,A).
2451+
prefix_impl_preds('mi__1_',F,A):- is_transpile_impl_prefix(F,A,Fn),current_predicate(Fn/A), \+ prefix_impl_preds_pp(_,F,A).
23812452

2382-
prefix_impl_preds_pp(Prefix,F,A):- predicate_property('mc_2__:'(_,_,_),file(File)),predicate_property(Preds,file(File)),functor(Preds,Fn,A),
2383-
((transpile_impl_prefix(Prefix);transpile_call_prefix(Prefix)),atom_list_concat([Prefix,_FNArity,'__',F],Fn)).
2453+
prefix_impl_preds_pp(Prefix,F,A):- predicate_property('mc__1_2_:'(_,_,_),file(File)),predicate_property(Preds,file(File)),functor(Preds,Fn,A),
2454+
((transpile_impl_prefix(Prefix);transpile_call_prefix(Prefix)),atom_list_concat([Prefix,_FNArity,'_',F],Fn)).
23842455

23852456
maplist_and_conj(_,A,B):- fullvar(A),!,B=A.
23862457
maplist_and_conj(_,A,B):- \+ compound(A),!,B=A.
@@ -2819,7 +2890,7 @@
28192890

28202891
check_supporting_predicates(Space,F/A) :- % already exists
28212892
%trace,
2822-
create_mc_name(A,F,Fp),
2893+
create_prefixed_name('mc_',A,F,Fp),
28232894
with_mutex_maybe(transpiler_mutex_lock,
28242895
(sum_list(A,ATot),ATot1 is ATot+1,
28252896
(current_predicate(Fp/ATot1) -> true ;
@@ -3267,7 +3338,7 @@
32673338
H @.. [Fh|Args],
32683339
length(Args,N),
32693340
N1 is N-1,
3270-
atomic_list_concat(['mc_',N1,'__',Fh],FPrefixed),
3341+
atomic_list_concat(['mc__1_',N1,'_',Fh],FPrefixed),
32713342
H2 @.. [FPrefixed|Args],
32723343
clause_occurs_warning(H2,B,Ref),clause(HH,BB,Ref),
32733344
strip_m(HH,HHH),HHH=@=H2,

prolog/metta_lang/metta_compiler_lib.pl

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,13 +304,13 @@
304304

305305
:- op(700,xfx,'=~').
306306

307-
soon_compile_flow_control(_HeadIs, _LazyVars, RetResult, RetResultN, _ResultLazy, Convert, [inline(Converted)], ConvertedN) :-
307+
todo_compile_flow_control(_HeadIs, _LazyVars, RetResult, _RetResultN, _ResultLazy, Convert, [inline(Converted)], _ConvertedN) :-
308308
Convert =~ ['superpose',ValueL],is_ftVar(ValueL),
309309
%maybe_unlistify(UValueL,ValueL,URetResult,RetResult),
310310
Converted = eval_args(['superpose',ValueL],RetResult),
311311
cname_var('MeTTa_SP_',ValueL).
312312

313-
soon_compile_flow_control(HeadIs, _LazyVars, RetResult, RetResultN, _ResultLazy, Convert, [inline(Converted)], ConvertedN) :-
313+
todo_compile_flow_control(HeadIs, _LazyVars, RetResult, _RetResultN, _ResultLazy, Convert, [inline(Converted)], _ConvertedN) :-
314314
Convert =~ ['superpose',ValueL],is_list(ValueL),
315315
%maybe_unlistify(UValueL,ValueL,URetResult,RetResult),
316316
cname_var('SP_Ret',RetResult),
@@ -522,10 +522,14 @@
522522

523523
%%%%%%%%%%%%%%%%%%%%% random number generation
524524

525+
526+
% for etcs-combinator-data-uncurry-xp.metta
527+
use_py_random:- !, fail.
525528
use_py_random:- option_value('py-random', true), !.
526529
use_py_random:- \+ option_value('fast-random', true).
527530

528-
use_rust_random:- \+ option_value('rust-random', false), !.
531+
% for etcs-combinator-data-uncurry-xp.metta
532+
use_rust_random:- fail, \+ option_value('rust-random', false), !.
529533

530534
use_python_rng(X,Y):- notrace(use_python_rng0(X,Y)).
531535
use_python_rng0(rng(_, PyObj),PyObj):- py_is_object(PyObj),!.
@@ -735,7 +739,16 @@
735739
'mc_n_1__py-dot-call!'(SymRef,Args,Ret) :-
736740
eval_in_only(interp,[['py-dot'|SymRef]|Args],Ret).
737741

742+
setup_library_calls:-
743+
user_io(forall(
744+
transpiler_predicate_store(Source,FnName,LenArgs,MettaTypeArgs,
745+
MettaTypeResult,InternalTypeArgs,InternalTypeResult),
746+
setup_library_call(Source,FnName,LenArgs,MettaTypeArgs,
747+
MettaTypeResult,InternalTypeArgs,InternalTypeResult))).
748+
749+
738750

751+
:- initialization(setup_library_calls,program).
739752

740753
this_is_in_compiler_lib.
741754

0 commit comments

Comments
 (0)