test2.assembly.lp
No OneTemporary

File Metadata

Created
Sat, Nov 21, 7:03 AM

test2.assembly.lp

% INPUT
%-----------------------------------
% assign_sizo(..).
sizo(Sizo):-
bind_scope(_, assign_sizo(Sizo), strong).
dict_sizo(Sizo, Id):-
Id= #sum{ 1, SizoLess : sizo(SizoLess), SizoLess < Sizo};
sizo(Sizo).
% connect to latex
%-----------------------------------
latex_registered_subjects(sizo, Sizo):- sizo(Sizo).
latex_scope_demand(ScopeDemandSizo, sizo):-
bind(Target, demand(sizo));
Target = s(_, _, ScopeDemandSizo).
bind_scope(Scope, Sizo, strong):-
bind_scope(Scope, assign_sizo(Sizo), strong).
% register late query
%-----------------------------------
late(Target, SymbolSizo, (SizoAny), sizo_current(SizoAny)):-
bind(Target, demand(sizo));
Target=s(_, _, TargetS);
scope_fn(TargetS, Fn);
latex_symbol(Fn, sizo, SymbolSizo);
sizo(SizoAny).
% polymorphism based on virtualizaion strategy
%-----------------------------------
dfa_callguard(SymbRet, strategy(Strategy)):-
dfa_callfn(SymbRet, FnName);
bind_func(FnName, requires(virt_dereference_strategy));
virt_dereference_strategy(Strategy).
% IMPLEMENTATION
%=========================================================== .
virt_dereference_strategy(prefix) :- 2 #count{Sizo: sizo(Sizo)}.
virt_dereference_strategy(none) :- not virt_dereference_strategy(prefix).

Event Timeline