Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
infradig committed Dec 24, 2024
1 parent 5558c6c commit b1aee0c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ static void compile_term(predicate *pr, clause *cl, cell **dst, cell **src)

cell *c = (*src) + 1;

// T1 -> T2 ; T3

if (((*src)->val_off == g_disjunction_s) && ((*src)->arity == 2)
&& is_callable(c) && c->bif_ptr && (c->arity == 2)
&& (c->bif_ptr->fn == bif_iso_if_then_2)) {
Expand Down Expand Up @@ -49,6 +51,8 @@ static void compile_term(predicate *pr, clause *cl, cell **dst, cell **src)
#endif
}

// T1 *-> T2 ; T3

if (((*src)->val_off == g_disjunction_s) && ((*src)->arity == 2)
&& is_callable(c) && c->bif_ptr && c->bif_ptr && (c->arity == 2)
&& (c->bif_ptr->fn == bif_soft_if_then_2)) {
Expand Down Expand Up @@ -80,6 +84,8 @@ static void compile_term(predicate *pr, clause *cl, cell **dst, cell **src)
#endif
}

// T1 ; T2

if (((*src)->val_off == g_disjunction_s) && ((*src)->arity == 2)) {
*src += 1;
cell *save_dst1 = *dst;
Expand Down Expand Up @@ -180,6 +186,8 @@ static void compile_term(predicate *pr, clause *cl, cell **dst, cell **src)
return;
}

// T1 -> T2

if (((*src)->val_off == g_if_then_s) && ((*src)->arity == 2) && !is_var((*src)+1)) {
unsigned var_nbr = cl->nbr_vars++;
cl->has_local_vars = true;
Expand All @@ -194,6 +202,8 @@ static void compile_term(predicate *pr, clause *cl, cell **dst, cell **src)
return;
}

// T1 *-> T2

if (((*src)->val_off == g_soft_cut_s) && ((*src)->arity == 2) && !is_var((*src)+1)) {
unsigned var_nbr = cl->nbr_vars++;
cl->has_local_vars = true;
Expand Down

0 comments on commit b1aee0c

Please sign in to comment.