Module programinduction::trs [−][src]
(representation) Polymorphically-typed term rewriting system.
An evaluatable first-order Term Rewriting System (TRS) with a Hindley-Milner type system.
Example
let mut sig = Signature::default(); let mut ops = vec![]; sig.new_op(2, Some("PLUS".to_string())); ops.push(ptp![@arrow[tp!(int), tp!(int), tp!(int)]]); sig.new_op(1, Some("SUCC".to_string())); ops.push(ptp![@arrow[tp!(int), tp!(int)]]); sig.new_op(0, Some("ZERO".to_string())); ops.push(ptp![int]); let rules = vec![ parse_rule(&mut sig, "PLUS(x_ ZERO) = x_").expect("parsed rule"), parse_rule(&mut sig, "PLUS(x_ SUCC(y_)) = SUCC(PLUS(x_ y_))").expect("parsed rule"), ]; let vars = vec![ ptp![int], ptp![int], ptp![int], ]; let lexicon = Lexicon::from_signature(sig, ops, vars, vec![], false); let trs = TRS::new(&lexicon, rules);
Structs
GeneticParams | |
Lexicon |
(representation) Manages the syntax of a term rewriting system. |
ModelParams |
Parameters for a TRS-based probabilistic model. |
TRS |
Manages the semantics of a term rewriting system. |
Enums
SampleError |
The error type for sampling operations. |
TypeError |
The error type for type inference. |
Functions
task_by_rewrite |
Construct a |