Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/dagit/rust-prolog
/ functions
Functions
65 in github.com/dagit/rust-prolog
⨍
Functions
65
◇
Types & classes
15
↓ 19 callers
Method
insert_term
(&mut self, t: Term, lt: Lifetime)
src/heap.rs:71
↓ 13 callers
Function
make_atom
Helper to build a simple atom like "human(socrates)"
src/solve.rs:493
↓ 8 callers
Function
assert
Add a new assertion at the end of the current database. */
src/solve.rs:48
↓ 8 callers
Function
make_const
(heap: &mut Heap, name: &str)
src/solve.rs:497
↓ 6 callers
Method
insert_string
(&mut self, s: String, lt: Lifetime)
src/heap.rs:75
↓ 6 callers
Function
make_goals
(atoms: Vec<Atom>)
src/solve.rs:512
↓ 6 callers
Function
make_search
( db: &'a Database, heap: &'a mut Heap, interrupted: &'a Arc<AtomicBool>, goal
src/solve.rs:519
↓ 5 callers
Function
make_interrupted
()
src/solve.rs:508
↓ 4 callers
Function
exec_cmds
[exec_cmds cmds] executes the list of toplevel commands [cmds]. */
src/main.rs:119
↓ 3 callers
Function
make_complementary
Compute the complementary term for an atom. We assume the arity of `not` is exactly 1 and fail to produce a term if it is used at any other arity. No
src/syntax.rs:284
↓ 3 callers
Function
subst_term
[subst_term sub t] substitutes in term [t] values for variables, as specified by the associative list [s]. It substitutes repeatedly until the terms s
src/syntax.rs:77
↓ 2 callers
Function
insert_thing
( perm_heap: &mut HashSet<Arc<A>>, ephemeral_heap: &mut HashSet<Arc<A>>, t: A, lt: Lifetime, )
src/heap.rs:28
↓ 2 callers
Function
make_var
(heap: &mut Heap, name: &str, level: i32)
src/solve.rs:501
↓ 2 callers
Method
next_outcome
Like `next()` but distinguishes "no more solutions" from "search depth exhausted".
src/solve.rs:275
↓ 2 callers
Function
renumber_atom
[renumber_atom n a] renumbers all variable instances occurring in atom [a] so that they have level [n]. */
src/solve.rs:77
↓ 2 callers
Function
string_of_term
[string_of_term t] converts term [t] to its string representation. */
src/syntax.rs:99
↓ 2 callers
Function
term_to_atom
(t: &Term)
src/syntax.rs:242
↓ 2 callers
Function
unify_lists
[unify_lists env lst1 lst2] unifies two lists of terms in current environment [env] and returns a new environment [env'] on success. It returns [NoUni
src/unify.rs:50
↓ 2 callers
Function
unify_terms
[unify_terms env t1 t2] unifies terms [t1] and [t2] in the current environment [env]. On success it returns the environment extended with the result o
src/unify.rs:13
↓ 1 callers
Function
arb_constant
()
src/syntax.rs:345
↓ 1 callers
Function
arb_term
(depth: u32)
src/syntax.rs:349
↓ 1 callers
Method
cleanup
(&mut self)
src/heap.rs:79
↓ 1 callers
Function
exec_cmd
[exec_cmd cmd] executes the toplevel command [cmd]. Returns Some() when the computation succeeded and None when the command failed. */
src/main.rs:58
↓ 1 callers
Function
exec_file
[exec_file fn] executes the contents of file [fn]. */
src/main.rs:91
↓ 1 callers
Function
exists
[exists fn ls] returns [true] if [fn] returns true on at least one element of [ls], and returns [false] otherwise. This was added to mimic the standar
src/syntax.rs:212
↓ 1 callers
Function
generate_contrapositives
Look through the user's inference rule [a :- b1, ..., bn] and compute all the contrapositives of the rule: not(b1) :- not(a), b2, ..., bn not(b2) :- n
src/syntax.rs:241
↓ 1 callers
Method
has_more_choices
Whether there are still remaining choice points to explore.
src/solve.rs:299
↓ 1 callers
Function
is_complementary
uses unification to search for framed atoms whose complement unifies with the given atom. */
src/solve.rs:316
↓ 1 callers
Function
list_map
(list: &Term, f: &dyn Fn(&Term) -> A)
src/syntax.rs:134
↓ 1 callers
Function
lookup
[lookup env x] returns the value of variable instance [x] in environment [env]. It returns [Var x] if the variable does not occur in [env]. */
src/syntax.rs:66
↓ 1 callers
Function
nat_to_word
(list: &Term)
src/syntax.rs:158
↓ 1 callers
Method
next_token
(&mut self)
src/lexer.rs:65
↓ 1 callers
Function
occurs
[occurs x t] returns [true] when variable instance [x] appears in term [t]. */
src/syntax.rs:226
↓ 1 callers
Function
reduce_atom
[reduce_atom a asrl] reduces atom [a] to subgoals by using the first assertion in the assertion list [asrl] whose conclusion matches [a]. It returns [
src/solve.rs:342
↓ 1 callers
Function
renumber_term
[renumber_term t n] renumbers all variable instances occurring in term [t] so that they have level [n]. */
src/solve.rs:59
↓ 1 callers
Method
reset_for_depth
Reset solver state for a new depth iteration.
src/solve.rs:140
↓ 1 callers
Method
solve_step
Iterative solver for a single depth level. Replaces the former mutually-recursive Solver::solve/continue_search pair. Every former recursive c
src/solve.rs:151
↓ 1 callers
Function
solve_toplevel
[solve_toplevel c] searches for the proof of clause [c] using the "global" database. This function is called from the main program */
src/solve.rs:371
↓ 1 callers
Method
solver_next
Advance the search by one solution at the current depth level.
src/solve.rs:251
↓ 1 callers
Function
string_of_app
(t: &Term)
src/syntax.rs:117
↓ 1 callers
Function
string_of_const
(t: &str)
src/syntax.rs:108
↓ 1 callers
Function
string_of_env
[string_of_env env] converts environment [env] to its string representation. It only keeps instance variables at level 0, i.e., those that appear in t
src/syntax.rs:191
↓ 1 callers
Function
string_of_list
(args: &[Arc<Term>])
src/syntax.rs:180
↓ 1 callers
Function
unify_atoms
[unify_atoms env a1 a2] unifies atomic propositions [a1] and [a2] in current environment [env] and returns a new environment [env'] on success. It rai
src/unify.rs:70
Function
arb_atom
(depth: u32)
src/syntax.rs:370
Function
arb_variable
()
src/syntax.rs:341
Method
default
()
src/heap.rs:55
Function
main
()
build.rs:3
Function
main
()
src/main.rs:144
Method
match_and_consume
( text: &mut &'input str, pos: &mut usize, re: &Regex, action: F, )
src/lexer.rs:46
Method
new
(text: &'input str)
src/lexer.rs:38
Method
new
( db: &'a Database, heap: &'a mut Heap, interrupted: &'a Arc<AtomicBool>, goal
src/solve.rs:117
Method
new
()
src/heap.rs:61
Method
next
(&mut self)
src/lexer.rs:126
Method
next
(&mut self)
src/solve.rs:307
Function
solve_empty_database
()
src/solve.rs:634
Function
solve_interrupted
()
src/solve.rs:616
Function
solve_no_match
()
src/solve.rs:545
Function
solve_simple_fact
()
src/solve.rs:529
Function
solve_variable_binding
()
src/solve.rs:563
Function
solve_with_rule
()
src/solve.rs:591
Function
str_to_nat
(heap: &mut Heap, input: &str, lt: Lifetime)
src/syntax.rs:314
Function
string_of_env_empty_is_yes
()
src/syntax.rs:499
Function
var_levels
Collect all variable levels from a term
src/solve.rs:427
Function
vec_to_list
(heap: &mut Heap, elts: Vec<Arc<Term>>, lt: Lifetime)
src/syntax.rs:325