logicaffeine_language/
lib.rs1#![cfg_attr(docsrs, feature(doc_cfg))]
2#![doc = include_str!("../README.md")]
3
4pub use logicaffeine_base::{Arena, Interner, Span as BaseSpan, Symbol, SymbolEq};
6
7pub mod intern {
9 pub use logicaffeine_base::{Interner, Symbol, SymbolEq};
10}
11
12pub mod arena {
14 pub use logicaffeine_base::Arena;
15}
16
17pub mod diagnostic;
19pub mod drs;
20pub mod error;
21pub mod lexer;
22pub mod lexicon;
23pub mod lgx;
24pub mod lint;
25pub mod printer;
26pub mod teach;
27pub mod token;
28pub mod token_class;
29
30pub mod ast;
32pub mod ast_map;
33pub mod parser;
34
35pub mod lambda;
37pub mod semantics;
38pub mod transpile;
39
40pub mod compile;
42
43pub mod analysis;
45pub mod arena_ctx;
46pub mod ast_depth;
47pub mod debug;
48pub mod formatter;
49pub mod import_format;
50pub mod mwe;
51pub mod ontology;
52pub mod pragmatics;
53pub mod registry;
54pub mod scope;
55pub mod session;
56pub mod source_format;
57pub mod style;
58pub mod suggest;
59pub mod symbol_dict;
60pub mod view;
61pub mod visitor;
62
63pub mod optimization;
65
66pub mod proof_convert;
68pub use proof_convert::{logic_expr_to_proof_expr, term_to_proof_term};
69
70pub use analysis::TypeRegistry;
72pub use arena_ctx::AstContext;
73pub use drs::{BoxType, Case, Drs, Gender, Number, WorldState};
74pub use error::{socratic_explanation, ParseError, ParseErrorKind};
75pub use lexer::{Lexer, LineLexer, LineToken};
76pub use parser::{NegativeScopeMode, Parser, ParserMode, QuantifierParsing};
77pub use registry::SymbolRegistry;
78pub use session::Session;
79pub use token::{BlockType, FocusKind, MeasureKind, PresupKind, Span, Token, TokenType};
80
81pub use compile::{
83 compile, compile_all_scopes, compile_all_scopes_with_options, compile_ambiguous,
84 compile_ambiguous_with_options, compile_discourse, compile_discourse_with_options,
85 compile_forest, compile_forest_with_options, compile_kripke, compile_kripke_with,
86 compile_pragmatic, compile_simple, compile_theorem, compile_with_discourse,
87 compile_with_options, compile_with_world_state, compile_with_world_state_interner_options,
88 compile_with_world_state_options, run_proof_sketch, MAX_FOREST_READINGS,
89};
90
91#[cfg(feature = "dynamic-lexicon")]
93pub use logicaffeine_lexicon::runtime as runtime_lexicon;
94
95#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
97pub enum OutputFormat {
98 #[default]
99 Unicode,
100 LaTeX,
101 SimpleFOL,
102 Kripke,
104}
105
106pub struct TranspileContext<'a> {
108 pub registry: &'a mut SymbolRegistry,
109 pub interner: &'a Interner,
110}
111
112impl<'a> TranspileContext<'a> {
113 pub fn new(registry: &'a mut SymbolRegistry, interner: &'a Interner) -> Self {
114 TranspileContext { registry, interner }
115 }
116}
117
118#[derive(Debug, Clone, Copy)]
119pub struct CompileOptions {
120 pub format: OutputFormat,
121 pub pragmatic: bool,
125}
126
127impl Default for CompileOptions {
128 fn default() -> Self {
129 CompileOptions {
130 format: OutputFormat::Unicode,
131 pragmatic: false,
132 }
133 }
134}