Skip to content

Commit

Permalink
removed more unused files
Browse files Browse the repository at this point in the history
  • Loading branch information
TeamSPoon committed Aug 30, 2024
1 parent 97824c9 commit 0868d17
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 365 deletions.
304 changes: 0 additions & 304 deletions src/canary/metta_corelib.pl

This file was deleted.

55 changes: 0 additions & 55 deletions src/canary/metta_data.pl

This file was deleted.

5 changes: 2 additions & 3 deletions src/canary/metta_interp.pl
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,9 @@


:- ensure_loaded(metta_utils).
:- ensure_loaded(metta_data).
%:- ensure_loaded(mettalog('metta_ontology.pfc.pl')).
:- ensure_loaded(metta_pfc_base).
:- ensure_loaded(metta_pfc_support).
:- ensure_loaded(metta_compiler).
:- ensure_loaded(metta_convert).
:- ensure_loaded(metta_types).
Expand Down Expand Up @@ -1000,7 +1001,6 @@
metta_atom_asserted_deduced(X,Y),
\+ clause(metta_atom_asserted(X,Y),true).


%get_metta_atom(Eq,KB, [F|List]):- KB='&flybase',fb_pred(F, Len), length(List,Len),apply(F,List).


Expand All @@ -1026,7 +1026,6 @@
metta_atom_asserted('&flybase','&corelib').
metta_atom_asserted('&catalog','&corelib').
metta_atom_asserted('&catalog','&stdlib').
:- ensure_loaded(metta_corelib).

/*
'mod-space'(top,'&self').
Expand Down
19 changes: 19 additions & 0 deletions src/canary/metta_loader.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1151,3 +1151,22 @@
fail. % Continue looping until between/3 fails
progress_bar_example.

:- dynamic(using_corelib_file/0).


use_corelib_file:- using_corelib_file,!.
use_corelib_file:- asserta(using_corelib_file), fail.
use_corelib_file:- load_corelib_file, generate_interpreter_stubs.

generate_interpreter_stubs:-
forall(metta_type('&corelib',Symb,Def),
gen_interp_stubs('&corelib',Symb,Def)).

load_corelib_file:- is_metta_src_dir(Dir), really_use_corelib_file(Dir,'corelib.metta'),!.
load_corelib_file:- is_metta_src_dir(Dir), really_use_corelib_file(Dir,'stdlib_mettalog.metta'),!.
% !(import! &corelib "src/canary/stdlib_mettalog.metta")
really_use_corelib_file(Dir,File):- absolute_file_name(File,Filename,[relative_to(Dir)]),
locally(nb_setval(may_use_fast_buffer,t),
locally(nb_setval(suspend_answers,true),
with_output_to(string(_),include_metta_directory_file('&corelib',Dir,Filename)))).

3 changes: 3 additions & 0 deletions src/canary/metta_printer.pl
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@

%write_src(V):- !, \+ \+ quietly(pp_sex(V)),!.
write_src(V):- \+ \+ notrace(pp_sex(V)),!.
write_src_woi_ln(X):-
format('~N'),write_src_woi(X),format('~N').


pp_sex(V):- pp_sexi(V),!.
% Various 'write_src' and 'pp_sex' rules are handling the writing of the source,
Expand Down
5 changes: 4 additions & 1 deletion src/canary/metta_server.pl
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@
tcp_open_socket(Socket, Stream).

% Helper to send goal and receive response
send_term(Stream, MeTTa) :- write_canonical(Stream, MeTTa),writeln(Stream, '.'), flush_output(Stream).
send_term(Stream, MeTTa) :-
write_canonical(Stream, MeTTa),
writeln(Stream, '.'),
flush_output(Stream).
recv_term(Stream, MeTTa) :- read_term(Stream, MeTTa, []).


Expand Down
13 changes: 13 additions & 0 deletions src/canary/metta_types.pl
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,19 @@
is_seo_f('Concept').
is_seo_f(N):- number(N),!.

is_absorbed_return_type(Params,Var):- var(Var),!, \+ sub_var(Var,Params).
is_absorbed_return_type(_,'Bool').
is_absorbed_return_type(_,[Ar]):- !, Ar == (->).
is_absorbed_return_type(_,'EmptyType').
is_absorbed_return_type(_,'ReturnType').
is_absorbed_return_type(_,X):- is_self_return(X).

is_self_return('ErrorType').

is_non_absorbed_return_type(Params,Var):-
\+ is_absorbed_return_type(Params,Var).


%is_user_defined_goal(Self,[H|_]):- is_user_defined_head(Eq,Self,H).

is_user_defined_head(Other,H):- is_user_defined_head(=,Other,H).
Expand Down
53 changes: 51 additions & 2 deletions src/canary/stdlib_mettalog.metta
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@
(: Any Type)
(: Atom Type)
(: Bool Type)
(: Expression Type)
(: Number Type)
(: hyperon::space::DynSpace Type)
(: ReturnType Type)
(: Symbol Type)
(: StateMonad Type)
(: Type Type)
(: %Undefined% Type)
(: Variable Type)
(: if-decons (-> Atom Variable Variable Atom Atom Atom))
(: if-empty (-> Atom Atom Atom Atom))
(: if-non-empty-expression (-> Atom Atom Atom Atom))
(: if-not-reducible (-> Atom Atom Atom Atom))
;(: apply (-> Atom Variable Atom Atom))
;(: cons (-> Atom Atom Atom))
;(: decons (-> Atom Atom))
(: xor (-> Bool Bool Bool))
(: return (-> Atom ReturnType))
(: switch (-> %Undefined% Expression Atom))
(: unify (-> Atom Atom Atom Atom %Undefined%))
(: get-type0 (-> Atom Atom))
(: get-ftype (-> Atom Atom))
(: : %Undefined%)
(: function-arity (-> Symbol Number))
(: predicate-arity (-> Symbol Number))
(: pragma! (-> Atom Atom (->)))
(: = (-> Atom Atom %Undefined%))
(: match (-> hyperon::space::DynSpace Atom Atom %Undefined%))
(: case (-> Expression Atom Atom))
(: combine (-> $_4082 $_4082 $_4082))
(: import! (-> hyperon::space::DynSpace Atom (->)))
(: get-type (-> Atom Type))
(: PredicateArity (-> Symbol Number))
(: If (-> Bool Atom Atom Atom))
(: If (-> Bool Atom Atom))
(= (If True $_3800) $_3800)
(= (If False $_3710) (let $_3728 0 (let $_3728 1 $_3728)))
(= (If $_3632 $_3638 $_3644) (if $_3632 $_3638 $_3644))
(PredicateArity PredicateArity 2)
(PredicateArity : 2)
(= (: $_3524 P1) (PredicateArity $_3524 1))
(: : SrcPredicate)
(: If SrcFunction)

; Public MeTTa
(@doc =
(@desc "A symbol used to define reduction rules for expressions.")
Expand All @@ -8,7 +55,7 @@
(: = (-> $t $t Atom))
;; Implemented from Interpreters

(: ALT= (-> Atom Atom Atom))
(: = (-> Atom Atom Atom))

; Public MeTTa
(@doc ErrorType (@desc "Type of the atom which contains error"))
Expand Down Expand Up @@ -1060,7 +1107,9 @@
(@params (
(@param "Reference to the space")))
(@return "List of all atoms in the input space"))
(get-atoms (-> hyperon::space::DynSpace Atom))

(: get-atoms (-> hyperon::space::DynSpace Atom))

;; Implemented from Interpreters

;; Public MeTTa
Expand Down

0 comments on commit 0868d17

Please sign in to comment.