Elxlog v0.1.6 Prove View Source

Prove Horn clause with SLD resolution

Link to this section Summary

Functions

for predicate ask/0 ask prints variables of goal

eval/2 is for is builtin predicate evaluate formula formula e.g. [:formula,[:+,x,y]]

for builtin elixir predicate add prefix "Elxfunc"

for builtin predicate "elixir" change from elxlog data to string

for builtin listing/0 /1

make list [:,:,...] size n

help function for parallel/n

Return value is tuple. {val,env,def} prove([predicate, y, env, def, n) y is succeeding predicate(s) env is environment. It is keyword-list n is nest level. Alpha conversion uses n to generate new variable.

prove_all/4 work with prove/5

evaluate native Elixir function change from function of elxlog to string. and eval as Elixir function

prove_pred/6 is for predicate x is goal to prove d is set of difinition y is succeeding goals env is environment for variables n is nest lebel

for builtin reconsult/1 parse file text and add difinition

when trace is true in def print trace data n is nest lebel action [try,succ,fail]

unificate x and y env is environment. e.g. [[{:X,1},{:Y,2}],[{:Y,2},3] old variable is always left side in each environment element

Link to this section Functions

for predicate ask/0 ask prints variables of goal

eval/2 is for is builtin predicate evaluate formula formula e.g. [:formula,[:+,x,y]]

for builtin elixir predicate add prefix "Elxfunc"

for builtin predicate "elixir" change from elxlog data to string

for builtin listing/0 /1

make list [:,:,...] size n

Link to this function

parallel1(list, env, def, n)

View Source

help function for parallel/n

Link to this function

prove(list, y, env, def, n)

View Source

Return value is tuple. {val,env,def} prove([predicate, y, env, def, n) y is succeeding predicate(s) env is environment. It is keyword-list n is nest level. Alpha conversion uses n to generate new variable.

example

iex>Prove.prove([:builtin,[:true]],[],[],[],0) {true,[],[]} iex>Prove.prove([:builtin,[:fail]],[],[],[],0) {false,[],[]}

Link to this function

prove_all(list, env, def, n)

View Source

prove_all/4 work with prove/5

Link to this function

prove_builtin(x, y, env, def, n)

View Source

evaluate native Elixir function change from function of elxlog to string. and eval as Elixir function

Link to this function

prove_pred(x, arg2, y, env, def, n)

View Source

prove_pred/6 is for predicate x is goal to prove d is set of difinition y is succeeding goals env is environment for variables n is nest lebel

for builtin reconsult/1 parse file text and add difinition

Link to this function

trace(x, env, def, n, action)

View Source

when trace is true in def print trace data n is nest lebel action [try,succ,fail]

unificate x and y env is environment. e.g. [[{:X,1},{:Y,2}],[{:Y,2},3] old variable is always left side in each environment element

Link to this function

unify1(x, y, xs, ys, env)

View Source