Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F2718243
example-computations.lp
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Feb 15, 8:43 PM
Size
2 KB
Mime Type
text/plain
Expires
Tue, Feb 17, 8:43 PM (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
237558
Attached To
rXR Xreate
example-computations.lp
View Options
%defines:
implementation(hashlist). implementation(linkedlist). implementation(treelist). implementation(computation).
operation(at). operation(sort). operation(insert). operation(seqaccess).
connection_type(ct_inherits). connection_type(ct_convert).
relation (recommends). relation (satisfied). relation(unsupported).
relation_score(satisfied, 0).
relation_score(recommends, 1).
relation_score(unsupported, -1).
%integration facts:
relation_op(seqaccess, computation, recommends).
relation_op(at, hashlist, recommends). relation_op(at,treelist, satisfied).
relation_op(sort, linkedlist, satisfied). relation_op(sort, treelist, satisfied). relation_op(sort, hashlist, unsupported).
%static analysis:
var(a).var(tmp2). var(b). var(tmp3).
var_connection(a, tmp2).
bind_var_op(tmp2, seqaccess).
var_connection(tmp2, b, ct_inherits).
var_connection(b, tmp3).
bind_var_op(tmp3, seqaccess).
%domain rules:
impl_fulfill(OP, IMPL, SCORE):- relation_op(OP, IMPL, RL), relation_score(RL, SCORE), operation(OP), implementation(IMPL), RL!=unsupported.
impl_not_fulfill(OP, IMPL):- relation_op(OP, IMPL, unsupported).
%reasoning rules:
{ var_connection(VAR_FROM, VAR_TO, CT):connection_type(CT) }1 :- var_connection(VAR_FROM, VAR_TO).
var_cluster_root(VAR) :- {var_connection(VAR_F, VAR, ct_inherits): var(VAR_F)} 0, var(VAR).
var_cluster(VAR0, VAR_TO) :- var_connection(VAR0, VAR_TO, ct_inherits), var_cluster_root(VAR0).
var_cluster(VAR0, VAR_TO2) :- var_connection(VAR_TO1, VAR_TO2, ct_inherits), var_cluster(VAR0, VAR_TO1).
var_cluster(VAR0, VAR0):- var_cluster_root(VAR0).
impl_fulfill_cluster(VAR0, OP, IMPL, SCORE) :- var_cluster(VAR0, VAR_ANY), bind_var_op(VAR_ANY, OP), impl_fulfill(OP, IMPL, SCORE), var_cluster_root(VAR0).
impl_not_fulfill_cluster(VAR0, IMPL):-var_cluster(VAR0, VAR_ANY), bind_var_op(VAR_ANY, OP), impl_not_fulfill(OP, IMPL), var_cluster_root(VAR0).
bind_var_impl(VAR0, IMPL, SCORE_RESULT) :- SCORE_RESULT = #sum[impl_fulfill_cluster(VAR0, _, IMPL, SCORE) = SCORE], {impl_not_fulfill_cluster(VAR0, IMPL)}0, var_cluster_root(VAR0), implementation(IMPL).
%pretty output:
#hide.
#show chosen_impl/2.
%#show bind_var_impl/3.
%#show var_cluster_owner/1.
%#show var_connection/3.
%#show bind_var_op/2.
Event Timeline
Log In to Comment