Comments (2)
What do you mean by "source" varialbles?
variables defined in Prolog or variables that exist in the logic such as used by forAll or thereExists ?
from logicmoo_workspace.
The "source" variables were from CycL/CLIF used by forAll or thereExists that initially had names.
I actually preserve these through the stages of the canonicalizer which converts CycL to a language that is prolog (with prolog variables).
% pkif :-
% all(PARENT,
% all(GRAND,
% all(CHILD,
% (parent(GRAND, PARENT)&parent(PARENT, CHILD)=>grandparent(GRAND, CHILD))))).
%
% /devel/LogicmooDeveloperFramework/PrologMUD/pack/logicmoo_base/prolog/logicmoo/plarkc/logicmoo_i_clif.pl:320
% cnf :-
% grandparent(GRAND, CHILD)v (not(parent(GRAND, PARENT))v not(parent(PARENT, CHILD))).
%
% /devel/LogicmooDeveloperFramework/PrologMUD/pack/logicmoo_base/prolog/logicmoo/plarkc/logicmoo_i_clif.pl:320
% horn :-
%
% [ (not(parent(GRAND, PARENT)):-not(grandparent(GRAND, CHILD)), parent(PARENT, CHILD)),
% (not(parent(PARENT, CHILD)):-not(grandparent(GRAND, CHILD)), parent(GRAND, PARENT)),
% (grandparent(GRAND, CHILD):-parent(GRAND, PARENT), parent(PARENT, CHILD))
% ].
%
% /devel/LogicmooDeveloperFramework/PrologMUD/pack/logicmoo_base/prolog/logicmoo/plarkc/logicmoo_i_clif.pl:320
% pfc :-
%
% [ (neg(parent(GRAND, PARENT))<-neg(grandparent(GRAND, CHILD)), {avoidHeadLoop(parent(PARENT, CHILD), parent(GRAND, PARENT))}, parent(PARENT, CHILD), {vg(s(PARENT, GRAND))}),
% (neg(parent(PARENT, CHILD))<-neg(grandparent(GRAND, CHILD)), {avoidHeadLoop(parent(GRAND, PARENT), parent(PARENT, CHILD))}, parent(GRAND, PARENT), {vg(s(CHILD, PARENT))}),
% (parent(GRAND, PARENT), parent(PARENT, CHILD), {vg(s(CHILD, GRAND))}==>grandparent(GRAND, CHILD))
% ].
%
Then right before I save the result I end up purposely discarding them.
% /devel/LogicmooDeveloperFramework/PrologMUD/pack/logicmoo_base/prolog/logicmoo/plarkc/logicmoo_i_clif.pl:320
% succeed(user:must_det_l((show_interesting_cl(kif(fwc), if((parent(_G637, _G638), parent(_G638, _G659)), grandparent(_G637, _G659))), kif_process(if((parent(_G637, _G638), parent(_G638, _G659)), grandparent(_G637, _G659)))))).
Because to drag those strings "during query" slows down the engine.
But
saved_varname_info((parent(GRAND, PARENT), parent(PARENT, CHILD)=>grandparent(GRAND, CHILD)), true, '/opt/PrologMUD/pack/logicmoo_base/prolog/logicmoo/plarkc/logicmoo_i_clif.pl':320).\nsaved_varname_info((parent(GRAND,PARENT),parent(PARENT,CHILD) => grandparent(GRAND,CHILD)),true,'/opt/PrologMUD/pack/logicmoo_base/prolog/logicmoo/plarkc/logicmoo_i_clif.pl':320).
I store enough information they can be presented in the final proof.
But this method is not useful when "browsing the KB" ( As I purposely discarded them for certain structures .. when I converted them to native Prolog variables)
Like in this pt/2 structure (Positive Trigger) and really this is probably the most useful time to see "CHILD" instead of "A"
pt(parent(eileen,A),(vg(s(A,trudy)) -> rhs([grandparent(trudy,A)]))) :-
'deduced-from' = parent(trudy,eileen),
rule_why = pt(parent(trudy,eileen),pt(parent(eileen,A),(vg(s(A,trudy)) -> rhs([grandparent(trudy,A)])))).
The code had created a "listener" on eileen that any child she has.. will be grandparented by trudy
Other such structs are spft/3
spft(pt(parent(C, A), pt(parent(A, B), (vg(s(B, C))->rhs([grandparent(C, B)])))), (parent(C, A), parent(A, B), {vg(s(B, C))}==>grandparent(C, B)), u).
spft((neg(parent(C, A))<-neg(grandparent(B, A)), {avoidHeadLoop(parent(B, C), parent(C, A))}, parent(B, C), {vg(s(A, C))}), clif(if((parent(B, C), parent(C, A)), grandparent(B, A))), pt(clif(if((parent(B, C), parent(C, A)), grandparent(B, A))), rhs([{clif_to_prolog(if((parent(B, C), parent(C, A)), grandparent(B, A)), [ (neg(parent(B, C))<-neg(grandparent(B, A)), {avoidHeadLoop(parent(C, A), parent(B, C))}, parent(C, A), {vg(s(C, B))}), (neg(parent(C, A))<-neg(grandparent(B, A)), {avoidHeadLoop(parent(B, C), parent(C, A))}, parent(B, C), {vg(s(A, C))}), (parent(B, C), parent(C, A), {vg(s(A, B))}==>grandparent(B, A))])}, [ (neg(parent(B, C))<-neg(grandparent(B, A)), {avoidHeadLoop(parent(C, A), parent(B, C))}, parent(C, A), {vg(s(C, B))}), (neg(parent(C, A))<-neg(grandparent(B, A)), {avoidHeadLoop(parent(B, C), parent(C, A))}, parent(B, C), {vg(s(A, C))}), (parent(B, C), parent(C, A), {vg(s(A, B))}==>grandparent(B, A))], {sanity((clif_must if((parent(B, C), parent(C, A)), grandparent(B, A))))}]))).
There are multiple ways of keeping the variables names:
- FASTEST, SIMPLE, WASTE_RAM: Every time I am about purposely discard I will create a unifiable copy of the same form but with variable names filled in.
- SPEED 20% slower, COMPLEX, RAM_SAVED
: Add a synthetic literal that will always succeed but will in times of printing allow variable names to "reappear"
spft(pt(parent(C, A), pt(parent(A, B), (vg(s(B, C),{var_info(['CHILD'=A,'PARENT'=B,'GRANDPARENT'=C])})->rhs([grandparent(C, B)])))), (parent(C, A), parent(A, B), {vg(s(B, C)),no}==>grandparent(C, B)), u).
- "CORRECT"ist , SPEED 200% too slow, SIMPLE, RAM_SAVED
spft(pt(parent(C, A), pt(parent(A, B), (vg(s(B, C))->rhs([grandparent(C, B)])))), (parent(C, A), parent(A, B), {vg(s(B, C))}==>grandparent(C, B)), u):-
label_vars(['CHILD'=A,'PARENT'=B,'GRANDPARENT'=C]).
Actually where this lead to: "Well if i am storing CycL variables and presenting them in proofs.. I should be using the same mechanism for doing that with the HL (Heuristic language Prolog). " So actually the answer this issue will problem is solved for Prolog Variables.
from logicmoo_workspace.
Related Issues (20)
- logicmoo.ec.ec_planner.ectest.TEST_EAT_CAKE_7 JUnit
- logicmoo.ec.ec_planner.ectest.STORY1 JUnit
- logicmoo.ec.ec_planner.ectest.SANITY_EQUALS_03 JUnit
- logicmoo.ec.ec_planner.ectest.SANITY_EQUALS_02 JUnit
- logicmoo.ec.ec_planner.ectest.EXAMPLE4 JUnit
- logicmoo.ec.ec_planner.ectest.EXAMPLE3 JUnit
- logicmoo.ec.ec_planner.ectest.EXAMPLE2 JUnit
- logicmoo.ec.ec_planner.ectest.SANITY_EQUALS_04 JUnit
- logicmoo.ec.ec_planner.ectest.SANITY_EQUALS_03 JUnit
- logicmoo.ec.ec_planner.ectest.SANITY_EQUALS_02 JUnit
- logicmoo.ec.ec_planner.ectest.SANITY_EQUALS_01 JUnit
- logicmoo.ec.ec_planner.ectest.STORY1 JUnit
- logicmoo.ec.ec_planner.ectest.EXAMPLE4 JUnit
- logicmoo.ec.ec_planner.ectest.EXAMPLE3 JUnit
- logicmoo.ec.ec_planner.ectest.EXAMPLE2 JUnit
- logicmoo.ec.ec_planner.ectest.EXAMPLE1 JUnit
- logicmoo.ec.ec_planner.ectest.EXAMPLE1A JUnit
- logicmoo.agi.agi_test.adv_story.ADV_TEST_01 JUnit
- logicmoo.agi.agi_test.adv_story.ADV_TEST_02 JUnit
- Membership: @chris-altamimi HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from logicmoo_workspace.