Skip to content

Commit

Permalink
fixed bad merge
Browse files Browse the repository at this point in the history
  • Loading branch information
TeamSPoon committed Jan 5, 2024
1 parent 703ac75 commit fa1ce88
Show file tree
Hide file tree
Showing 8 changed files with 3,535 additions and 320 deletions.
113 changes: 0 additions & 113 deletions 2-VSpaceTest.metta

This file was deleted.

10 changes: 5 additions & 5 deletions MeTTa
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,6 @@ if [[ -f "$DIRNAME" ]]; then
elif [[ -d "$DIRNAME" ]]; then
HTML_OUT="${DIRNAME}/Result.html"
else
if [[ "$repl_flag" == "enable" ]]; then
handle_args --repl
fi
DIRNAME="${PWD}"
HTML_OUT="${DIRNAME}/Result.html"
fi
Expand Down Expand Up @@ -352,6 +349,7 @@ handle_args "$@"
# Decide on enabling the REPL
if [[ "$repl_flag" == "enable" ]]; then
[[ ${#LIST_OF_FILE_ARGS[@]} -eq 0 ]] && repl_flag=true || true
#handle_args --repl
fi

if [[ "$repl_flag" == "true" ]]; then
Expand Down Expand Up @@ -385,7 +383,7 @@ if [[ $never_compile -eq 0 ]]; then
# Reference file
reference_file=$(find . -maxdepth 1 -type f -name "${DefaultSav}*" -not -name "*.*" -printf "%T@ %p\n" | sort -k1,1nr | head -n 1 | cut -f2- -d" ")
if [[ -z "$reference_file" ]]; then
reference_file="./${DefaultSav}"
reference_file="$METTALOG_DIR/${DefaultSav}"
fi

# Check if ${DefaultSav} exists
Expand Down Expand Up @@ -426,7 +424,7 @@ fi

reference_file=$(find . -maxdepth 1 -type f -name "${DefaultSav}*" -not -name "*.*" -printf "%T@ %p\n" | sort -k1,1nr | head -n 1 | cut -f2- -d" ")
if [[ -z "$reference_file" ]]; then
reference_file="./${DefaultSav}"
reference_file="$METTALOG_DIR/${DefaultSav}"
fi


Expand All @@ -443,6 +441,7 @@ else
MLOG="swipl ${SWI_OPTIONS[*]} -l $METTALOG_DIR/metta_vspace/$PYSWIP_VERSION/metta_interp.pl --"
fi


METTA_CMD="$MLOG --python=$python_flag ${PRE_METTALOG_OPTIONS[*]} ${METTALOG_OPTIONS[*]}"

OS=$(uname)
Expand Down Expand Up @@ -480,6 +479,7 @@ if [[ -n "$CMD_TIMEOUT" && "$CMD_TIMEOUT" -gt 0 ]]; then
METTA_CMD="$TIMEOUT_CMD --foreground --preserve-status --signal=SIGTERM --kill-after=5s $CMD_TIMEOUT ${METTA_CMD}"
fi

cd "${RPWD}"
export CMD_TIMEOUT
set +e
# Conditional to check if html_flag is enabled
Expand Down
28 changes: 28 additions & 0 deletions examples/performance/coins.metta
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

(= (count-change $amount)
(cc $amount 5))

(= (cc $amount $kinds-of-coins)
(if (== $amount 0)
1
(if (or (< $amount 0) (== $kinds-of-coins 0))
0
(+ (cc $amount (- $kinds-of-coins 1))
(cc (- $amount (first-denomination $kinds-of-coins)) $kinds-of-coins)))))

(= (first-denomination $kinds-of-coins)
(case $kinds-of-coins
(
(1 1)
(2 5)
(3 10)
(4 25)
(5 50)
)))

; In the book's example 100 is used to call function count-change, but for the sake of performance I've put 20 here.
!(assertEqual
(count-change 20)
9)


2 changes: 1 addition & 1 deletion metta_vspace/pyswip-want/metta_eval.pl
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@
metta_atom_iter(Eq,Depth,Self,Other,Goal),
Template=Res.

metta_atom_iter(Eq,Depth,Self,Other,[Equal,[F|H],B]):- Eq == Equal,!, % trace,
metta_atom_iter(Eq,_Depth,_Slf,Other,[Equal,[F|H],B]):- Eq == Equal,!, % trace,
metta_defn(Eq,Other,[F|H],B).

/*
Expand Down
20 changes: 10 additions & 10 deletions metta_vspace/pyswip/flybase_main.pl
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@
est_size( 1_316_132, fbgn_NAseq_Uniprot).
est_size( 1_045_549, property_value).
est_size( 1_001_254, synonym).
est_size( 722_570, cDNA_clone).
est_size( 722_570, cDNA_clone_data).
est_size( 384_206, genotype_phenotype).
est_size( 363_453, allele_genetic_interactions).
est_size( 288_469, fbal_to_fbgn).
Expand Down Expand Up @@ -2115,7 +2115,7 @@
% #genotype_symbols genotype_FBids phenotype_name phenotype_id qualifier_names qualifier_ids reference
column_names(automated_gene_summaries, [primary_FBgn, summary_text]).
column_names(best_gene_summary, ['FBgn', 'Gene_Symbol', 'Summary_Source', 'Summary']).
column_names(cDNA_clone, ['FBcl', organism_abbreviation, clone_name, dataset_metadata_name, listOf(cDNA_accession), listOf('EST_accession')]).
column_names(cDNA_clone_data, ['FBcl', organism_abbreviation, clone_name, dataset_metadata_name, listOf(cDNA_accession), listOf('EST_accession')]).
column_names(dataset_metadata, ['Dataset_Metadata_ID', 'Dataset_Metadata_Name', 'Item_ID', 'Item_Name']).
column_names(disease_model_annotations, ['FBgn', 'Gene_symbol', 'HGNC', 'DO_qualifier', 'DO', 'DO_term', 'Allele_used_in_model_(FBal)', 'Allele_used_in_model_(symbol)', 'Based_on_orthology_with_(HGNC_ID)', 'Based_on_orthology_with_(symbol)', 'Evidence/interacting_alleles', 'Reference_(FBrf)']).
column_names(dmel_gene_sequence_ontology_annotations, [gene_primary_id, gene_symbol, so_term_name, so_term_id]).
Expand Down Expand Up @@ -2289,12 +2289,12 @@
table_n_type(fbal_to_fbgn, 2, 'AlleleSymbol', _).
table_n_type(fbal_to_fbgn, 3, 'GeneID', 'FBgn').
table_n_type(fbal_to_fbgn, 4, 'GeneSymbol', _).
table_n_type(cDNA_clone, 1, 'FBcl', 'FBcl').
table_n_type(cDNA_clone, 2, organism_abbreviation, _).
table_n_type(cDNA_clone, 3, clone_name, _).
table_n_type(cDNA_clone, 4, dataset_metadata_name, _).
table_n_type(cDNA_clone, 5, cDNA_accession, _).
table_n_type(cDNA_clone, 6, 'EST_accession', _).
table_n_type(cDNA_clone_data, 1, 'FBcl', 'FBcl').
table_n_type(cDNA_clone_data, 2, organism_abbreviation, _).
table_n_type(cDNA_clone_data, 3, clone_name, _).
table_n_type(cDNA_clone_data, 4, dataset_metadata_name, _).
table_n_type(cDNA_clone_data, 5, cDNA_accession, _).
table_n_type(cDNA_clone_data, 6, 'EST_accession', _).
table_n_type(genomic_clone, 1, 'FBcl', 'FBcl').
table_n_type(genomic_clone, 2, organism_abbreviation, _).
table_n_type(genomic_clone, 3, clone_name, _).
Expand Down Expand Up @@ -2858,7 +2858,7 @@

ucn(dmel_unique_protein_isoforms, 3). % ,a-PA,))
ucn(best_gene_summary, 1). % ,FBgn0031081,) (2 ,Nep3,))
ucn(cDNA_clone, 1). % ,FBcl0000001,) (3 ,UUGC0315,))
ucn(cDNA_clone_data, 1). % ,FBcl0000001,) (3 ,UUGC0315,))
ucn(fb_synonym, 1). % ,FBal0000001,))
ucn(fbal_to_fbgn, 1). % ,FBal0137236,))
ucn(fbgn_annotation_ID.tsv, 1). % ,7SLRNA:CR32864,) (3 ,FBgn0000003,) (5 ,CR32864,))
Expand Down Expand Up @@ -2906,7 +2906,7 @@
fb_pred('automated_gene_summaries',2).
fb_pred('automated_gene_summaries',3).
fb_pred('best_gene_summary',4).
fb_pred('cDNA_clone',6).
fb_pred('cDNA_clone_data',6).
fb_pred('cDNA_clone_data',5).
fb_pred('cDNA_clone_data',6).
fb_pred('cyto_genetic_seq',4).
Expand Down
Loading

0 comments on commit fa1ce88

Please sign in to comment.