diff --git a/dev/odoc.support/fonts/fira-mono-v14-latin-500.woff2 b/dev/odoc.support/fonts/fira-mono-v14-latin-500.woff2 new file mode 100644 index 00000000..9d07a635 Binary files /dev/null and b/dev/odoc.support/fonts/fira-mono-v14-latin-500.woff2 differ diff --git a/dev/odoc.support/fonts/fira-mono-v14-latin-regular.woff2 b/dev/odoc.support/fonts/fira-mono-v14-latin-regular.woff2 new file mode 100644 index 00000000..edc71a86 Binary files /dev/null and b/dev/odoc.support/fonts/fira-mono-v14-latin-regular.woff2 differ diff --git a/dev/odoc.support/fonts/fira-sans-v17-latin-500.woff2 b/dev/odoc.support/fonts/fira-sans-v17-latin-500.woff2 new file mode 100644 index 00000000..24bb8f45 Binary files /dev/null and b/dev/odoc.support/fonts/fira-sans-v17-latin-500.woff2 differ diff --git a/dev/odoc.support/fonts/fira-sans-v17-latin-500italic.woff2 b/dev/odoc.support/fonts/fira-sans-v17-latin-500italic.woff2 new file mode 100644 index 00000000..1a8b72dc Binary files /dev/null and b/dev/odoc.support/fonts/fira-sans-v17-latin-500italic.woff2 differ diff --git a/dev/odoc.support/fonts/fira-sans-v17-latin-700.woff2 b/dev/odoc.support/fonts/fira-sans-v17-latin-700.woff2 new file mode 100644 index 00000000..40b8a1cf Binary files /dev/null and b/dev/odoc.support/fonts/fira-sans-v17-latin-700.woff2 differ diff --git a/dev/odoc.support/fonts/fira-sans-v17-latin-700italic.woff2 b/dev/odoc.support/fonts/fira-sans-v17-latin-700italic.woff2 new file mode 100644 index 00000000..bdf8f5f9 Binary files /dev/null and b/dev/odoc.support/fonts/fira-sans-v17-latin-700italic.woff2 differ diff --git a/dev/odoc.support/fonts/fira-sans-v17-latin-italic.woff2 b/dev/odoc.support/fonts/fira-sans-v17-latin-italic.woff2 new file mode 100644 index 00000000..b9619dd5 Binary files /dev/null and b/dev/odoc.support/fonts/fira-sans-v17-latin-italic.woff2 differ diff --git a/dev/odoc.support/fonts/fira-sans-v17-latin-regular.woff2 b/dev/odoc.support/fonts/fira-sans-v17-latin-regular.woff2 new file mode 100644 index 00000000..d31eba84 Binary files /dev/null and b/dev/odoc.support/fonts/fira-sans-v17-latin-regular.woff2 differ diff --git a/dev/odoc.support/fonts/noticia-text-v15-latin-700.woff2 b/dev/odoc.support/fonts/noticia-text-v15-latin-700.woff2 new file mode 100644 index 00000000..536fbe1d Binary files /dev/null and b/dev/odoc.support/fonts/noticia-text-v15-latin-700.woff2 differ diff --git a/dev/odoc.support/fonts/noticia-text-v15-latin-italic.woff2 b/dev/odoc.support/fonts/noticia-text-v15-latin-italic.woff2 new file mode 100644 index 00000000..9b83b071 Binary files /dev/null and b/dev/odoc.support/fonts/noticia-text-v15-latin-italic.woff2 differ diff --git a/dev/odoc.support/fonts/noticia-text-v15-latin-regular.woff2 b/dev/odoc.support/fonts/noticia-text-v15-latin-regular.woff2 new file mode 100644 index 00000000..efff29f9 Binary files /dev/null and b/dev/odoc.support/fonts/noticia-text-v15-latin-regular.woff2 differ diff --git a/dev/odoc.support/highlight.pack.js b/dev/odoc.support/highlight.pack.js index a3731597..7d1bcd04 100644 --- a/dev/odoc.support/highlight.pack.js +++ b/dev/odoc.support/highlight.pack.js @@ -302,7 +302,238 @@ e["after:highlightBlock"](Object.assign({block:t.el},t))})})(e),s.push(e)} },t.versionString="11.7.0",t.regex={concat:p,lookahead:d,either:f,optional:h, anyNumberOfTimes:u};for(const t in A)"object"==typeof A[t]&&e.exports(A[t]) ;return Object.assign(t,A),t})({});return te}() -;"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs);/*! `xml` grammar compiled for Highlight.js 11.7.0 */ +;"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs);/*! `reasonml` grammar compiled for Highlight.js 11.7.0 */ +(()=>{var e=(()=>{"use strict";return e=>{ +const n="~?[a-z$_][0-9a-zA-Z$_]*",a="`?[A-Z$_][0-9a-zA-Z$_]*",s="("+["||","++","**","+.","*","/","*.","/.","..."].map((e=>e.split("").map((e=>"\\"+e)).join(""))).join("|")+"|\\|>|&&|==|===)",i="\\s+"+s+"\\s+",r={ +keyword:"and as asr assert begin class constraint do done downto else end exception external for fun function functor if in include inherit initializer land lazy let lor lsl lsr lxor match method mod module mutable new nonrec object of open or private rec sig struct then to try type val virtual when while with", +built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 ref string unit ", +literal:"true false" +},l="\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",t={ +className:"number",relevance:0,variants:[{begin:l},{begin:"\\(-"+l+"\\)"}]},c={ +className:"operator",relevance:0,begin:s},o=[{className:"identifier", +relevance:0,begin:n},c,t],g=[e.QUOTE_STRING_MODE,c,{className:"module", +begin:"\\b"+a,returnBegin:!0,relevance:0,end:".",contains:[{ +className:"identifier",begin:a,relevance:0}]}],b=[{className:"module", +begin:"\\b"+a,returnBegin:!0,end:".",relevance:0,contains:[{ +className:"identifier",begin:a,relevance:0}]}],m={className:"function", +relevance:0,keywords:r,variants:[{begin:"\\s(\\(\\.?.*?\\)|"+n+")\\s*=>", +end:"\\s*=>",returnBegin:!0,relevance:0,contains:[{className:"params", +variants:[{begin:n},{ +begin:"~?[a-z$_][0-9a-zA-Z$_]*(\\s*:\\s*[a-z$_][0-9a-z$_]*(\\(\\s*('?[a-z$_][0-9a-z$_]*\\s*(,'?[a-z$_][0-9a-z$_]*\\s*)*)?\\))?){0,2}" +},{begin:/\(\s*\)/}]}]},{begin:"\\s\\(\\.?[^;\\|]*\\)\\s*=>",end:"\\s=>", +returnBegin:!0,relevance:0,contains:[{className:"params",relevance:0,variants:[{ +begin:n,end:"(,|\\n|\\))",relevance:0,contains:[c,{className:"typing",begin:":", +end:"(,|\\n)",returnBegin:!0,relevance:0,contains:b}]}]}]},{ +begin:"\\(\\.\\s"+n+"\\)\\s*=>"}]};g.push(m);const d={className:"constructor", +begin:a+"\\(",end:"\\)",illegal:"\\n",keywords:r, +contains:[e.QUOTE_STRING_MODE,c,{className:"params",begin:"\\b"+n}]},u={ +className:"pattern-match",begin:"\\|",returnBegin:!0,keywords:r,end:"=>", +relevance:0,contains:[d,c,{relevance:0,className:"constructor",begin:a}]},v={ +className:"module-access",keywords:r,returnBegin:!0,variants:[{ +begin:"\\b("+a+"\\.)+"+n},{begin:"\\b("+a+"\\.)+\\(",end:"\\)",returnBegin:!0, +contains:[m,{begin:"\\(",end:"\\)",relevance:0,skip:!0}].concat(g)},{ +begin:"\\b("+a+"\\.)+\\{",end:/\}/}],contains:g};return b.push(v),{ +name:"ReasonML",aliases:["re"],keywords:r,illegal:"(:-|:=|\\$\\{|\\+=)", +contains:[e.COMMENT("/\\*","\\*/",{illegal:"^(#,\\/\\/)"}),{ +className:"character",begin:"'(\\\\[^']+|[^'])'",illegal:"\\n",relevance:0 +},e.QUOTE_STRING_MODE,{className:"literal",begin:"\\(\\)",relevance:0},{ +className:"literal",begin:"\\[\\|",end:"\\|\\]",relevance:0,contains:o},{ +className:"literal",begin:"\\[",end:"\\]",relevance:0,contains:o},d,{ +className:"operator",begin:i,illegal:"--\x3e",relevance:0 +},t,e.C_LINE_COMMENT_MODE,u,m,{className:"module-def", +begin:"\\bmodule\\s+"+n+"\\s+"+a+"\\s+=\\s+\\{",end:/\}/,returnBegin:!0, +keywords:r,relevance:0,contains:[{className:"module",relevance:0,begin:a},{ +begin:/\{/,end:/\}/,relevance:0,skip:!0}].concat(g)},v]}}})() +;hljs.registerLanguage("reasonml",e)})();/*! `javascript` grammar compiled for Highlight.js 11.7.0 */ +(()=>{var e=(()=>{"use strict" +;const e="[A-Za-z$_][0-9A-Za-z$_]*",n=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],a=["true","false","null","undefined","NaN","Infinity"],t=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],s=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],r=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],c=["arguments","this","super","console","window","document","localStorage","module","global"],i=[].concat(r,t,s) +;return o=>{const l=o.regex,b=e,d={begin:/<[A-Za-z0-9\\._:-]+/, +end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{ +const a=e[0].length+e.index,t=e.input[a] +;if("<"===t||","===t)return void n.ignoreMatch();let s +;">"===t&&(((e,{after:n})=>{const a=""+e[0].slice(1) +;return-1!==e.input.indexOf(a,n)})(e,{after:a})||n.ignoreMatch()) +;const r=e.input.substring(a) +;((s=r.match(/^\s*=/))||(s=r.match(/^\s+extends\s+/))&&0===s.index)&&n.ignoreMatch() +}},g={$pattern:e,keyword:n,literal:a,built_in:i,"variable.language":c +},u="\\.([0-9](_?[0-9])*)",m="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",E={ +className:"number",variants:[{ +begin:`(\\b(${m})((${u})|\\.)?|(${u}))[eE][+-]?([0-9](_?[0-9])*)\\b`},{ +begin:`\\b(${m})\\b((${u})\\b|\\.)?|(${u})\\b`},{ +begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{ +begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{ +begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{ +begin:"\\b0[0-7]+n?\\b"}],relevance:0},A={className:"subst",begin:"\\$\\{", +end:"\\}",keywords:g,contains:[]},y={begin:"html`",end:"",starts:{end:"`", +returnEnd:!1,contains:[o.BACKSLASH_ESCAPE,A],subLanguage:"xml"}},N={ +begin:"css`",end:"",starts:{end:"`",returnEnd:!1, +contains:[o.BACKSLASH_ESCAPE,A],subLanguage:"css"}},_={className:"string", +begin:"`",end:"`",contains:[o.BACKSLASH_ESCAPE,A]},h={className:"comment", +variants:[o.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{ +begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag", +begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0, +excludeBegin:!0,relevance:0},{className:"variable",begin:b+"(?=\\s*(-)|$)", +endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}] +}),o.C_BLOCK_COMMENT_MODE,o.C_LINE_COMMENT_MODE] +},f=[o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,y,N,_,{match:/\$\d+/},E] +;A.contains=f.concat({begin:/\{/,end:/\}/,keywords:g,contains:["self"].concat(f) +});const v=[].concat(h,A.contains),p=v.concat([{begin:/\(/,end:/\)/,keywords:g, +contains:["self"].concat(v)}]),S={className:"params",begin:/\(/,end:/\)/, +excludeBegin:!0,excludeEnd:!0,keywords:g,contains:p},w={variants:[{ +match:[/class/,/\s+/,b,/\s+/,/extends/,/\s+/,l.concat(b,"(",l.concat(/\./,b),")*")], +scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{ +match:[/class/,/\s+/,b],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0, +match:l.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/), +className:"title.class",keywords:{_:[...t,...s]}},O={variants:[{ +match:[/function/,/\s+/,b,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}], +className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S], +illegal:/%/},k={ +match:l.concat(/\b/,(I=[...r,"super","import"],l.concat("(?!",I.join("|"),")")),b,l.lookahead(/\(/)), +className:"title.function",relevance:0};var I;const x={ +begin:l.concat(/\./,l.lookahead(l.concat(b,/(?![0-9A-Za-z$_(])/))),end:b, +excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},T={ +match:[/get|set/,/\s+/,b,/(?=\()/],className:{1:"keyword",3:"title.function"}, +contains:[{begin:/\(\)/},S] +},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+o.UNDERSCORE_IDENT_RE+")\\s*=>",M={ +match:[/const|var|let/,/\s+/,b,/\s*/,/=\s*/,/(async\s*)?/,l.lookahead(C)], +keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]} +;return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:g,exports:{ +PARAMS_CONTAINS:p,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/, +contains:[o.SHEBANG({label:"shebang",binary:"node",relevance:5}),{ +label:"use_strict",className:"meta",relevance:10, +begin:/^\s*['"]use (strict|asm)['"]/ +},o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,y,N,_,h,{match:/\$\d+/},E,R,{ +className:"attr",begin:b+l.lookahead(":"),relevance:0},M,{ +begin:"("+o.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*", +keywords:"return throw case",relevance:0,contains:[h,o.REGEXP_MODE,{ +className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{ +className:"params",variants:[{begin:o.UNDERSCORE_IDENT_RE,relevance:0},{ +className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0, +excludeEnd:!0,keywords:g,contains:p}]}]},{begin:/,/,relevance:0},{match:/\s+/, +relevance:0},{variants:[{begin:"<>",end:">"},{ +match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:d.begin, +"on:begin":d.isTrulyOpeningTag,end:d.end}],subLanguage:"xml",contains:[{ +begin:d.begin,end:d.end,skip:!0,contains:["self"]}]}]},O,{ +beginKeywords:"while if switch catch for"},{ +begin:"\\b(?!function)"+o.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{", +returnBegin:!0,label:"func.def",contains:[S,o.inherit(o.TITLE_MODE,{begin:b, +className:"title.function"})]},{match:/\.\.\./,relevance:0},x,{match:"\\$"+b, +relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"}, +contains:[S]},k,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/, +className:"variable.constant"},w,T,{match:/\$[(.]/}]}}})() +;hljs.registerLanguage("javascript",e)})();/*! `sql` grammar compiled for Highlight.js 11.7.0 */ +(()=>{var e=(()=>{"use strict";return e=>{ +const r=e.regex,t=e.COMMENT("--","$"),n=["true","false","unknown"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],i=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],s=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],o=i,c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter((e=>!i.includes(e))),l={ +begin:r.concat(/\b/,r.either(...o),/\s*\(/),relevance:0,keywords:{built_in:o}} +;return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{ +$pattern:/\b[\w\.]+/,keyword:((e,{exceptions:r,when:t}={})=>{const n=t +;return r=r||[],e.map((e=>e.match(/\|\d+$/)||r.includes(e)?e:n(e)?e+"|0":e)) +})(c,{when:e=>e.length<3}),literal:n,type:a, +built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"] +},contains:[{begin:r.either(...s),relevance:0,keywords:{$pattern:/[\w\.]+/, +keyword:c.concat(s),literal:n,type:a}},{className:"type", +begin:r.either("double precision","large object","with timezone","without timezone") +},l,{className:"variable",begin:/@[a-z0-9]+/},{className:"string",variants:[{ +begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{ +begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,t,{className:"operator", +begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}}})() +;hljs.registerLanguage("sql",e)})();/*! `bash` grammar compiled for Highlight.js 11.7.0 */ +(()=>{var e=(()=>{"use strict";return e=>{const s=e.regex,t={},n={begin:/\$\{/, +end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]};Object.assign(t,{ +className:"variable",variants:[{ +begin:s.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},n]});const a={ +className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i={ +begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/, +end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/, +contains:[e.BACKSLASH_ESCAPE,t,a]};a.contains.push(c);const o={begin:/\$?\(\(/, +end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,t] +},r=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10 +}),l={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0, +contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{ +name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/, +keyword:["if","then","else","elif","fi","for","while","in","do","done","case","esac","function"], +literal:["true","false"], +built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"] +},contains:[r,e.SHEBANG(),l,o,e.HASH_COMMENT_MODE,i,{match:/(\/[a-z._-]+)+/},c,{ +className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},t]}}})() +;hljs.registerLanguage("bash",e)})();/*! `shell` grammar compiled for Highlight.js 11.7.0 */ +(()=>{var s=(()=>{"use strict";return s=>({name:"Shell Session", +aliases:["console","shellsession"],contains:[{className:"meta.prompt", +begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/, +subLanguage:"bash"}}]})})();hljs.registerLanguage("shell",s)})();/*! `plaintext` grammar compiled for Highlight.js 11.7.0 */ +(()=>{var t=(()=>{"use strict";return t=>({name:"Plain text", +aliases:["text","txt"],disableAutodetect:!0})})() +;hljs.registerLanguage("plaintext",t)})();/*! `graphql` grammar compiled for Highlight.js 11.7.0 */ +(()=>{var e=(()=>{"use strict";return e=>{const a=e.regex;return{name:"GraphQL", +aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{ +keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"], +literal:["true","false","null"]}, +contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{ +scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation", +begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/, +end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{ +scope:"symbol",begin:a.concat(/[_A-Za-z][_0-9A-Za-z]*/,a.lookahead(/\s*:/)), +relevance:0}],illegal:[/[;<']/,/BEGIN/]}}})();hljs.registerLanguage("graphql",e) +})();/*! `ocaml` grammar compiled for Highlight.js 11.7.0 */ +(()=>{var e=(()=>{"use strict";return e=>({name:"OCaml",aliases:["ml"], +keywords:{$pattern:"[a-z_]\\w*!?", +keyword:"and as assert asr begin class constraint do done downto else end exception external for fun function functor if in include inherit! inherit initializer land lazy let lor lsl lsr lxor match method!|10 method mod module mutable new object of open! open or private rec sig struct then to try type val! val virtual when while with parser value", +built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 string unit in_channel out_channel ref", +literal:"true false"},illegal:/\/\/|>>/,contains:[{className:"literal", +begin:"\\[(\\|\\|)?\\]|\\(\\)",relevance:0},e.COMMENT("\\(\\*","\\*\\)",{ +contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[\\w']*"},{ +className:"type",begin:"`[A-Z][\\w']*"},{className:"type", +begin:"\\b[A-Z][\\w']*",relevance:0},{begin:"[a-z_]\\w*'[\\w']*",relevance:0 +},e.inherit(e.APOS_STRING_MODE,{className:"string",relevance:0 +}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"number", +begin:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)", +relevance:0},{begin:/->/}]})})();hljs.registerLanguage("ocaml",e)})();/*! `json` grammar compiled for Highlight.js 11.7.0 */ +(()=>{var e=(()=>{"use strict";return e=>{const a=["true","false","null"],n={ +scope:"literal",beginKeywords:a.join(" ")};return{name:"JSON",keywords:{ +literal:a},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/, +relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0 +},e.QUOTE_STRING_MODE,n,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE], +illegal:"\\S"}}})();hljs.registerLanguage("json",e)})();/*! `python` grammar compiled for Highlight.js 11.7.0 */ +(()=>{var e=(()=>{"use strict";return e=>{ +const n=e.regex,a=/[\p{XID_Start}_]\p{XID_Continue}*/u,i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],s={ +$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i, +built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"], +literal:["__debug__","Ellipsis","False","None","NotImplemented","True"], +type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"] +},t={className:"meta",begin:/^(>>>|\.\.\.) /},r={className:"subst",begin:/\{/, +end:/\}/,keywords:s,illegal:/#/},l={begin:/\{\{/,relevance:0},b={ +className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{ +begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/, +contains:[e.BACKSLASH_ESCAPE,t],relevance:10},{ +begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/, +contains:[e.BACKSLASH_ESCAPE,t],relevance:10},{ +begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/, +contains:[e.BACKSLASH_ESCAPE,t,l,r]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/, +end:/"""/,contains:[e.BACKSLASH_ESCAPE,t,l,r]},{begin:/([uU]|[rR])'/,end:/'/, +relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{ +begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/, +end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/, +contains:[e.BACKSLASH_ESCAPE,l,r]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/, +contains:[e.BACKSLASH_ESCAPE,l,r]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE] +},o="[0-9](_?[0-9])*",c=`(\\b(${o}))?\\.(${o})|\\b(${o})\\.`,d="\\b|"+i.join("|"),g={ +className:"number",relevance:0,variants:[{ +begin:`(\\b(${o})|(${c}))[eE][+-]?(${o})[jJ]?(?=${d})`},{begin:`(${c})[jJ]?`},{ +begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{ +begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})` +},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${o})[jJ](?=${d})` +}]},p={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:s, +contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={ +className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/, +end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s, +contains:["self",t,g,b,e.HASH_COMMENT_MODE]}]};return r.contains=[b,g,t],{ +name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:s, +illegal:/(<\/|->|\?)|=>/,contains:[t,g,{begin:/\bself\b/},{beginKeywords:"if", +relevance:0},b,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,a],scope:{ +1:"keyword",3:"title.function"},contains:[m]},{variants:[{ +match:[/\bclass/,/\s+/,a,/\s*/,/\(\s*/,a,/\s*\)/]},{match:[/\bclass/,/\s+/,a]}], +scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{ +className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,m,b]}]}}})() +;hljs.registerLanguage("python",e)})();/*! `xml` grammar compiled for Highlight.js 11.7.0 */ (()=>{var e=(()=>{"use strict";return e=>{ const a=e.regex,n=a.concat(/[\p{L}_]/u,a.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),s={ className:"symbol",begin:/&[a-z]+;|[0-9]+;|[a-f0-9]+;/},t={begin:/\s/, @@ -360,102 +591,44 @@ contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{ begin:"^[-\\*]{3,}",end:"$"},a,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{ className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{ className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}}})() -;hljs.registerLanguage("markdown",e)})();/*! `plaintext` grammar compiled for Highlight.js 11.7.0 */ -(()=>{var t=(()=>{"use strict";return t=>({name:"Plain text", -aliases:["text","txt"],disableAutodetect:!0})})() -;hljs.registerLanguage("plaintext",t)})();/*! `ocaml` grammar compiled for Highlight.js 11.7.0 */ -(()=>{var e=(()=>{"use strict";return e=>({name:"OCaml",aliases:["ml"], -keywords:{$pattern:"[a-z_]\\w*!?", -keyword:"and as assert asr begin class constraint do done downto else end exception external for fun function functor if in include inherit! inherit initializer land lazy let lor lsl lsr lxor match method!|10 method mod module mutable new object of open! open or private rec sig struct then to try type val! val virtual when while with parser value", -built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 string unit in_channel out_channel ref", -literal:"true false"},illegal:/\/\/|>>/,contains:[{className:"literal", -begin:"\\[(\\|\\|)?\\]|\\(\\)",relevance:0},e.COMMENT("\\(\\*","\\*\\)",{ -contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[\\w']*"},{ -className:"type",begin:"`[A-Z][\\w']*"},{className:"type", -begin:"\\b[A-Z][\\w']*",relevance:0},{begin:"[a-z_]\\w*'[\\w']*",relevance:0 -},e.inherit(e.APOS_STRING_MODE,{className:"string",relevance:0 -}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"number", -begin:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)", -relevance:0},{begin:/->/}]})})();hljs.registerLanguage("ocaml",e)})();/*! `python` grammar compiled for Highlight.js 11.7.0 */ -(()=>{var e=(()=>{"use strict";return e=>{ -const n=e.regex,a=/[\p{XID_Start}_]\p{XID_Continue}*/u,i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],s={ -$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i, -built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"], -literal:["__debug__","Ellipsis","False","None","NotImplemented","True"], -type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"] -},t={className:"meta",begin:/^(>>>|\.\.\.) /},r={className:"subst",begin:/\{/, -end:/\}/,keywords:s,illegal:/#/},l={begin:/\{\{/,relevance:0},b={ -className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{ -begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/, -contains:[e.BACKSLASH_ESCAPE,t],relevance:10},{ -begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/, -contains:[e.BACKSLASH_ESCAPE,t],relevance:10},{ -begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/, -contains:[e.BACKSLASH_ESCAPE,t,l,r]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/, -end:/"""/,contains:[e.BACKSLASH_ESCAPE,t,l,r]},{begin:/([uU]|[rR])'/,end:/'/, -relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{ -begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/, -end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/, -contains:[e.BACKSLASH_ESCAPE,l,r]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/, -contains:[e.BACKSLASH_ESCAPE,l,r]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE] -},o="[0-9](_?[0-9])*",c=`(\\b(${o}))?\\.(${o})|\\b(${o})\\.`,d="\\b|"+i.join("|"),g={ -className:"number",relevance:0,variants:[{ -begin:`(\\b(${o})|(${c}))[eE][+-]?(${o})[jJ]?(?=${d})`},{begin:`(${c})[jJ]?`},{ -begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{ -begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})` -},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${o})[jJ](?=${d})` -}]},p={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:s, -contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={ -className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/, -end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s, -contains:["self",t,g,b,e.HASH_COMMENT_MODE]}]};return r.contains=[b,g,t],{ -name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:s, -illegal:/(<\/|->|\?)|=>/,contains:[t,g,{begin:/\bself\b/},{beginKeywords:"if", -relevance:0},b,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,a],scope:{ -1:"keyword",3:"title.function"},contains:[m]},{variants:[{ -match:[/\bclass/,/\s+/,a,/\s*/,/\(\s*/,a,/\s*\)/]},{match:[/\bclass/,/\s+/,a]}], -scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{ -className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,m,b]}]}}})() -;hljs.registerLanguage("python",e)})();/*! `reasonml` grammar compiled for Highlight.js 11.7.0 */ -(()=>{var e=(()=>{"use strict";return e=>{ -const n="~?[a-z$_][0-9a-zA-Z$_]*",a="`?[A-Z$_][0-9a-zA-Z$_]*",s="("+["||","++","**","+.","*","/","*.","/.","..."].map((e=>e.split("").map((e=>"\\"+e)).join(""))).join("|")+"|\\|>|&&|==|===)",i="\\s+"+s+"\\s+",r={ -keyword:"and as asr assert begin class constraint do done downto else end exception external for fun function functor if in include inherit initializer land lazy let lor lsl lsr lxor match method mod module mutable new nonrec object of open or private rec sig struct then to try type val virtual when while with", -built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 ref string unit ", -literal:"true false" -},l="\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",t={ -className:"number",relevance:0,variants:[{begin:l},{begin:"\\(-"+l+"\\)"}]},c={ -className:"operator",relevance:0,begin:s},o=[{className:"identifier", -relevance:0,begin:n},c,t],g=[e.QUOTE_STRING_MODE,c,{className:"module", -begin:"\\b"+a,returnBegin:!0,relevance:0,end:".",contains:[{ -className:"identifier",begin:a,relevance:0}]}],b=[{className:"module", -begin:"\\b"+a,returnBegin:!0,end:".",relevance:0,contains:[{ -className:"identifier",begin:a,relevance:0}]}],m={className:"function", -relevance:0,keywords:r,variants:[{begin:"\\s(\\(\\.?.*?\\)|"+n+")\\s*=>", -end:"\\s*=>",returnBegin:!0,relevance:0,contains:[{className:"params", -variants:[{begin:n},{ -begin:"~?[a-z$_][0-9a-zA-Z$_]*(\\s*:\\s*[a-z$_][0-9a-z$_]*(\\(\\s*('?[a-z$_][0-9a-z$_]*\\s*(,'?[a-z$_][0-9a-z$_]*\\s*)*)?\\))?){0,2}" -},{begin:/\(\s*\)/}]}]},{begin:"\\s\\(\\.?[^;\\|]*\\)\\s*=>",end:"\\s=>", -returnBegin:!0,relevance:0,contains:[{className:"params",relevance:0,variants:[{ -begin:n,end:"(,|\\n|\\))",relevance:0,contains:[c,{className:"typing",begin:":", -end:"(,|\\n)",returnBegin:!0,relevance:0,contains:b}]}]}]},{ -begin:"\\(\\.\\s"+n+"\\)\\s*=>"}]};g.push(m);const d={className:"constructor", -begin:a+"\\(",end:"\\)",illegal:"\\n",keywords:r, -contains:[e.QUOTE_STRING_MODE,c,{className:"params",begin:"\\b"+n}]},u={ -className:"pattern-match",begin:"\\|",returnBegin:!0,keywords:r,end:"=>", -relevance:0,contains:[d,c,{relevance:0,className:"constructor",begin:a}]},v={ -className:"module-access",keywords:r,returnBegin:!0,variants:[{ -begin:"\\b("+a+"\\.)+"+n},{begin:"\\b("+a+"\\.)+\\(",end:"\\)",returnBegin:!0, -contains:[m,{begin:"\\(",end:"\\)",relevance:0,skip:!0}].concat(g)},{ -begin:"\\b("+a+"\\.)+\\{",end:/\}/}],contains:g};return b.push(v),{ -name:"ReasonML",aliases:["re"],keywords:r,illegal:"(:-|:=|\\$\\{|\\+=)", -contains:[e.COMMENT("/\\*","\\*/",{illegal:"^(#,\\/\\/)"}),{ -className:"character",begin:"'(\\\\[^']+|[^'])'",illegal:"\\n",relevance:0 -},e.QUOTE_STRING_MODE,{className:"literal",begin:"\\(\\)",relevance:0},{ -className:"literal",begin:"\\[\\|",end:"\\|\\]",relevance:0,contains:o},{ -className:"literal",begin:"\\[",end:"\\]",relevance:0,contains:o},d,{ -className:"operator",begin:i,illegal:"--\x3e",relevance:0 -},t,e.C_LINE_COMMENT_MODE,u,m,{className:"module-def", -begin:"\\bmodule\\s+"+n+"\\s+"+a+"\\s+=\\s+\\{",end:/\}/,returnBegin:!0, -keywords:r,relevance:0,contains:[{className:"module",relevance:0,begin:a},{ -begin:/\{/,end:/\}/,relevance:0,skip:!0}].concat(g)},v]}}})() -;hljs.registerLanguage("reasonml",e)})(); \ No newline at end of file +;hljs.registerLanguage("markdown",e)})();/*! `c` grammar compiled for Highlight.js 11.7.0 */ +(()=>{var e=(()=>{"use strict";return e=>{const n=e.regex,t=e.COMMENT("//","$",{ +contains:[{begin:/\\\n/}] +}),s="[a-zA-Z_]\\w*::",a="(decltype\\(auto\\)|"+n.optional(s)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",r={ +className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{ +match:/\batomic_[a-z]{3,6}\b/}]},i={className:"string",variants:[{ +begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{ +begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)", +end:"'",illegal:"."},e.END_SAME_AS_BEGIN({ +begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={ +className:"number",variants:[{begin:"\\b(0b[01']+)"},{ +begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)" +},{ +begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" +}],relevance:0},o={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{ +keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include" +},contains:[{begin:/\\\n/,relevance:0},e.inherit(i,{className:"string"}),{ +className:"string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},c={ +className:"title",begin:n.optional(s)+e.IDENT_RE,relevance:0 +},d=n.optional(s)+e.IDENT_RE+"\\s*\\(",u={ +keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"], +type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"], +literal:"true false NULL", +built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr" +},g=[o,r,t,e.C_BLOCK_COMMENT_MODE,l,i],m={variants:[{begin:/=/,end:/;/},{ +begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}], +keywords:u,contains:g.concat([{begin:/\(/,end:/\)/,keywords:u, +contains:g.concat(["self"]),relevance:0}]),relevance:0},p={ +begin:"("+a+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0, +keywords:u,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)", +keywords:u,relevance:0},{begin:d,returnBegin:!0,contains:[e.inherit(c,{ +className:"title.function"})],relevance:0},{relevance:0,match:/,/},{ +className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0, +contains:[t,e.C_BLOCK_COMMENT_MODE,i,l,r,{begin:/\(/,end:/\)/,keywords:u, +relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,i,l,r]}] +},r,t,e.C_BLOCK_COMMENT_MODE,o]};return{name:"C",aliases:["h"],keywords:u, +disableAutodetect:!0,illegal:"",contains:[].concat(m,p,g,[o,{ +begin:e.IDENT_RE+"::",keywords:u},{className:"class", +beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{ +beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:o, +strings:i,keywords:u}}}})();hljs.registerLanguage("c",e)})(); diff --git a/dev/odoc.support/odoc.css b/dev/odoc.support/odoc.css index 8b0ed5a8..7230f826 100644 --- a/dev/odoc.support/odoc.css +++ b/dev/odoc.support/odoc.css @@ -1,12 +1,97 @@ @charset "UTF-8"; /* Copyright (c) 2016 The odoc contributors. All rights reserved. Distributed under the ISC license, see terms at the end of the file. - odoc 2.2.0 */ + odoc 2.3.0 */ /* Fonts */ -@import url('https://fonts.googleapis.com/css?family=Fira+Mono:400,500'); -@import url('https://fonts.googleapis.com/css?family=Noticia+Text:400,400i,700'); -@import url('https://fonts.googleapis.com/css?family=Fira+Sans:400,400i,500,500i,600,600i,700,700i'); +/* noticia-text-regular - latin */ +@font-face { + font-family: 'Noticia Text'; + font-style: normal; + font-weight: 400; + src: url('fonts/noticia-text-v15-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ +} + +/* noticia-text-italic - latin */ +@font-face { + font-family: 'Noticia Text'; + font-style: italic; + font-weight: 400; + src: url('fonts/noticia-text-v15-latin-italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ +} + +/* noticia-text-700 - latin */ +@font-face { + font-family: 'Noticia Text'; + font-style: normal; + font-weight: 700; + src: url('fonts/noticia-text-v15-latin-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ +} + +/* fira-mono-regular - latin */ +@font-face { + font-family: 'Fira Mono'; + font-style: normal; + font-weight: 400; + src: url('fonts/fira-mono-v14-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ +} + +/* fira-mono-500 - latin */ +@font-face { + font-family: 'Fira Mono'; + font-style: normal; + font-weight: 500; + src: url('fonts/fira-mono-v14-latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ +} + +/* fira-sans-regular - latin */ +@font-face { + font-family: 'Fira Sans'; + font-style: normal; + font-weight: 400; + src: url('fonts/fira-sans-v17-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ +} + +/* fira-sans-italic - latin */ +@font-face { + font-family: 'Fira Sans'; + font-style: italic; + font-weight: 400; + src: url('fonts/fira-sans-v17-latin-italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ +} + +/* fira-sans-500 - latin */ +@font-face { + font-family: 'Fira Sans'; + font-style: normal; + font-weight: 500; + src: url('fonts/fira-sans-v17-latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ +} + +/* fira-sans-500italic - latin */ +@font-face { + font-family: 'Fira Sans'; + font-style: italic; + font-weight: 500; + src: url('fonts/fira-sans-v17-latin-500italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ +} + +/* fira-sans-700 - latin */ +@font-face { + font-family: 'Fira Sans'; + font-style: normal; + font-weight: 700; + src: url('fonts/fira-sans-v17-latin-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ +} + +/* fira-sans-700italic - latin */ +@font-face { + font-family: 'Fira Sans'; + font-style: italic; + font-weight: 700; + src: url('fonts/fira-sans-v17-latin-700italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ +} + :root, .light:root { @@ -14,6 +99,7 @@ --color: #333333; --link-color: #2C94BD; + --source-color: grey; --anchor-hover: #555; --anchor-color: #d5d5d5; --xref-shadow: #cc6666; @@ -33,6 +119,7 @@ --toc-list-border: #ccc; --spec-summary-border-color: #5c9cf5; + --spec-label-color: green; --spec-summary-background: var(--code-background); --spec-summary-hover-background: #ebeff2; --spec-details-after-background: rgba(0, 4, 15, 0.05); @@ -72,6 +159,8 @@ --hljs-type: #ac885b; --hljs-meta: #82aaff; --hljs-variable: #cf6a4c; + + --spec-label-color: lightgreen; } @media (prefers-color-scheme: dark) { @@ -118,6 +207,8 @@ --hljs-type: #ac885b; --hljs-meta: #82aaff; --hljs-variable: #cf6a4c; + + --spec-label-color: lightgreen; } } @@ -142,6 +233,7 @@ table { html { font-size: 15px; + scroll-behavior: smooth; } body { @@ -149,16 +241,23 @@ body { background: #FFFFFF; color: var(--color); background-color: var(--main-background); + font-family: "Noticia Text", Georgia, serif; + line-height: 1.5; } body { - max-width: 100ex; margin-left: calc(10vw + 20ex); margin-right: 4ex; margin-top: 20px; margin-bottom: 50px; - font-family: "Noticia Text", Georgia, serif; - line-height: 1.5; +} + +body.odoc { + max-width: 100ex; +} + +body.odoc-src { + margin-right: calc(10vw + 20ex); } header { @@ -238,6 +337,10 @@ a { color: var(--link-color); } +.odoc-src pre a { + color: inherit; +} + a:hover { box-shadow: 0 1px 0 0 var(--link-color); } @@ -289,6 +392,14 @@ a.anchor { box-shadow: 0 1px 0 0 var(--xref-shadow); } +/* Source links float inside preformated text or headings. */ +a.source_link { + float: right; + color: var(--source-color); + font-family: "Fira Sans", Helvetica, Arial, sans-serif; + font-size: initial; +} + /* Section and document divisions. Until at least 4.03 many of the modules of the stdlib start at .h7, we restart the sequence there like h2 */ @@ -372,32 +483,32 @@ tt, code, pre { font-weight: 400; } -pre { +.odoc pre { padding: 0.1em; border: 1px solid var(--pre-border-color); border-radius: 5px; overflow-x: auto; } -p code, -li code { +.odoc p code, +.odoc li code { background-color: var(--li-code-background); color: var(--li-code-color); border-radius: 3px; padding: 0 0.3ex; } -p a > code { +p a > code, li a > code { color: var(--link-color); } -code { +.odoc code { white-space: pre-wrap; } /* Code blocks (e.g. Examples) */ -pre code { +.odoc pre code { font-size: 0.893rem; } @@ -419,6 +530,10 @@ pre code { padding: 0.35em 0.5em; } +.spec .label, .spec .optlabel { + color: var(--spec-label-color); +} + li:not(:last-child) > .def-doc { margin-bottom: 15px; } @@ -536,6 +651,12 @@ td.def-doc *:first-child { .at-tags li { padding-left: 3ex; text-indent: -3ex; } .at-tags .at-tag { text-transform: capitalize } +/* Alert emoji */ + +.alert::before, .deprecated::before { + content: '⚠️ '; +} + /* Lists of modules */ .modules { list-style-type: none; margin-left: -3ex; } @@ -674,10 +795,26 @@ td.def-doc *:first-child { padding-left: 12px; } +/* Tables */ + +.odoc-table { + margin: 1em; +} + +.odoc-table td, .odoc-table th { + padding-left: 0.5em; + padding-right: 0.5em; + border: 1px solid black; +} + +.odoc-table th { + font-weight: bold; +} + /* Mobile adjustements. */ -@media only screen and (max-width: 95ex) { - body.odoc { +@media only screen and (max-width: 110ex) { + body { margin: 2em; } .odoc-toc { @@ -704,6 +841,47 @@ td.def-doc *:first-child { } } +/* Source code. */ + +.source_container { + display: flex; +} + +.source_line_column { + padding-right: 0.5em; + text-align: right; + background: #eee8d5; +} + +.source_line { + padding: 0 1em; +} + +.source_code { + flex-grow: 1; + background: #fdf6e3; + padding: 0 0.3em; + color: #657b83; +} + +/* Source directories */ + +.odoc-directory::before { + content: "📁"; + margin: 0.3em; + font-size: 1.3em; +} + +.odoc-file::before { + content: "📄"; + margin: 0.3em; + font-size: 1.3em; +} + +.odoc-folder-list { + list-style: none; +} + /* Syntax highlighting (based on github-gist) */ .hljs { @@ -777,6 +955,34 @@ td.def-doc *:first-child { text-decoration: underline; } +.VAL, .TYPE, .LET, .REC, .IN, .OPEN, .NONREC, .MODULE, .METHOD, .LETOP, .INHERIT, .INCLUDE, .FUNCTOR, .EXTERNAL, .CONSTRAINT, .ASSERT, .AND, .END, .CLASS, .STRUCT, .SIG { + color: #859900;; +} + +.WITH, .WHILE, .WHEN, .VIRTUAL, .TRY, .TO, .THEN, .PRIVATE, .OF, .NEW, .MUTABLE, .MATCH, .LAZY, .IF, .FUNCTION, .FUN, .FOR, .EXCEPTION, .ELSE, .TO, .DOWNTO, .DO, .DONE, .BEGIN, .AS { + color: #cb4b16; +} + +.TRUE, .FALSE { + color: #b58900; +} + +.failwith, .INT, .SEMISEMI, .LIDENT { + color: #2aa198; +} + +.STRING, .CHAR, .UIDENT { + color: #b58900; +} + +.DOCSTRING { + color: #268bd2; +} + +.COMMENT { + color: #93a1a1; +} + /*--------------------------------------------------------------------------- Copyright (c) 2016 The odoc contributors diff --git a/dev/sidekick-base/Sidekick_base/.dummy b/dev/sidekick-base/Sidekick_base/.dummy deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/sidekick-base/Sidekick_base/Config/Key/index.html b/dev/sidekick-base/Sidekick_base/Config/Key/index.html index 0172705f..7f99c503 100644 --- a/dev/sidekick-base/Sidekick_base/Config/Key/index.html +++ b/dev/sidekick-base/Sidekick_base/Config/Key/index.html @@ -1,2 +1,2 @@ -
Config.Keyval create : unit -> 'a tConfig.Keyval create : unit -> 'a tSidekick_base.ConfigConfiguration
Sidekick_base.ConfigConfiguration
Data_ty.Cstortype t = cstorinclude Sidekick_sigs.EQ_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerData_ty.Cstortype t = cstorinclude Sidekick_sigs.EQ_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerData_ty.Selecttype t = selectinclude Sidekick_sigs.EQ_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerData_ty.Selecttype t = selectinclude Sidekick_sigs.EQ_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerSidekick_base.Data_tytype select = Types_.select = {select_id : ID.t;select_cstor : Types_.cstor;select_ty : Types_.ty lazy_t;select_i : int;}type cstor = Types_.cstor = {cstor_id : ID.t;cstor_is_a : ID.t;mutable cstor_arity : int;cstor_args : select list lazy_t;cstor_ty_as_data : Types_.data;cstor_ty : Types_.ty lazy_t;}type Sidekick_core.Const.view += | Data of Types_.data| Cstor of cstor| Select of select| Is_a of cstorinclude Sidekick_sigs.EQ_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printermodule Select : sig ... endmodule Cstor : sig ... endval data : Sidekick_core.Term.store -> t -> Sidekick_core.Term.tval cstor : Sidekick_core.Term.store -> cstor -> Sidekick_core.Term.tval select : Sidekick_core.Term.store -> select -> Sidekick_core.Term.tval is_a : Sidekick_core.Term.store -> cstor -> Sidekick_core.Term.tval as_data : Types_.ty -> Types_.data optionval as_select : Types_.term -> select optionval as_cstor : Types_.term -> cstor optionval as_is_a : Types_.term -> cstor optionSidekick_base.Data_tytype select = Types_.select = {select_id : ID.t;select_cstor : Types_.cstor;select_ty : Types_.ty lazy_t;select_i : int;}type cstor = Types_.cstor = {cstor_id : ID.t;cstor_is_a : ID.t;mutable cstor_arity : int;cstor_args : select list lazy_t;cstor_ty_as_data : Types_.data;cstor_ty : Types_.ty lazy_t;}type Sidekick_core.Const.view += | Data of Types_.data| Cstor of cstor| Select of select| Is_a of cstorinclude Sidekick_sigs.EQ_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printermodule Select : sig ... endmodule Cstor : sig ... endval data : Sidekick_core.Term.store -> t -> Sidekick_core.Term.tval cstor : Sidekick_core.Term.store -> cstor -> Sidekick_core.Term.tval select : Sidekick_core.Term.store -> select -> Sidekick_core.Term.tval is_a : Sidekick_core.Term.store -> cstor -> Sidekick_core.Term.tval as_data : Types_.ty -> Types_.data optionval as_select : Types_.term -> select optionval as_cstor : Types_.term -> cstor optionval as_is_a : Types_.term -> cstor optionSidekick_base.FormFormulas (boolean terms).
This module defines function symbols, constants, and views to manipulate boolean formulas in Sidekick_base. This is useful to have the ability to use boolean connectives instead of being limited to clauses; by using Sidekick_th_bool_static, the formulas are turned into clauses automatically for you.
type term = Sidekick_core.Term.ttype 'a view = 'a Sidekick_core.Bool_view.t = val bool : Sidekick_core.Term.store -> bool -> termval not_ : Sidekick_core.Term.store -> term -> termval and_ : Sidekick_core.Term.store -> term -> term -> termval or_ : Sidekick_core.Term.store -> term -> term -> termval eq : Sidekick_core.Term.store -> term -> term -> termval neq : Sidekick_core.Term.store -> term -> term -> termval imply : Sidekick_core.Term.store -> term -> term -> termval equiv : Sidekick_core.Term.store -> term -> term -> termval xor : Sidekick_core.Term.store -> term -> term -> termval ite : Sidekick_core.Term.store -> term -> term -> term -> termval distinct_l : Sidekick_core.Term.store -> term list -> termval const_decoders : Sidekick_core.Const.decodersval and_l : Sidekick_core.Term.store -> term list -> termval or_l : Sidekick_core.Term.store -> term list -> termval imply_l : Sidekick_core.Term.store -> term list -> term -> termval mk_of_view : Sidekick_core.Term.store -> term view -> termSidekick_base.FormFormulas (boolean terms).
This module defines function symbols, constants, and views to manipulate boolean formulas in Sidekick_base. This is useful to have the ability to use boolean connectives instead of being limited to clauses; by using Sidekick_th_bool_static, the formulas are turned into clauses automatically for you.
type term = Sidekick_core.Term.ttype 'a view = 'a Sidekick_core.Bool_view.t = val bool : Sidekick_core.Term.store -> bool -> termval not_ : Sidekick_core.Term.store -> term -> termval and_ : Sidekick_core.Term.store -> term -> term -> termval or_ : Sidekick_core.Term.store -> term -> term -> termval eq : Sidekick_core.Term.store -> term -> term -> termval neq : Sidekick_core.Term.store -> term -> term -> termval imply : Sidekick_core.Term.store -> term -> term -> termval equiv : Sidekick_core.Term.store -> term -> term -> termval xor : Sidekick_core.Term.store -> term -> term -> termval ite : Sidekick_core.Term.store -> term -> term -> term -> termval distinct_l : Sidekick_core.Term.store -> term list -> termval const_decoders : Sidekick_core.Const.decodersval and_l : Sidekick_core.Term.store -> term list -> termval or_l : Sidekick_core.Term.store -> term list -> termval imply_l : Sidekick_core.Term.store -> term list -> term -> termval mk_of_view : Sidekick_core.Term.store -> term view -> termSidekick_base.IDUnique Identifiers
We use generative identifiers everywhere in Sidekick_base. Unlike strings, there are no risk of collision: during parsing, a new declaration or definition should create a fresh ID.t and associate it with the string name, and later references should look into some hashtable or map to get the ID corresponding to a string.
This allows us to handle definition shadowing or binder shadowing easily.
val make : string -> tmake s creates a new identifier with name s and some internal information. It is different than any other identifier created before or after, even with the same name.
val makef : ('a, Stdlib.Format.formatter, unit, t) Stdlib.format4 -> 'amakef "foo %d bar %b" 42 true is like make (Format.asprintf "foo %d bar %b" 42 true).
val id : t -> intUnique integer counter for this identifier.
val to_string : t -> stringPrint identifier.
val to_string_full : t -> stringPrinter name and unique counter for this ID.
val ser : t -> Sidekick_util.Ser_value.tval deser : t Sidekick_util.Ser_decode.tinclude Sidekick_sigs.EQ_ORD_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval pp_name : t CCFormat.printerval pp_full : t CCFormat.printerSidekick_base.IDUnique Identifiers
We use generative identifiers everywhere in Sidekick_base. Unlike strings, there are no risk of collision: during parsing, a new declaration or definition should create a fresh ID.t and associate it with the string name, and later references should look into some hashtable or map to get the ID corresponding to a string.
This allows us to handle definition shadowing or binder shadowing easily.
val make : string -> tmake s creates a new identifier with name s and some internal information. It is different than any other identifier created before or after, even with the same name.
val makef : ('a, Stdlib.Format.formatter, unit, t) Stdlib.format4 -> 'amakef "foo %d bar %b" 42 true is like make (Format.asprintf "foo %d bar %b" 42 true).
val id : t -> intUnique integer counter for this identifier.
val to_string : t -> stringPrint identifier.
val to_string_full : t -> stringPrinter name and unique counter for this ID.
val ser : t -> Sidekick_util.Ser_value.tval deser : t Sidekick_util.Ser_decode.tinclude Sidekick_sigs.EQ_ORD_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval pp_name : t CCFormat.printerval pp_full : t CCFormat.printerLRA_term.Opinclude Sidekick_sigs.EQ_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerLRA_term.Opinclude Sidekick_sigs.EQ_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerLRA_term.Predinclude Sidekick_sigs.EQ_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerLRA_term.Predinclude Sidekick_sigs.EQ_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerLRA_term.Viewtype ('num, 'a) lra_view = ('num, 'a) Sidekick_th_lra.lra_view = type 'a t = (Q.t, 'a) Sidekick_th_lra.lra_viewval iter : ('a -> unit) -> 'a t -> unitval pp : pp_t:'a Sidekick_core.Fmt.printer -> 'a t Sidekick_core.Fmt.printerval hash : sub_hash:('a -> int) -> 'a t -> intLRA_term.Viewtype ('num, 'a) lra_view = ('num, 'a) Sidekick_th_lra.lra_view = type 'a t = (Q.t, 'a) Sidekick_th_lra.lra_viewval iter : ('a -> unit) -> 'a t -> unitval pp : pp_t:'a Sidekick_core.Fmt.printer -> 'a t Sidekick_core.Fmt.printerval hash : sub_hash:('a -> int) -> 'a t -> intSidekick_base.LRA_termmodule Pred : sig ... endmodule Op : sig ... endval const_decoders : Sidekick_core.Const.decodersmodule View : sig ... endtype term = Sidekick_core.Term.ttype ty = Sidekick_core.Term.tval term_of_view : Sidekick_core.Term.store -> term View.t -> termval real : Sidekick_core.Term.store -> tyval has_ty_real : term -> boolval pred : Sidekick_core.Term.store -> Pred.t -> term -> term -> termval mult_by : Sidekick_core.Term.store -> Q.t -> term -> termval op : Sidekick_core.Term.store -> Op.t -> term -> term -> termval const : Sidekick_core.Term.store -> Q.t -> termval leq : Sidekick_core.Term.store -> term -> term -> termval lt : Sidekick_core.Term.store -> term -> term -> termval geq : Sidekick_core.Term.store -> term -> term -> termval gt : Sidekick_core.Term.store -> term -> term -> termval eq : Sidekick_core.Term.store -> term -> term -> termval neq : Sidekick_core.Term.store -> term -> term -> termval plus : Sidekick_core.Term.store -> term -> term -> termval minus : Sidekick_core.Term.store -> term -> term -> termSidekick_base.LRA_termmodule Pred : sig ... endmodule Op : sig ... endval const_decoders : Sidekick_core.Const.decodersmodule View : sig ... endtype term = Sidekick_core.Term.ttype ty = Sidekick_core.Term.tval term_of_view : Sidekick_core.Term.store -> term View.t -> termval real : Sidekick_core.Term.store -> tyval has_ty_real : term -> boolval pred : Sidekick_core.Term.store -> Pred.t -> term -> term -> termval mult_by : Sidekick_core.Term.store -> Q.t -> term -> termval op : Sidekick_core.Term.store -> Op.t -> term -> term -> termval const : Sidekick_core.Term.store -> Q.t -> termval leq : Sidekick_core.Term.store -> term -> term -> termval lt : Sidekick_core.Term.store -> term -> term -> termval geq : Sidekick_core.Term.store -> term -> term -> termval gt : Sidekick_core.Term.store -> term -> term -> termval eq : Sidekick_core.Term.store -> term -> term -> termval neq : Sidekick_core.Term.store -> term -> term -> termval plus : Sidekick_core.Term.store -> term -> term -> termval minus : Sidekick_core.Term.store -> term -> term -> termSidekick_base.Solverinclude module type of struct include Sidekick_smt_solver.Solver endmodule Check_res = Sidekick_smt_solver.Solver.Check_resmodule Unknown = Sidekick_smt_solver.Solver.Unknowntype t = Sidekick_smt_solver.Solver.tThe solver's state.
val registry : t -> Sidekick_smt_solver.Registry.tA solver contains a registry so that theories can share data
type theory = Sidekick_smt_solver.Theory.tval mk_theory :
- name:string ->
- create_and_setup:
- (id:Sidekick_smt_solver.Theory_id.t ->
+Solver (sidekick-base.Sidekick_base.Solver) Module Sidekick_base.Solver
include module type of struct include Sidekick_smt_solver.Solver end
module Check_res = Sidekick_smt_solver.Solver.Check_resmodule Unknown = Sidekick_smt_solver.Solver.Unknowntype t = Sidekick_smt_solver.Solver.tThe solver's state.
val registry : t -> Sidekick_smt_solver.Registry.tA solver contains a registry so that theories can share data
type theory = Sidekick_smt_solver.Theory.tval mk_theory :
+ name:string ->
+ create_and_setup:
+ (id:Sidekick_smt_solver.Theory_id.t ->
Sidekick_smt_solver.Solver_internal.t ->
'th) ->
- ?push_level:('th -> unit) ->
- ?pop_levels:('th -> int -> unit) ->
+ ?push_level:('th -> unit) ->
+ ?pop_levels:('th -> int -> unit) ->
unit ->
Sidekick_smt_solver.Theory.tHelper to create a theory.
Main API
val stats : t -> Sidekick_util.Stat.tval tst : t -> Sidekick_core.Term.storeval tracer : t -> Sidekick_smt_solver.Tracer.tval create :
(module Sidekick_smt_solver.Sigs.ARG) ->
- ?stat:Sidekick_util.Stat.t ->
- ?size:[ `Big | `Tiny | `Small ] ->
- tracer:Sidekick_smt_solver.Tracer.t ->
- theories:Sidekick_smt_solver.Theory.t list ->
+ ?stat:Sidekick_util.Stat.t ->
+ ?size:[ `Big | `Tiny | `Small ] ->
+ tracer:Sidekick_smt_solver.Tracer.t ->
+ theories:Sidekick_smt_solver.Theory.t list ->
Sidekick_core.Term.store ->
unit ->
tCreate a new solver.
It needs a term state and a type state to manipulate terms and types. All terms and types interacting with this solver will need to come from these exact states.
val add_theory : t -> Sidekick_smt_solver.Theory.t -> unitAdd a theory to the solver. This should be called before any call to solve or to add_clause and the likes (otherwise the theory will have a partial view of the problem).
val add_theory_p : t -> 'a Sidekick_smt_solver.Theory.p -> 'aAdd the given theory and obtain its state
val add_theory_l : t -> Sidekick_smt_solver.Theory.t list -> unitval mk_lit_t :
t ->
- ?sign:bool ->
+ ?sign:bool ->
Sidekick_smt_solver.Sigs.term ->
Sidekick_smt_solver.Sigs.litmk_lit_t _ ~sign t returns lit', where lit' is preprocess(lit) and lit is an internal representation of ± t.
The proof of |- lit = lit' is directly added to the solver's proof.
val add_clause :
t ->
@@ -29,18 +29,18 @@
Sidekick_smt_solver.Sigs.lit list ->
Sidekick_proof.Pterm.delayed ->
unitAdd a clause to the solver, given as a list.
val assert_terms : t -> Sidekick_smt_solver.Sigs.term list -> unitHelper that turns each term into an atom, before adding disjunction of the resulting atoms to the solver as a clause assertion
val assert_term : t -> Sidekick_smt_solver.Sigs.term -> unitHelper that turns the term into an atom, before adding the result to the solver as a unit clause assertion
val add_ty : t -> Sidekick_smt_solver.Sigs.ty -> unittype value = Sidekick_core.Term.ttype sat_result = Check_res.sat_result = {get_value : Sidekick_core.Term.t -> value option;(*Value for this term
*)iter_classes : (Sidekick_core.Term.t Iter.t * value) Iter.t;(*All equivalence classes in the congruence closure
*)eval_lit : Sidekick_core.Lit.t -> bool option;(*Evaluate literal
*)iter_true_lits : Sidekick_core.Lit.t Iter.t;(*Iterate on literals that are true in the trail
*)
}Satisfiable
type unsat_result = Check_res.unsat_result = {unsat_core : unit -> Sidekick_core.Lit.t Iter.t;(*Unsat core (subset of assumptions), or empty
*)unsat_proof : unit -> Sidekick_proof.Step.id option;(*Proof step for the empty clause
*)
}Unsatisfiable
type res = Check_res.t = | Sat of sat_result| Unsat of unsat_result| Unknown of Unknown.t(*Unknown, obtained after a timeout, memory limit, etc.
*)
Result of solving for the current set of clauses
val solve :
- ?on_exit:(unit -> unit) list ->
- ?on_progress:(unit -> unit) ->
- ?should_stop:(int -> bool) ->
- assumptions:Sidekick_smt_solver.Sigs.lit list ->
+ ?on_exit:(unit -> unit) list ->
+ ?on_progress:(unit -> unit) ->
+ ?should_stop:(int -> bool) ->
+ assumptions:Sidekick_smt_solver.Sigs.lit list ->
t ->
ressolve s checks the satisfiability of the clauses added so far to s.
val as_asolver : t -> Sidekick_abstract_solver.Asolver.tComply to the abstract solver interface
Last result, if any. Some operations will erase this (e.g. assert_term).
val push_assumption : t -> Sidekick_smt_solver.Sigs.lit -> unitPushes an assumption onto the assumption stack. It will remain there until it's pop'd by pop_assumptions.
val pop_assumptions : t -> int -> unitpop_assumptions solver n removes n assumptions from the stack. It removes the assumptions that were the most recently added via push_assumptions. Note that check_sat_propagations_only can call this if it meets a conflict.
type propagation_result = Sidekick_smt_solver.Solver.propagation_result = | PR_sat| PR_conflict of {}| PR_unsat of {unsat_core : unit -> Sidekick_smt_solver.Sigs.lit Iter.t;
}
val check_sat_propagations_only :
- assumptions:Sidekick_smt_solver.Sigs.lit list ->
+ assumptions:Sidekick_smt_solver.Sigs.lit list ->
t ->
propagation_resultcheck_sat_propagations_only solver uses assumptions (including the assumptions parameter, and atoms previously added via push_assumptions) and boolean+theory propagation to quickly assess satisfiability. It is not complete; calling solve is required to get an accurate result.
val pp_stats : t CCFormat.printerPrint some statistics. What it prints exactly is unspecified.
val default_arg : (module Sidekick_smt_solver.Sigs.ARG)val create_default :
- ?stat:Sidekick_util.Stat.t ->
- ?size:[ `Big | `Small | `Tiny ] ->
- tracer:Sidekick_smt_solver.Tracer.t ->
- theories:Sidekick_smt_solver.Theory.t list ->
+ ?stat:Sidekick_util.Stat.t ->
+ ?size:[ `Big | `Small | `Tiny ] ->
+ tracer:Sidekick_smt_solver.Tracer.t ->
+ theories:Sidekick_smt_solver.Theory.t list ->
Sidekick_core.Term.store ->
- t
\ No newline at end of file
+ tSidekick_base.StatementStatements.
A statement is an instruction for the SMT solver to do something, like asserting that a formula is true, declaring a new constant, or checking satisfiabilty of the current set of assertions.
type t = Types_.statement = | Stmt_set_logic of string| Stmt_set_option of string list| Stmt_set_info of string * string| Stmt_data of Types_.data list| Stmt_ty_decl of {}new atomic cstor
*)| Stmt_decl of {name : ID.t;ty_args : Types_.ty list;ty_ret : Types_.ty;const : Types_.term;}| Stmt_define of Types_.definition list| Stmt_assert of Types_.term| Stmt_assert_clause of Types_.term list| Stmt_check_sat of (bool * Types_.term) list| Stmt_get_model| Stmt_get_value of Types_.term list| Stmt_exitinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerSidekick_base.StatementStatements.
A statement is an instruction for the SMT solver to do something, like asserting that a formula is true, declaring a new constant, or checking satisfiabilty of the current set of assertions.
type t = Types_.statement = | Stmt_set_logic of string| Stmt_set_option of string list| Stmt_set_info of string * string| Stmt_data of Types_.data list| Stmt_ty_decl of {}new atomic cstor
*)| Stmt_decl of {name : ID.t;ty_args : Types_.ty list;ty_ret : Types_.ty;const : Types_.term;}| Stmt_define of Types_.definition list| Stmt_assert of Types_.term| Stmt_assert_clause of Types_.term list| Stmt_check_sat of (bool * Types_.term) list| Stmt_get_model| Stmt_get_value of Types_.term list| Stmt_exitinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerSidekick_base.Terminclude module type of struct include Sidekick_core.Term endinclude module type of struct include Sidekick_core_logic.Term endtype var = Sidekick_core_logic.Var.ttype bvar = Sidekick_core_logic.Bvar.ttype store = Sidekick_core_logic.Term.storeThe store for terms.
The store is responsible for allocating unique IDs to terms, and enforcing their hashconsing (so that syntactic equality is just a pointer comparison).
include Sidekick_sigs.EQ_ORD_HASH with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intval pp_debug : t Sidekick_util.Fmt.printerval pp_debug_with_ids : t Sidekick_util.Fmt.printerinclude Sidekick_sigs.WITH_SET_MAP_TBL with type t := tmodule Set = Sidekick_core.Term.Setmodule Map = Sidekick_core.Term.Mapmodule Tbl = Sidekick_core.Term.Tblinclude Sidekick_sigs.WITH_WEAK with type t := tmodule Weak_set = Sidekick_core.Term.Weak_setmodule Weak_map = Sidekick_core.Term.Weak_mapval is_app : t -> boolval is_const : t -> boolval is_pi : t -> booliter_dag t ~f calls f once on each subterm of t, t included. It must not traverse t as a tree, but rather as a perfectly shared DAG.
For example, in:
let x = 2 in
+Term (sidekick-base.Sidekick_base.Term) Module Sidekick_base.Term
include module type of struct include Sidekick_core.Term end
include module type of struct include Sidekick_core_logic.Term end
type var = Sidekick_core_logic.Var.ttype bvar = Sidekick_core_logic.Bvar.ttype store = Sidekick_core_logic.Term.storeThe store for terms.
The store is responsible for allocating unique IDs to terms, and enforcing their hashconsing (so that syntactic equality is just a pointer comparison).
include Sidekick_sigs.EQ_ORD_HASH with type t := t
include Sidekick_sigs.EQ with type t := t
include Sidekick_sigs.ORD with type t := t
include Sidekick_sigs.HASH with type t := t
val hash : t -> intval pp_debug : t Sidekick_util.Fmt.printerval pp_debug_with_ids : t Sidekick_util.Fmt.printerContainers
include Sidekick_sigs.WITH_SET_MAP_TBL with type t := t
module Set = Sidekick_core.Term.Setmodule Map = Sidekick_core.Term.Mapmodule Tbl = Sidekick_core.Term.Tblinclude Sidekick_sigs.WITH_WEAK with type t := t
module Weak_set = Sidekick_core.Term.Weak_setmodule Weak_map = Sidekick_core.Term.Weak_mapUtils
val is_app : t -> boolval is_const : t -> boolval is_pi : t -> booliter_dag t ~f calls f once on each subterm of t, t included. It must not traverse t as a tree, but rather as a perfectly shared DAG.
For example, in:
let x = 2 in
let y = f x x in
let z = g y x in
z = z
the DAG has the following nodes:
n1: 2
n2: f n1 n1
n3: g n2 n1
-n4: = n3 n3
iter_shallow f e iterates on immediate subterms of e, calling f trdb e' for each subterm e', with trdb = true iff e' is directly under a binder.
iter_shallow f e iterates on immediate subterms of e, calling f trdb e' for each subterm e', with trdb = true iff e' is directly under a binder.
val free_vars :
+ ?init:Sidekick_core_logic__.Var.Set.t ->
t ->
- Sidekick_core_logic__.Var.Set.tval is_type : t -> boolis_type t is true iff view t is Type _
val is_a_type : t -> boolis_a_type t is true if is_ty (ty t)
val is_closed : t -> boolIs the term closed (all bound variables are paired with a binder)? time: O(1)
val has_fvars : t -> boolDoes the term contain free variables? time: O(1)
Creation
module Store = Sidekick_core.Term.Storemodule DB = Sidekick_core.Term.DBDe bruijn indices
include module type of struct include Sidekick_core_logic.T_builtins end
val bool : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval proof : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval c_not : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval c_eq : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval c_ite : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval true_ : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval false_ : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval is_type : t -> boolis_type t is true iff view t is Type _
val is_a_type : t -> boolis_a_type t is true if is_ty (ty t)
val is_closed : t -> boolIs the term closed (all bound variables are paired with a binder)? time: O(1)
val has_fvars : t -> boolDoes the term contain free variables? time: O(1)
Creation
module Store = Sidekick_core.Term.Storemodule DB = Sidekick_core.Term.DBDe bruijn indices
include module type of struct include Sidekick_core_logic.T_builtins end
val bool : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval proof : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval c_not : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval c_eq : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval c_ite : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval true_ : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval false_ : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval bool_val :
Sidekick_core_logic.Term.store ->
bool ->
Sidekick_core_logic.Term.tval const_decoders : Sidekick_core_logic.Const.decodersSidekick_core_logic.Term.tabs t returns an "absolute value" for the term, along with the sign of t.
The idea is that we want to turn not a into (false, a), or (a != b) into (false, a=b). For terms without a negation this should return (true, t).
val as_bool_val : Sidekick_core_logic.Term.t -> bool optionval open_eq :
Sidekick_core_logic.Term.t ->
(Sidekick_core_logic.Term.t * Sidekick_core_logic.Term.t) optionopen_eq (a=b) returns Some (a,b), None for other terms.
type term = Sidekick_core_logic.Term.ttype hook =
- recurse:term Sidekick_util.Fmt.printer ->
+ recurse:term Sidekick_util.Fmt.printer ->
Sidekick_util.Fmt.t ->
term ->
- boolPrinting hook, responsible for printing certain subterms
module Hooks = Sidekick_core.Term.Hooksval default_hooks : Hooks.t Stdlib.refval pp : term Sidekick_util.Fmt.printerPrint using default_hooks
val pp_limit : max_depth:int -> max_nodes:int -> term Sidekick_util.Fmt.printerPrint with a limit on the number of nodes printed. An ellipsis is displayed otherwise.
module Tracer = Sidekick_core.Term.Tracermodule Trace_reader = Sidekick_core.Term.Trace_readermodule Ref = Sidekick_core.Term.Refmodule Hooks = Sidekick_core.Term.Hooksval default_hooks : Hooks.t Stdlib.refval pp : term Sidekick_util.Fmt.printerPrint using default_hooks
val pp_limit : max_depth:int -> max_nodes:int -> term Sidekick_util.Fmt.printerPrint with a limit on the number of nodes printed. An ellipsis is displayed otherwise.
module Tracer = Sidekick_core.Term.Tracermodule Trace_reader = Sidekick_core.Term.Trace_readermodule Ref = Sidekick_core.Term.Refval view_as_cc :
Sidekick_core_logic.Term.t ->
(Sidekick_core_logic.Const.t,
Sidekick_core_logic.Term.t,
Sidekick_core_logic.Term.t list)
- Sidekick_core.CC_view.tSidekick_base.Th_boolReducing boolean formulas to clauses
val k_config : [ `Dyn | `Static ] Config.Key.tval theory_static : Solver.theoryval theory_dyn : Solver.theoryval theory : Config.t -> Solver.theorySidekick_base.Th_boolReducing boolean formulas to clauses
val k_config : [ `Dyn | `Static ] Config.Key.tval theory_static : Solver.theoryval theory_dyn : Solver.theoryval theory : Config.t -> Solver.theorySidekick_base.Th_dataTheory of datatypes
val arg : (module Sidekick_th_data.ARG)val theory : Sidekick_th_data.SMT.theorySidekick_base.Th_dataTheory of datatypes
val arg : (module Sidekick_th_data.ARG)val theory : Sidekick_th_data.SMT.theorySidekick_base.Th_lraTheory of Linear Rational Arithmetic
module T = Sidekick_core.Termmodule Q = Sidekick_zarith.Rationalval mk_eq : Sidekick_core.Term.store -> Form.term -> Form.term -> Form.termval mk_bool : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval theory : Solver.theorySidekick_base.Th_lraTheory of Linear Rational Arithmetic
module T = Sidekick_core.Termmodule Q = Sidekick_zarith.Rationalval mk_eq : Sidekick_core.Term.store -> Form.term -> Form.term -> Form.termval mk_bool : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval theory : Solver.theorySidekick_base.Th_ty_uninval theory : Solver.theorySidekick_base.Th_ty_uninval theory : Solver.theorySidekick_base.Tyinclude module type of struct include Sidekick_core.Term endinclude module type of struct include Sidekick_core_logic.Term endtype var = Sidekick_core_logic.Var.ttype bvar = Sidekick_core_logic.Bvar.ttype store = Sidekick_core_logic.Term.storeThe store for terms.
The store is responsible for allocating unique IDs to terms, and enforcing their hashconsing (so that syntactic equality is just a pointer comparison).
View.
A view is the shape of the root node of a term.
include Sidekick_sigs.EQ_ORD_HASH
+Ty (sidekick-base.Sidekick_base.Ty) Module Sidekick_base.Ty
include module type of struct include Sidekick_core.Term end
include module type of struct include Sidekick_core_logic.Term end
type var = Sidekick_core_logic.Var.ttype bvar = Sidekick_core_logic.Bvar.ttype store = Sidekick_core_logic.Term.storeThe store for terms.
The store is responsible for allocating unique IDs to terms, and enforcing their hashconsing (so that syntactic equality is just a pointer comparison).
View.
A view is the shape of the root node of a term.
include Sidekick_sigs.EQ_ORD_HASH
with type t := Sidekick_core_logic__.Types_.term
include Sidekick_sigs.EQ with type t := Sidekick_core_logic__.Types_.term
include Sidekick_sigs.ORD with type t := Sidekick_core_logic__.Types_.term
include Sidekick_sigs.HASH with type t := Sidekick_core_logic__.Types_.term
Containers
include Sidekick_sigs.WITH_SET_MAP_TBL
with type t := Sidekick_core_logic__.Types_.term
module Set = Sidekick_core.Term.Setmodule Map = Sidekick_core.Term.Mapmodule Tbl = Sidekick_core.Term.Tblinclude Sidekick_sigs.WITH_WEAK
with type t := Sidekick_core_logic__.Types_.term
module Weak_set = Sidekick_core.Term.Weak_setmodule Weak_map = Sidekick_core.Term.Weak_mapUtils
val view : Sidekick_core_logic__.Types_.term -> viewval iter_dag :
- ?seen:unit Tbl.t ->
- iter_ty:bool ->
- f:(Sidekick_core_logic__.Types_.term -> unit) ->
+ ?seen:unit Tbl.t ->
+ iter_ty:bool ->
+ f:(Sidekick_core_logic__.Types_.term -> unit) ->
Sidekick_core_logic__.Types_.term ->
unititer_dag t ~f calls f once on each subterm of t, t included. It must not traverse t as a tree, but rather as a perfectly shared DAG.
For example, in:
let x = 2 in
let y = f x x in
@@ -17,35 +17,35 @@ z = z
the DAG has the following nodes:
val iter_shallow :
- f:(bool -> Sidekick_core_logic__.Types_.term -> unit) ->
+ f:(bool -> Sidekick_core_logic__.Types_.term -> unit) ->
Sidekick_core_logic__.Types_.term ->
unititer_shallow f e iterates on immediate subterms of e, calling f trdb e' for each subterm e', with trdb = true iff e' is directly under a binder.
val map_shallow :
store ->
- f:
+ f:
(bool ->
Sidekick_core_logic__.Types_.term ->
Sidekick_core_logic__.Types_.term) ->
Sidekick_core_logic__.Types_.term ->
Sidekick_core_logic__.Types_.termval free_vars_iter : Sidekick_core_logic__.Types_.term -> var Iter.tIs the term closed (all bound variables are paired with a binder)? time: O(1)
Does the term contain free variables? time: O(1)
Return the type of this term.
Creation
module Store = Sidekick_core.Term.Storeval type_ : store -> Sidekick_core_logic__.Types_.termval type_of_univ : store -> int -> Sidekick_core_logic__.Types_.termval var_str :
store ->
string ->
- ty:Sidekick_core_logic__.Types_.term ->
+ ty:Sidekick_core_logic__.Types_.term ->
Sidekick_core_logic__.Types_.termval bvar_i :
store ->
int ->
- ty:Sidekick_core_logic__.Types_.term ->
+ ty:Sidekick_core_logic__.Types_.term ->
Sidekick_core_logic__.Types_.termval const :
store ->
Sidekick_core_logic__.Types_.const ->
@@ -59,8 +59,8 @@ n4: = n3 n3Sidekick_core_logic__.Types_.term list ->
Sidekick_core_logic__.Types_.termval app_fold :
store ->
- f:Sidekick_core_logic__.Types_.term ->
- acc0:Sidekick_core_logic__.Types_.term ->
+ f:Sidekick_core_logic__.Types_.term ->
+ acc0:Sidekick_core_logic__.Types_.term ->
Sidekick_core_logic__.Types_.term list ->
Sidekick_core_logic__.Types_.termval lam :
store ->
@@ -105,7 +105,7 @@ n4: = n3 n3Sidekick_core_logic.Term.tabs t returns an "absolute value" for the term, along with the sign of t.
The idea is that we want to turn not a into (false, a), or (a != b) into (false, a=b). For terms without a negation this should return (true, t).
val as_bool_val : Sidekick_core_logic.Term.t -> bool optionval open_eq :
Sidekick_core_logic.Term.t ->
(Sidekick_core_logic.Term.t * Sidekick_core_logic.Term.t) optionopen_eq (a=b) returns Some (a,b), None for other terms.
type term = Sidekick_core_logic.Term.ttype hook =
- recurse:term Sidekick_util.Fmt.printer ->
+ recurse:term Sidekick_util.Fmt.printer ->
Sidekick_util.Fmt.t ->
term ->
- boolPrinting hook, responsible for printing certain subterms
module Hooks = Sidekick_core.Term.Hooksval default_hooks : Hooks.t Stdlib.refval pp_limit : max_depth:int -> max_nodes:int -> term Sidekick_util.Fmt.printerPrint with a limit on the number of nodes printed. An ellipsis is displayed otherwise.
module Tracer = Sidekick_core.Term.Tracermodule Trace_reader = Sidekick_core.Term.Trace_readermodule Ref = Sidekick_core.Term.Reftype t = Types_.tytype data = Types_.datainclude Sidekick_sigs.EQ_ORD_HASH_PRINT with type t := t
include Sidekick_sigs.EQ with type t := t
include Sidekick_sigs.ORD with type t := t
include Sidekick_sigs.HASH with type t := t
val hash : t -> intinclude Sidekick_sigs.PRINT with type t := t
val pp : t Sidekick_sigs.printerval const_decoders : Sidekick_core.Const.decodersval is_uninterpreted : t -> boolval is_real : t -> boolval is_int : t -> bool
\ No newline at end of file
+ boolPrinting hook, responsible for printing certain subterms
module Hooks = Sidekick_core.Term.Hooksval default_hooks : Hooks.t Stdlib.refval pp_limit : max_depth:int -> max_nodes:int -> term Sidekick_util.Fmt.printerPrint with a limit on the number of nodes printed. An ellipsis is displayed otherwise.
module Tracer = Sidekick_core.Term.Tracermodule Trace_reader = Sidekick_core.Term.Trace_readermodule Ref = Sidekick_core.Term.Reftype t = Types_.tytype data = Types_.datainclude Sidekick_sigs.EQ_ORD_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval const_decoders : Sidekick_core.Const.decodersval is_uninterpreted : t -> boolval is_real : t -> boolval is_int : t -> boolSidekick_base.Types_include module type of struct include Sidekick_core endmodule Fmt = Sidekick_core.Fmtmodule Const = Sidekick_core.Constmodule Str_const = Sidekick_core.Str_constmodule Term = Sidekick_core.Termmodule Bool_view = Sidekick_core.Bool_viewmodule CC_view = Sidekick_core.CC_viewmodule Default_cc_view = Sidekick_core.Default_cc_viewmodule Bvar = Sidekick_core.Bvarmodule Lit = Sidekick_core.Litmodule Subst = Sidekick_core.Substmodule Var = Sidekick_core.Varmodule Box = Sidekick_core.Boxmodule Gensym = Sidekick_core.Gensymval const_decoders :
+Types_ (sidekick-base.Sidekick_base.Types_) Module Sidekick_base.Types_
include module type of struct include Sidekick_core end
module Fmt = Sidekick_core.FmtRe-exports from core-logic
module Const = Sidekick_core.Constmodule Str_const = Sidekick_core.Str_constmodule Term = Sidekick_core.Termview
module Bool_view = Sidekick_core.Bool_viewmodule CC_view = Sidekick_core.CC_viewmodule Default_cc_view = Sidekick_core.Default_cc_viewMain modules
module Bvar = Sidekick_core.Bvarmodule Lit = Sidekick_core.Litmodule Subst = Sidekick_core.Substmodule Var = Sidekick_core.Varmodule Box = Sidekick_core.Boxmodule Gensym = Sidekick_core.GensymConst decoders for traces
val const_decoders :
(string
* Sidekick_core_logic.Const.Ops.t
* (Sidekick_core_logic__.Types_.term Sidekick_util.Ser_decode.t ->
Sidekick_core_logic.Const.view Sidekick_util.Ser_decode.t))
- listtype term = Term.ttype ty = Term.ttype value = Term.ttype statement = | Stmt_set_logic of string| Stmt_set_option of string list| Stmt_set_info of string * string| Stmt_data of data list| Stmt_ty_decl of {}(*new atomic cstor
*)| Stmt_decl of {}| Stmt_define of definition list| Stmt_assert of term| Stmt_assert_clause of term list| Stmt_check_sat of (bool * term) list| Stmt_get_model| Stmt_get_value of term list| Stmt_exit
\ No newline at end of file
+ listtype term = Term.ttype ty = Term.ttype value = Term.ttype statement = | Stmt_set_logic of string| Stmt_set_option of string list| Stmt_set_info of string * string| Stmt_data of data list| Stmt_ty_decl of {}new atomic cstor
*)| Stmt_decl of {}| Stmt_define of definition list| Stmt_assert of term| Stmt_assert_clause of term list| Stmt_check_sat of (bool * term) list| Stmt_get_model| Stmt_get_value of term list| Stmt_exitSidekick_base.UconstUninterpreted constants
type ty = Sidekick_core.Term.tinclude Sidekick_sigs.EQ_ORD_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval const_decoders : Sidekick_core.Const.decodersval uconst : Sidekick_core.Term.store -> t -> Sidekick_core.Term.tval uconst_of_id :
+Uconst (sidekick-base.Sidekick_base.Uconst) Module Sidekick_base.Uconst
Uninterpreted constants
type ty = Sidekick_core.Term.tinclude Sidekick_sigs.EQ_ORD_HASH_PRINT with type t := t
include Sidekick_sigs.EQ with type t := t
include Sidekick_sigs.ORD with type t := t
include Sidekick_sigs.HASH with type t := t
val hash : t -> intinclude Sidekick_sigs.PRINT with type t := t
val pp : t Sidekick_sigs.printerval const_decoders : Sidekick_core.Const.decodersval uconst : Sidekick_core.Term.store -> t -> Sidekick_core.Term.tval uconst_of_id :
Sidekick_core.Term.store ->
ID.t ->
ty ->
@@ -13,4 +13,4 @@
string ->
ty list ->
ty ->
- Sidekick_core.Term.t
\ No newline at end of file
+ Sidekick_core.Term.tSidekick_baseSidekick base
This library is a starting point for writing concrete implementations of SMT solvers with Sidekick.
It provides a representation of terms, boolean formulas, linear arithmetic expressions, datatypes for the functors in Sidekick.
In addition, it has a notion of Statement. Statements are instructions for the SMT solver to do something, such as: define a new constant, declare a new constant, assert a formula as being true, set an option, check satisfiability of the set of statements added so far, etc. Logic formats such as SMT-LIB 2.6 are in fact based on a similar notion of statements, and a .smt2 files contains a list of statements.
module Types_ : sig ... endmodule Term : sig ... endmodule Const = Sidekick_core.Constmodule Ty : sig ... endmodule ID : sig ... endUnique Identifiers
module Form : sig ... endFormulas (boolean terms).
module Data_ty : sig ... endmodule Cstor = Data_ty.Cstormodule Select = Data_ty.Selectmodule Statement : sig ... endStatements.
module Solver : sig ... endmodule Uconst : sig ... endUninterpreted constants
module Config : sig ... endConfiguration
module LRA_term : sig ... endmodule Th_data : sig ... endTheory of datatypes
module Th_bool : sig ... endReducing boolean formulas to clauses
module Th_lra : sig ... endTheory of Linear Rational Arithmetic
module Th_ty_unin : sig ... endval k_th_bool_config : [ `Dyn | `Static ] Config.Key.tval th_bool : Config.t -> Solver.theoryval th_bool_dyn : Solver.theoryval th_bool_static : Solver.theoryval th_data : Solver.theoryval th_lra : Solver.theoryval th_ty_unin : Solver.theoryval const_decoders :
+Sidekick_base (sidekick-base.Sidekick_base) Module Sidekick_base
Sidekick base
This library is a starting point for writing concrete implementations of SMT solvers with Sidekick.
It provides a representation of terms, boolean formulas, linear arithmetic expressions, datatypes for the functors in Sidekick.
In addition, it has a notion of Statement. Statements are instructions for the SMT solver to do something, such as: define a new constant, declare a new constant, assert a formula as being true, set an option, check satisfiability of the set of statements added so far, etc. Logic formats such as SMT-LIB 2.6 are in fact based on a similar notion of statements, and a .smt2 files contains a list of statements.
module Types_ : sig ... endmodule Term : sig ... endmodule Const = Sidekick_core.Constmodule Ty : sig ... endmodule ID : sig ... endUnique Identifiers
module Form : sig ... endFormulas (boolean terms).
module Data_ty : sig ... endmodule Cstor = Data_ty.Cstormodule Select = Data_ty.Selectmodule Statement : sig ... endStatements.
module Solver : sig ... endmodule Uconst : sig ... endUninterpreted constants
module Config : sig ... endConfiguration
module LRA_term : sig ... endmodule Th_data : sig ... endTheory of datatypes
module Th_bool : sig ... endReducing boolean formulas to clauses
module Th_lra : sig ... endTheory of Linear Rational Arithmetic
module Th_ty_unin : sig ... endval k_th_bool_config : [ `Dyn | `Static ] Config.Key.tval th_bool : Config.t -> Solver.theoryval th_bool_dyn : Solver.theoryval th_bool_static : Solver.theoryval th_data : Solver.theoryval th_lra : Solver.theoryval th_ty_unin : Solver.theoryval const_decoders :
(string
* Sidekick_core.Const.Ops.t
* (Sidekick_core_logic__.Types_.term Sidekick_util.Ser_decode.t ->
Sidekick_core.Const.view Sidekick_util.Ser_decode.t))
- listAll constant decoders
\ No newline at end of file
+ listAll constant decoders
Sidekick_smtlib.Check_ccval theory : Solver.cdcl_theorytheory that check validity of EUF conflicts, on the fly
Sidekick_smtlib.Check_ccval theory : Solver.cdcl_theorytheory that check validity of EUF conflicts, on the fly
Sidekick_smtlib.DriverDriver.
The driver is responsible for processing statements from a SMTLIB file, and interacting with the solver based on the statement (asserting formulas, calling "solve", etc.)
module Asolver = Sidekick_abstract_solver.Asolverval th_bool_dyn : Sidekick_base.Solver.theoryval th_bool_static : Sidekick_base.Solver.theoryval th_bool : Sidekick_base.Config.t -> Sidekick_base.Solver.theoryval th_data : Sidekick_base.Solver.theoryval th_lra : Sidekick_base.Solver.theoryval th_ty_unin : Sidekick_base.Solver.theoryval create :
- ?pp_cnf:bool ->
- ?proof_file:string ->
- ?pp_model:bool ->
- ?check:bool ->
- ?time:float ->
- ?memory:float ->
- ?progress:bool ->
+Driver (sidekick-base.Sidekick_smtlib.Driver) Module Sidekick_smtlib.Driver
Driver.
The driver is responsible for processing statements from a SMTLIB file, and interacting with the solver based on the statement (asserting formulas, calling "solve", etc.)
module Asolver = Sidekick_abstract_solver.Asolverval th_bool_dyn : Sidekick_base.Solver.theoryval th_bool_static : Sidekick_base.Solver.theoryval th_bool : Sidekick_base.Config.t -> Sidekick_base.Solver.theoryval th_data : Sidekick_base.Solver.theoryval th_lra : Sidekick_base.Solver.theoryval th_ty_unin : Sidekick_base.Solver.theoryval process_stmt : t -> Sidekick_base.Statement.t -> unit or_error
\ No newline at end of file
+ tval process_stmt : t -> Sidekick_base.Statement.t -> unit or_errorSidekick_smtlib.ModelModels
A model can be produced when the solver is found to be in a satisfiable state after a call to solve.
type value = Sidekick_core.Term.ttype fun_ = Sidekick_core.Term.tval empty : tval is_empty : t -> boolval eval : Sidekick_core.Term.t -> t -> value optioninclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerSidekick_smtlib.ModelModels
A model can be produced when the solver is found to be in a satisfiable state after a call to solve.
type value = Sidekick_core.Term.ttype fun_ = Sidekick_core.Term.tval empty : tval is_empty : t -> boolval eval : Sidekick_core.Term.t -> t -> value optioninclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerSidekick_smtlib.Solvermodule Asolver = Sidekick_abstract_solver.Asolvermodule Smt_solver = Sidekick_smt_solvertype t = Asolver.ttype cdcl_theory = Smt_solver.theorySidekick_smtlib.Solvermodule Asolver = Sidekick_abstract_solver.Asolvermodule Smt_solver = Sidekick_smt_solvertype t = Asolver.ttype cdcl_theory = Smt_solver.theorySidekick_smtlibSMTLib-2.6 Driver
This library provides a parser, a type-checker, and a driver for processing SMTLib-2 problems.
module Term = Sidekick_base.Termmodule Stmt = Sidekick_base.Statementmodule Driver : sig ... endDriver.
module Solver : sig ... endmodule Check_cc : sig ... endmodule Model : sig ... endModels
val parse : Term.store -> string -> Stmt.t list or_errorval parse_stdin : Term.store -> Stmt.t list or_errorSidekick_smtlibSMTLib-2.6 Driver
This library provides a parser, a type-checker, and a driver for processing SMTLib-2 problems.
module Term = Sidekick_base.Termmodule Stmt = Sidekick_base.Statementmodule Driver : sig ... endDriver.
module Solver : sig ... endmodule Check_cc : sig ... endmodule Model : sig ... endModels
val parse : Term.store -> string -> Stmt.t list or_errorval parse_stdin : Term.store -> Stmt.t list or_errorThe entry point of this library is the module: Sidekick_base.
The entry point of this library is the module: Sidekick_smtlib.
The entry point of this library is the module: Sidekick_base.
The entry point of this library is the module: Sidekick_smtlib.
Sidekick_bin_lib.Dimacs_lexerval token : Stdlib.Lexing.lexbuf -> tokenval __ocaml_lex_token_rec : Stdlib.Lexing.lexbuf -> int -> tokenval comment : Stdlib.Lexing.lexbuf -> tokenval __ocaml_lex_comment_rec : Stdlib.Lexing.lexbuf -> int -> tokenSidekick_bin_lib.Dimacs_lexerval token : Stdlib.Lexing.lexbuf -> tokenval __ocaml_lex_token_rec : Stdlib.Lexing.lexbuf -> int -> tokenval comment : Stdlib.Lexing.lexbuf -> tokenval __ocaml_lex_comment_rec : Stdlib.Lexing.lexbuf -> int -> tokenSidekick_bin_lib.Dimacs_parserval create : Stdlib.in_channel -> tval parse_header : t -> int * intval next_clause : t -> int list optionval iter : t -> int list Iter.tSidekick_bin_lib.Dimacs_parserval create : Stdlib.in_channel -> tval parse_header : t -> int * intval next_clause : t -> int list optionval iter : t -> int list Iter.tSidekick_bin_lib.Drup_lexerval token : Stdlib.Lexing.lexbuf -> tokenval __ocaml_lex_token_rec : Stdlib.Lexing.lexbuf -> int -> tokenval comment : Stdlib.Lexing.lexbuf -> tokenval __ocaml_lex_comment_rec : Stdlib.Lexing.lexbuf -> int -> tokenSidekick_bin_lib.Drup_lexerval token : Stdlib.Lexing.lexbuf -> tokenval __ocaml_lex_token_rec : Stdlib.Lexing.lexbuf -> int -> tokenval comment : Stdlib.Lexing.lexbuf -> tokenval __ocaml_lex_comment_rec : Stdlib.Lexing.lexbuf -> int -> tokenSidekick_bin_lib.Drup_parserSidekick_bin_lib.Drup_parserSidekick_bin_lib.Trace_setupSidekick_bin_libLibrary for the Sidekick executables
module Dimacs_lexer : sig ... endmodule Dimacs_parser : sig ... endmodule Drup_lexer : sig ... endmodule Drup_parser : sig ... endSidekick_bin_libLibrary for the Sidekick executables
module Dimacs_lexer : sig ... endmodule Dimacs_parser : sig ... endmodule Drup_lexer : sig ... endmodule Drup_parser : sig ... endmodule Trace_setup : sig ... endThe entry point of this library is the module: Sidekick_bin_lib.
The entry point of this library is the module: Sidekick_bin_lib.
Asolver.tmethod assert_term : Sidekick_core.Term.t -> unitHelper that turns the term into an atom, before adding the result to the solver as a unit clause assertion.
This uses Proof_sat.sat_input_clause to justify the assertion.
method assert_clause : Sidekick_core.Lit.t array -> Proof.Pterm.delayed -> unitadd_clause solver cs adds a boolean clause to the solver. Subsequent calls to solve will need to satisfy this clause.
method assert_clause_l : Sidekick_core.Lit.t list ->
+t (sidekick.Sidekick_abstract_solver.Asolver.t) Class type Asolver.t
method assert_term : Sidekick_core.Term.t -> unitHelper that turns the term into an atom, before adding the result to the solver as a unit clause assertion.
This uses Proof_sat.sat_input_clause to justify the assertion.
method assert_clause : Sidekick_core.Lit.t array -> Proof.Pterm.delayed -> unitadd_clause solver cs adds a boolean clause to the solver. Subsequent calls to solve will need to satisfy this clause.
method assert_clause_l : Sidekick_core.Lit.t list ->
Proof.Pterm.delayed ->
- unitAdd a clause to the solver, given as a list.
method add_ty : ty:Sidekick_core.Term.t -> unitAdd a new sort/atomic type.
method lit_of_term : ?sign:bool -> Sidekick_core.Term.t -> Sidekick_core.Lit.tConvert a term into a simplified literal.
method tst : Sidekick_core.Term.storemethod solve : ?on_exit:(unit -> unit) list ->
- ?on_progress:(unit -> unit) ->
- ?should_stop:(int -> bool) ->
- assumptions:Sidekick_core.Lit.t list ->
+ unitAdd a clause to the solver, given as a list.
method add_ty : ty:Sidekick_core.Term.t -> unitAdd a new sort/atomic type.
method lit_of_term : ?sign:bool -> Sidekick_core.Term.t -> Sidekick_core.Lit.tConvert a term into a simplified literal.
method tst : Sidekick_core.Term.storemethod solve : ?on_exit:(unit -> unit) list ->
+ ?on_progress:(unit -> unit) ->
+ ?should_stop:(int -> bool) ->
+ assumptions:Sidekick_core.Lit.t list ->
unit ->
- Check_res.tChecks the satisfiability of the clauses added so far to the solver.
method last_res : Check_res.t optionReturns the result of the last call to solve, if the logic statee has not changed (mostly by asserting new clauses).
method proof_tracer : Proof.Tracer.tTODO: remove, use Tracer instead
\ No newline at end of file
+ Check_res.tChecks the satisfiability of the clauses added so far to the solver.
method last_res : Check_res.t optionReturns the result of the last call to solve, if the logic statee has not changed (mostly by asserting new clauses).
method proof_tracer : Proof.Tracer.tTODO: remove, use Tracer instead
Sidekick_abstract_solver.AsolverAbstract interface for a solver
module Unknown = Unknownmodule Check_res = Check_resmodule Proof = Sidekick_proofclass type t = object ... endval tst : t -> Sidekick_core.Term.storeval assert_term : t -> Sidekick_core.Term.t -> unitval assert_clause :
+Asolver (sidekick.Sidekick_abstract_solver.Asolver) Module Sidekick_abstract_solver.Asolver
Abstract interface for a solver
module Unknown = Unknownmodule Check_res = Check_resmodule Proof = Sidekick_proofclass type t = object ... endval tst : t -> Sidekick_core.Term.storeval assert_term : t -> Sidekick_core.Term.t -> unitval assert_clause :
t ->
Sidekick_core.Lit.t array ->
Proof.Pterm.delayed ->
@@ -7,15 +7,15 @@
t ->
Sidekick_core.Lit.t list ->
Proof.Pterm.delayed ->
- unitval add_ty : t -> ty:Sidekick_core.Term.t -> unitval add_ty : t -> ty:Sidekick_core.Term.t -> unitval lit_of_term :
t ->
- ?sign:bool ->
+ ?sign:bool ->
Sidekick_core.Term.t ->
Sidekick_core.Lit.tval solve :
t ->
- ?on_exit:(unit -> unit) list ->
- ?on_progress:(unit -> unit) ->
- ?should_stop:(int -> bool) ->
- assumptions:Sidekick_core.Lit.t list ->
+ ?on_exit:(unit -> unit) list ->
+ ?on_progress:(unit -> unit) ->
+ ?should_stop:(int -> bool) ->
+ assumptions:Sidekick_core.Lit.t list ->
unit ->
- Check_res.tval last_res : t -> Check_res.t optionval proof : t -> Proof.Tracer.t
\ No newline at end of file
+ Check_res.tval last_res : t -> Check_res.t optionval proof : t -> Proof.Tracer.tSidekick_abstract_solver.Check_resResult of solving for the current set of clauses
type value = Sidekick_core.Term.ttype sat_result = {get_value : Sidekick_core.Term.t -> value option;Value for this term
*)iter_classes : (Sidekick_core.Term.t Iter.t * value) Iter.t;All equivalence classes in the congruence closure
*)eval_lit : Sidekick_core.Lit.t -> bool option;Evaluate literal
*)iter_true_lits : Sidekick_core.Lit.t Iter.t;Iterate on literals that are true in the trail
*)}Satisfiable
type unsat_result = {unsat_core : unit -> Sidekick_core.Lit.t Iter.t;Unsat core (subset of assumptions), or empty
*)unsat_proof : unit -> Sidekick_proof.Step.id option;Proof step for the empty clause
*)}Unsatisfiable
type t = | Sat of sat_result| Unsat of unsat_result| Unknown of Unknown.tUnknown, obtained after a timeout, memory limit, etc.
*)Result of calling "check"
val pp : Sidekick_core.Fmt.t -> t -> unitSidekick_abstract_solver.Check_resResult of solving for the current set of clauses
type value = Sidekick_core.Term.ttype sat_result = {get_value : Sidekick_core.Term.t -> value option;Value for this term
*)iter_classes : (Sidekick_core.Term.t Iter.t * value) Iter.t;All equivalence classes in the congruence closure
*)eval_lit : Sidekick_core.Lit.t -> bool option;Evaluate literal
*)iter_true_lits : Sidekick_core.Lit.t Iter.t;Iterate on literals that are true in the trail
*)}Satisfiable
type unsat_result = {unsat_core : unit -> Sidekick_core.Lit.t Iter.t;Unsat core (subset of assumptions), or empty
*)unsat_proof : unit -> Sidekick_proof.Step.id option;Proof step for the empty clause
*)}Unsatisfiable
type t = | Sat of sat_result| Unsat of unsat_result| Unknown of Unknown.tUnknown, obtained after a timeout, memory limit, etc.
*)Result of calling "check"
val pp : Sidekick_core.Fmt.t -> t -> unitSidekick_abstract_solver.Unknownval pp : t Sidekick_core.Fmt.printerSidekick_abstract_solver.Unknownval pp : t Sidekick_core.Fmt.printerSidekick_abstract_solver.tMain abstract solver type
method assert_term : Sidekick_core.Term.t -> unitHelper that turns the term into an atom, before adding the result to the solver as a unit clause assertion.
This uses Proof_sat.sat_input_clause to justify the assertion.
method assert_clause : Sidekick_core.Lit.t array ->
+t (sidekick.Sidekick_abstract_solver.t) Class type Sidekick_abstract_solver.t
Main abstract solver type
method assert_term : Sidekick_core.Term.t -> unitHelper that turns the term into an atom, before adding the result to the solver as a unit clause assertion.
This uses Proof_sat.sat_input_clause to justify the assertion.
method assert_clause : Sidekick_core.Lit.t array ->
Asolver.Proof.Pterm.delayed ->
unitadd_clause solver cs adds a boolean clause to the solver. Subsequent calls to solve will need to satisfy this clause.
method assert_clause_l : Sidekick_core.Lit.t list ->
Asolver.Proof.Pterm.delayed ->
- unitAdd a clause to the solver, given as a list.
method add_ty : ty:Sidekick_core.Term.t -> unitAdd a new sort/atomic type.
method lit_of_term : ?sign:bool -> Sidekick_core.Term.t -> Sidekick_core.Lit.tConvert a term into a simplified literal.
method tst : Sidekick_core.Term.storemethod solve : ?on_exit:(unit -> unit) list ->
- ?on_progress:(unit -> unit) ->
- ?should_stop:(int -> bool) ->
- assumptions:Sidekick_core.Lit.t list ->
+ unitAdd a clause to the solver, given as a list.
method add_ty : ty:Sidekick_core.Term.t -> unitAdd a new sort/atomic type.
method lit_of_term : ?sign:bool -> Sidekick_core.Term.t -> Sidekick_core.Lit.tConvert a term into a simplified literal.
method tst : Sidekick_core.Term.storemethod solve : ?on_exit:(unit -> unit) list ->
+ ?on_progress:(unit -> unit) ->
+ ?should_stop:(int -> bool) ->
+ assumptions:Sidekick_core.Lit.t list ->
unit ->
- Asolver.Check_res.tChecks the satisfiability of the clauses added so far to the solver.
method last_res : Asolver.Check_res.t optionReturns the result of the last call to solve, if the logic statee has not changed (mostly by asserting new clauses).
method proof_tracer : Asolver.Proof.Tracer.tTODO: remove, use Tracer instead
\ No newline at end of file
+ Asolver.Check_res.tChecks the satisfiability of the clauses added so far to the solver.
method last_res : Asolver.Check_res.t optionReturns the result of the last call to solve, if the logic statee has not changed (mostly by asserting new clauses).
method proof_tracer : Asolver.Proof.Tracer.tTODO: remove, use Tracer instead
Sidekick_abstract_solverAbstract interface for a solver
module Unknown : sig ... endmodule Check_res : sig ... endResult of solving for the current set of clauses
module Asolver : sig ... endAbstract interface for a solver
Sidekick_abstract_solverAbstract interface for a solver
module Unknown : sig ... endmodule Check_res : sig ... endResult of solving for the current set of clauses
module Asolver : sig ... endAbstract interface for a solver
Sidekick_arithmodule type NUM = sig ... endmodule type INT = sig ... endmodule type RATIONAL = sig ... endmodule type INT_FULL = sig ... endSidekick_arithmodule type NUM = sig ... endmodule type INT = sig ... endmodule type RATIONAL = sig ... endmodule type INT_FULL = sig ... endSidekick_arith.INTinclude NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerSidekick_arith.INTinclude NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerSidekick_arith.INT_FULLinclude INTinclude NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval probab_prime : t -> boolSidekick_arith.INT_FULLinclude INTinclude NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval probab_prime : t -> boolSidekick_arith.NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerSidekick_arith.NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerSidekick_arith.RATIONALinclude NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval infinity : t+infinity
val minus_infinity : tval is_real : t -> boolA proper real, not nan/infinity
val is_int : t -> boolIs this a proper integer?
val pp_approx : int -> Stdlib.Format.formatter -> t -> unitPretty print rational with given amount of precision (for example as a floating point number)
Sidekick_arith.RATIONALinclude NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval infinity : t+infinity
val minus_infinity : tval is_real : t -> boolA proper real, not nan/infinity
val is_int : t -> boolIs this a proper integer?
val pp_approx : int -> Stdlib.Format.formatter -> t -> unitPretty print rational with given amount of precision (for example as a floating point number)
Sidekick_bencode.Decodeval of_string : ?idx:int -> string -> (int * t) optionDecode string, and also return how many bytes were consumed.
val of_string_exn : ?idx:int -> string -> int * tParse string.
Sidekick_bencode.Decodeval of_string : ?idx:int -> string -> (int * t) optionDecode string, and also return how many bytes were consumed.
val of_string_exn : ?idx:int -> string -> int * tParse string.
Sidekick_bencode.EncodeSidekick_bencode.EncodeSidekick_bencodeSidekick_bencodeCC.Handler_actionHandler Actions
Actions that can be scheduled by event handlers.
type t = | Act_merge of E_node.t * E_node.t * Expl.t| Act_propagate of Sidekick_core.Lit.t * propagation_reasonCC.Handler_actionHandler Actions
Actions that can be scheduled by event handlers.
type t = | Act_merge of E_node.t * E_node.t * Expl.t| Act_propagate of Sidekick_core.Lit.t * propagation_reasonMake._val view_as_cc : view_as_ccView the Term.t through the lens of the congruence closure
Make._val view_as_cc : view_as_ccView the Term.t through the lens of the congruence closure
CC.Makeval create :
- ?stat:Sidekick_util.Stat.t ->
- ?size:[ `Small | `Big ] ->
+Make (sidekick.Sidekick_cc.CC.Make) Module CC.Make
Parameters
Signature
val create :
+ ?stat:Sidekick_util.Stat.t ->
+ ?size:[ `Small | `Big ] ->
Sidekick_core.Term.store ->
Sidekick_proof.Tracer.t ->
- tCreate a new congruence closure.
\ No newline at end of file
+ tCreate a new congruence closure.
CC.Result_actionResult Actions.
Actions returned by the congruence closure after calling check.
type t = | Act_propagate of {lit : Sidekick_core.Lit.t;reason : propagation_reason;}propagate (Lit.t, reason) declares that reason() => Lit.t is a tautology.
reason() should return a list of literals that are currently true, as well as a proof.Lit.t should be a literal of interest (see S.set_as_lit).This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.
*)type conflict = | Conflict of Sidekick_core.Lit.t list * Sidekick_proof.Step.idraise_conflict (c,pr) declares that c is a tautology of the theory of congruence.
CC.Result_actionResult Actions.
Actions returned by the congruence closure after calling check.
type t = | Act_propagate of {lit : Sidekick_core.Lit.t;reason : propagation_reason;}propagate (Lit.t, reason) declares that reason() => Lit.t is a tautology.
reason() should return a list of literals that are currently true, as well as a proof.Lit.t should be a literal of interest (see S.set_as_lit).This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.
*)type conflict = | Conflict of Sidekick_core.Lit.t list * Sidekick_proof.Step.idraise_conflict (c,pr) declares that c is a tautology of the theory of congruence.
Sidekick_cc.CCMain congruence closure signature.
The congruence closure handles the theory QF_UF (uninterpreted function symbols). It is also responsible for theory combination, and provides a general framework for equality reasoning that other theories piggyback on.
For example, the theory of datatypes relies on the congruence closure to do most of the work, and "only" adds injectivity/disjointness/acyclicity lemmas when needed.
Similarly, a theory of arrays would hook into the congruence closure and assert (dis)equalities as needed.
type e_node = E_node.tA node of the congruence closure
type repr = E_node.tNode that is currently a representative.
type explanation = Expl.tA field in the bitfield of this node. This should only be allocated when a theory is initialized.
Bitfields are accessed using preallocated keys. See allocate_bitfield.
All fields are initially 0, are backtracked automatically, and are merged automatically when classes are merged.
The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.
val term_store : t -> Sidekick_core.Term.storeval proof_tracer : t -> Sidekick_proof.Tracer.tval stat : t -> Sidekick_util.Stat.tval add_term : t -> Sidekick_core.Term.t -> e_nodeAdd the Term.t to the congruence closure, if not present already. Will be backtracked.
val mem_term : t -> Sidekick_core.Term.t -> boolReturns true if the Term.t is explicitly present in the congruence closure
Allocate a new e_node field (see E_node.bitfield).
This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each class_ individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor Term.t in the class").
There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).
Set the bitfield for the e_node. This will be backtracked. See E_node.bitfield.
type propagation_reason =
+CC (sidekick.Sidekick_cc.CC) Module Sidekick_cc.CC
Main congruence closure signature.
The congruence closure handles the theory QF_UF (uninterpreted function symbols). It is also responsible for theory combination, and provides a general framework for equality reasoning that other theories piggyback on.
For example, the theory of datatypes relies on the congruence closure to do most of the work, and "only" adds injectivity/disjointness/acyclicity lemmas when needed.
Similarly, a theory of arrays would hook into the congruence closure and assert (dis)equalities as needed.
type e_node = E_node.tA node of the congruence closure
type repr = E_node.tNode that is currently a representative.
type explanation = Expl.tA field in the bitfield of this node. This should only be allocated when a theory is initialized.
Bitfields are accessed using preallocated keys. See allocate_bitfield.
All fields are initially 0, are backtracked automatically, and are merged automatically when classes are merged.
The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.
Accessors
val term_store : t -> Sidekick_core.Term.storeval proof_tracer : t -> Sidekick_proof.Tracer.tval stat : t -> Sidekick_util.Stat.tval add_term : t -> Sidekick_core.Term.t -> e_nodeAdd the Term.t to the congruence closure, if not present already. Will be backtracked.
val mem_term : t -> Sidekick_core.Term.t -> boolReturns true if the Term.t is explicitly present in the congruence closure
Allocate a new e_node field (see E_node.bitfield).
This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each class_ individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor Term.t in the class").
There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).
Set the bitfield for the e_node. This will be backtracked. See E_node.bitfield.
type propagation_reason =
unit ->
Sidekick_core.Lit.t list * Sidekick_proof.Pterm.delayedmodule Handler_action : sig ... endHandler Actions
module Result_action : sig ... endResult Actions.
Events
Events triggered by the congruence closure, to which other plugins can subscribe.
val on_pre_merge :
t ->
@@ -15,10 +15,10 @@
Sidekick_util.Event.tev_on_new_term n t is emitted whenever a new Term.t t is added to the congruence closure. Its E_node.t is n.
Event emitted when a conflict occurs in the CC.
th is true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.
val on_conflict : t -> (ev_on_conflict, unit) Sidekick_util.Event.tev_on_conflict {th; c} is emitted when the congruence closure triggers a conflict by asserting the tautology c.
val on_propagate :
t ->
(t * Sidekick_core.Lit.t * propagation_reason, Handler_action.t list)
- Sidekick_util.Event.tev_on_propagate Lit.t reason is emitted whenever reason() => Lit.t is a propagated lemma. See CC_ACTIONS.propagate.
val on_is_subterm :
+ Sidekick_util.Event.tev_on_propagate Lit.t reason is emitted whenever reason() => Lit.t is a propagated lemma. See CC_ACTIONS.propagate.
val on_is_subterm :
t ->
(t * E_node.t * Sidekick_core.Term.t, Handler_action.t list)
- Sidekick_util.Event.tev_on_is_subterm n t is emitted when n is a subterm of another E_node.t for the first time. t is the Term.t corresponding to the E_node.t n. This can be useful for theory combination.
Misc
val set_as_lit : t -> E_node.t -> Sidekick_core.Lit.t -> unitmap the given e_node to a literal.
val find_t : t -> Sidekick_core.Term.t -> reprCurrent representative of the Term.t.
val add_iter : t -> Sidekick_core.Term.t Iter.t -> unitAdd a sequence of terms to the congruence closure
All current classes. This is costly, only use if there is no other solution
val explain_eq : t -> E_node.t -> E_node.t -> Resolved_expl.tExplain why the two nodes are equal. Fails if they are not, in an unspecified way.
val explain_expl : t -> Expl.t -> Resolved_expl.tTransform explanation into an actionable conflict clause
Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.
val merge_t :
+ Sidekick_util.Event.tev_on_is_subterm n t is emitted when n is a subterm of another E_node.t for the first time. t is the Term.t corresponding to the E_node.t n. This can be useful for theory combination.
Misc
val set_as_lit : t -> E_node.t -> Sidekick_core.Lit.t -> unitmap the given e_node to a literal.
val find_t : t -> Sidekick_core.Term.t -> reprCurrent representative of the Term.t.
val add_iter : t -> Sidekick_core.Term.t Iter.t -> unitAdd a sequence of terms to the congruence closure
All current classes. This is costly, only use if there is no other solution
val explain_eq : t -> E_node.t -> E_node.t -> Resolved_expl.tExplain why the two nodes are equal. Fails if they are not, in an unspecified way.
val explain_expl : t -> Expl.t -> Resolved_expl.tTransform explanation into an actionable conflict clause
Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.
val merge_t :
t ->
Sidekick_core.Term.t ->
Sidekick_core.Term.t ->
@@ -33,13 +33,13 @@
(Sidekick_core.Const.t, Sidekick_core.Term.t, Sidekick_core.Term.t list)
Sidekick_core.CC_view.tmodule type ARG = sig ... endArguments to a congruence closure's implementation
module type BUILD = sig ... endval create :
(module ARG) ->
- ?stat:Sidekick_util.Stat.t ->
- ?size:[ `Small | `Big ] ->
+ ?stat:Sidekick_util.Stat.t ->
+ ?size:[ `Small | `Big ] ->
Sidekick_core.Term.store ->
Sidekick_proof.Tracer.t ->
tCreate a new congruence closure.
val create_default :
- ?stat:Sidekick_util.Stat.t ->
- ?size:[ `Small | `Big ] ->
+ ?stat:Sidekick_util.Stat.t ->
+ ?size:[ `Small | `Big ] ->
Sidekick_core.Term.store ->
Sidekick_proof.Tracer.t ->
- tSame as create but with the default CC view
\ No newline at end of file
+ tSame as create but with the default CC view
CC.ARGArguments to a congruence closure's implementation
val view_as_cc : view_as_ccView the Term.t through the lens of the congruence closure
CC.ARGArguments to a congruence closure's implementation
val view_as_cc : view_as_ccView the Term.t through the lens of the congruence closure
CC.BUILDval create :
- ?stat:Sidekick_util.Stat.t ->
- ?size:[ `Small | `Big ] ->
+BUILD (sidekick.Sidekick_cc.CC.BUILD) Module type CC.BUILD
val create :
+ ?stat:Sidekick_util.Stat.t ->
+ ?size:[ `Small | `Big ] ->
Sidekick_core.Term.store ->
Sidekick_proof.Tracer.t ->
- tCreate a new congruence closure.
\ No newline at end of file
+ tCreate a new congruence closure.
E_node.Internal_val make : Sidekick_core.Term.t -> tE_node.Internal_val make : Sidekick_core.Term.t -> tSidekick_cc.E_nodeE-node.
An e-node is a node in the congruence closure that is contained in some equivalence classe). An equivalence class is a set of terms that are currently equal in the partial model built by the solver. The class is represented by a collection of nodes, one of which is distinguished and is called the "representative".
All information pertaining to the whole equivalence class is stored in its representative's E_node.t.
When two classes become equal (are "merged"), one of the two representatives is picked as the representative of the new class. The new class contains the union of the two old classes' nodes.
We also allow theories to store additional information in the representative. This information can be used when two classes are merged, to detect conflicts and solve equations à la Shostak.
An E-node.
A value of type t points to a particular Term.t, but see find to get the representative of the class.
include Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval term : t -> Sidekick_core.Term.tTerm contained in this equivalence class. If is_root n, then Term.t n is the class' representative Term.t.
Are two classes physically equal? To check for logical equality, use CC.E_node.equal (CC.find cc n1) (CC.find cc n2) which checks for equality of representatives.
val hash : t -> intAn opaque hash of this E_node.t.
val is_root : t -> boolIs the E_node.t a root (ie the representative of its class)? See find to get the root.
Traverse the congruence class. Precondition: is_root n (see find below)
Traverse the parents of the class. Precondition: is_root n (see find below)
val as_lit : t -> Sidekick_core.Lit.t optionSwap the next pointer of each node. If their classes were disjoint, they are now unioned.
module Internal_ : sig ... endSidekick_cc.E_nodeE-node.
An e-node is a node in the congruence closure that is contained in some equivalence classe). An equivalence class is a set of terms that are currently equal in the partial model built by the solver. The class is represented by a collection of nodes, one of which is distinguished and is called the "representative".
All information pertaining to the whole equivalence class is stored in its representative's E_node.t.
When two classes become equal (are "merged"), one of the two representatives is picked as the representative of the new class. The new class contains the union of the two old classes' nodes.
We also allow theories to store additional information in the representative. This information can be used when two classes are merged, to detect conflicts and solve equations à la Shostak.
An E-node.
A value of type t points to a particular Term.t, but see find to get the representative of the class.
include Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval term : t -> Sidekick_core.Term.tTerm contained in this equivalence class. If is_root n, then Term.t n is the class' representative Term.t.
Are two classes physically equal? To check for logical equality, use CC.E_node.equal (CC.find cc n1) (CC.find cc n2) which checks for equality of representatives.
val hash : t -> intAn opaque hash of this E_node.t.
val is_root : t -> boolIs the E_node.t a root (ie the representative of its class)? See find to get the root.
Traverse the congruence class. Precondition: is_root n (see find below)
Traverse the parents of the class. Precondition: is_root n (see find below)
val as_lit : t -> Sidekick_core.Lit.t optionSwap the next pointer of each node. If their classes were disjoint, they are now unioned.
module Internal_ : sig ... endSidekick_cc.ExplExplanations
Explanations are specialized proofs, created by the congruence closure when asked to justify why two terms are equal.
include Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval mk_merge_t : Sidekick_core.Term.t -> Sidekick_core.Term.t -> tExplanation: the terms were explicitly merged
val mk_lit : Sidekick_core.Lit.t -> tExplanation: we merged t and u because of literal t=u, or we merged t and true because of literal t, or t and false because of literal ¬t
val mk_theory :
+Expl (sidekick.Sidekick_cc.Expl) Module Sidekick_cc.Expl
Explanations
Explanations are specialized proofs, created by the congruence closure when asked to justify why two terms are equal.
include Sidekick_sigs.PRINT with type t := t
val pp : t Sidekick_sigs.printerval mk_merge_t : Sidekick_core.Term.t -> Sidekick_core.Term.t -> tExplanation: the terms were explicitly merged
val mk_lit : Sidekick_core.Lit.t -> tExplanation: we merged t and u because of literal t=u, or we merged t and true because of literal t, or t and false because of literal ¬t
val mk_theory :
Sidekick_core.Term.t ->
Sidekick_core.Term.t ->
(Sidekick_core.Term.t * Sidekick_core.Term.t * t list) list ->
Sidekick_proof.Pterm.delayed ->
- tmk_theory t u expl_sets pr builds a theory explanation for why |- t=u. It depends on sub-explanations expl_sets which are tuples (t_i, u_i, expls_i) where expls_i are explanations that justify t_i = u_i in the current congruence closure.
The proof pr is the theory lemma, of the form (t_i = u_i)_i |- t=u . It is resolved against each expls_i |- t_i=u_i obtained from expl_sets, on pivot t_i=u_i, to obtain a proof of Gamma |- t=u where Gamma is a subset of the literals asserted into the congruence closure.
For example for the lemma a=b deduced by injectivity from Some a=Some b in the theory of datatypes, the arguments would be a, b, [Some a, Some b, mk_merge_t (Some a)(Some b)], pr where pr is the injectivity lemma Some a=Some b |- a=b.
\ No newline at end of file
+ tmk_theory t u expl_sets pr builds a theory explanation for why |- t=u. It depends on sub-explanations expl_sets which are tuples (t_i, u_i, expls_i) where expls_i are explanations that justify t_i = u_i in the current congruence closure.
The proof pr is the theory lemma, of the form (t_i = u_i)_i |- t=u . It is resolved against each expls_i |- t_i=u_i obtained from expl_sets, on pivot t_i=u_i, to obtain a proof of Gamma |- t=u where Gamma is a subset of the literals asserted into the congruence closure.
For example for the lemma a=b deduced by injectivity from Some a=Some b in the theory of datatypes, the arguments would be a, b, [Some a, Some b, mk_merge_t (Some a)(Some b)], pr where pr is the injectivity lemma Some a=Some b |- a=b.
Make.Minclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval of_term :
+M (sidekick.Sidekick_cc.Plugin.Make.M) Parameter Make.M
include Sidekick_sigs.PRINT with type t := t
val pp : t Sidekick_sigs.printerval of_term :
CC.t ->
state ->
E_node.t ->
@@ -12,4 +12,4 @@
E_node.t ->
t ->
Expl.t ->
- (t * CC.Handler_action.t list, CC.Handler_action.conflict) Stdlib.resultMonoidal combination of two values.
merge cc n1 mon1 n2 mon2 expl returns the result of merging monoid values mon1 (for class n1) and mon2 (for class n2) when n1 and n2 are merged with explanation expl.
\ No newline at end of file
+ (t * CC.Handler_action.t list, CC.Handler_action.conflict) Stdlib.resultMonoidal combination of two values.
merge cc n1 mon1 n2 mon2 expl returns the result of merging monoid values mon1 (for class n1) and mon2 (for class n2) when n1 and n2 are merged with explanation expl.
Plugin.MakeCreate a plugin builder from the given per-class monoid
module M : sig ... endmodule M = Mmodule type DYN_PL_FOR_M = sig ... endtype t = (module DYN_PL_FOR_M)include Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerPlugin.MakeCreate a plugin builder from the given per-class monoid
module M : sig ... endmodule M = Mmodule type DYN_PL_FOR_M = sig ... endtype t = (module DYN_PL_FOR_M)include Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerMake.DYN_PL_FOR_Mmodule M = Minclude Sidekick_sigs.DYN_BACKTRACKABLEval mem : E_node.t -> boolDoes the CC E_node.t have a monoid value?
Make.DYN_PL_FOR_Mmodule M = Minclude Sidekick_sigs.DYN_BACKTRACKABLEval mem : E_node.t -> boolDoes the CC E_node.t have a monoid value?
Sidekick_cc.PluginCongruence Closure Plugin
module type EXTENDED_PLUGIN_BUILDER = sig ... endmodule Make (M : sig ... end) : EXTENDED_PLUGIN_BUILDER with module M = MCreate a plugin builder from the given per-class monoid
Sidekick_cc.PluginCongruence Closure Plugin
module type EXTENDED_PLUGIN_BUILDER = sig ... endmodule Make (M : sig ... end) : EXTENDED_PLUGIN_BUILDER with module M = MCreate a plugin builder from the given per-class monoid
EXTENDED_PLUGIN_BUILDER.Minclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval of_term :
+M (sidekick.Sidekick_cc.Plugin.EXTENDED_PLUGIN_BUILDER.M) Module EXTENDED_PLUGIN_BUILDER.M
include Sidekick_sigs.PRINT with type t := t
val pp : t Sidekick_sigs.printerval of_term :
CC.t ->
state ->
E_node.t ->
@@ -12,4 +12,4 @@
E_node.t ->
t ->
Expl.t ->
- (t * CC.Handler_action.t list, CC.Handler_action.conflict) Stdlib.resultMonoidal combination of two values.
merge cc n1 mon1 n2 mon2 expl returns the result of merging monoid values mon1 (for class n1) and mon2 (for class n2) when n1 and n2 are merged with explanation expl.
\ No newline at end of file
+ (t * CC.Handler_action.t list, CC.Handler_action.conflict) Stdlib.resultMonoidal combination of two values.
merge cc n1 mon1 n2 mon2 expl returns the result of merging monoid values mon1 (for class n1) and mon2 (for class n2) when n1 and n2 are merged with explanation expl.
Plugin.EXTENDED_PLUGIN_BUILDERmodule M : sig ... endmodule type DYN_PL_FOR_M = sig ... endtype t = (module DYN_PL_FOR_M)include Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerPlugin.EXTENDED_PLUGIN_BUILDERmodule M : sig ... endmodule type DYN_PL_FOR_M = sig ... endtype t = (module DYN_PL_FOR_M)include Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerEXTENDED_PLUGIN_BUILDER.DYN_PL_FOR_Mmodule M = Minclude Sidekick_sigs.DYN_BACKTRACKABLEval mem : E_node.t -> boolDoes the CC E_node.t have a monoid value?
EXTENDED_PLUGIN_BUILDER.DYN_PL_FOR_Mmodule M = Minclude Sidekick_sigs.DYN_BACKTRACKABLEval mem : E_node.t -> boolDoes the CC E_node.t have a monoid value?
Sidekick_cc.Resolved_explResolved explanations.
The congruence closure keeps explanations for why terms are in the same class. However these are represented in a compact, cheap form. To use these explanations we need to resolve them into a resolved explanation, typically a list of literals that are true in the current trail and are responsible for merges.
However, we can also have merged classes because they have the same value in the current model.
include Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerSidekick_cc.Resolved_explResolved explanations.
The congruence closure keeps explanations for why terms are in the same class. However these are represented in a compact, cheap form. To use these explanations we need to resolve them into a resolved explanation, typically a list of literals that are true in the current trail and are responsible for merges.
However, we can also have merged classes because they have the same value in the current model.
include Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerSidekick_cc.SignatureA signature is a shallow term shape where immediate subterms are representative
type t =
+Signature (sidekick.Sidekick_cc.Signature) Module Sidekick_cc.Signature
A signature is a shallow term shape where immediate subterms are representative
type t =
(Sidekick_core.Const.t,
Sidekick_cc__.Types_.e_node,
Sidekick_cc__.Types_.e_node list)
Sidekick_core.CC_view.tval hash : t -> intval pp :
Sidekick_cc__.Types_.Fmt.t ->
(Sidekick_core.Const.t, E_node.t, E_node.t list) Sidekick_core.CC_view.t ->
- unit
\ No newline at end of file
+ unitSidekick_ccCongruence Closure Implementation
module type DYN_MONOID_PLUGIN = sig ... endmodule type MONOID_PLUGIN_ARG = sig ... endmodule type MONOID_PLUGIN_BUILDER = sig ... endmodule View = Sidekick_core.CC_viewmodule E_node : sig ... endE-node.
module Expl : sig ... endExplanations
module Signature : sig ... endA signature is a shallow term shape where immediate subterms are representative
module Resolved_expl : sig ... endResolved explanations.
module Plugin : sig ... endCongruence Closure Plugin
module CC : sig ... endMain congruence closure signature.
include module type of struct include CC endtype e_node = E_node.tA node of the congruence closure
type repr = E_node.tNode that is currently a representative.
type explanation = Expl.tA field in the bitfield of this node. This should only be allocated when a theory is initialized.
Bitfields are accessed using preallocated keys. See allocate_bitfield.
All fields are initially 0, are backtracked automatically, and are merged automatically when classes are merged.
type t = CC.tThe congruence closure object. It contains a fair amount of state and is mutable and backtrackable.
val term_store : t -> Sidekick_core.Term.storeval proof_tracer : t -> Sidekick_proof.Tracer.tval stat : t -> Sidekick_util.Stat.tval add_term : t -> Sidekick_core.Term.t -> e_nodeAdd the Term.t to the congruence closure, if not present already. Will be backtracked.
val mem_term : t -> Sidekick_core.Term.t -> boolReturns true if the Term.t is explicitly present in the congruence closure
Allocate a new e_node field (see E_node.bitfield).
This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each class_ individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor Term.t in the class").
There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).
Set the bitfield for the e_node. This will be backtracked. See E_node.bitfield.
type propagation_reason =
+Sidekick_cc (sidekick.Sidekick_cc) Module Sidekick_cc
Congruence Closure Implementation
module type DYN_MONOID_PLUGIN = sig ... endmodule type MONOID_PLUGIN_ARG = sig ... endmodule type MONOID_PLUGIN_BUILDER = sig ... endmodule View = Sidekick_core.CC_viewmodule E_node : sig ... endE-node.
module Expl : sig ... endExplanations
module Signature : sig ... endA signature is a shallow term shape where immediate subterms are representative
module Resolved_expl : sig ... endResolved explanations.
module Plugin : sig ... endCongruence Closure Plugin
module CC : sig ... endMain congruence closure signature.
include module type of struct include CC end
type e_node = E_node.tA node of the congruence closure
type repr = E_node.tNode that is currently a representative.
type explanation = Expl.tA field in the bitfield of this node. This should only be allocated when a theory is initialized.
Bitfields are accessed using preallocated keys. See allocate_bitfield.
All fields are initially 0, are backtracked automatically, and are merged automatically when classes are merged.
type t = CC.tThe congruence closure object. It contains a fair amount of state and is mutable and backtrackable.
Accessors
val term_store : t -> Sidekick_core.Term.storeval proof_tracer : t -> Sidekick_proof.Tracer.tval stat : t -> Sidekick_util.Stat.tval add_term : t -> Sidekick_core.Term.t -> e_nodeAdd the Term.t to the congruence closure, if not present already. Will be backtracked.
val mem_term : t -> Sidekick_core.Term.t -> boolReturns true if the Term.t is explicitly present in the congruence closure
Allocate a new e_node field (see E_node.bitfield).
This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each class_ individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor Term.t in the class").
There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).
Set the bitfield for the e_node. This will be backtracked. See E_node.bitfield.
type propagation_reason =
unit ->
- Sidekick_core.Lit.t list * Sidekick_proof.Pterm.delayedmodule Handler_action = CC.Handler_actionHandler Actions
module Result_action = CC.Result_actionResult Actions.
Events
Events triggered by the congruence closure, to which other plugins can subscribe.
val on_pre_merge :
+ Sidekick_core.Lit.t list * Sidekick_proof.Pterm.delayedmodule Handler_action = CC.Handler_actionHandler Actions
module Result_action = CC.Result_actionResult Actions.
Events
Events triggered by the congruence closure, to which other plugins can subscribe.
val on_pre_merge :
t ->
(t * E_node.t * E_node.t * Expl.t, Handler_action.or_conflict)
Sidekick_util.Event.tEvents emitted by the congruence closure when something changes.
Ev_on_pre_merge acts n1 n2 expl is emitted right before n1 and n2 are merged with explanation expl.
val on_pre_merge2 :
@@ -15,15 +15,15 @@
Sidekick_util.Event.tev_on_new_term n t is emitted whenever a new Term.t t is added to the congruence closure. Its E_node.t is n.
Event emitted when a conflict occurs in the CC.
th is true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.
val on_conflict : t -> (ev_on_conflict, unit) Sidekick_util.Event.tev_on_conflict {th; c} is emitted when the congruence closure triggers a conflict by asserting the tautology c.
val on_propagate :
t ->
(t * Sidekick_core.Lit.t * propagation_reason, Handler_action.t list)
- Sidekick_util.Event.tev_on_propagate Lit.t reason is emitted whenever reason() => Lit.t is a propagated lemma. See CC_ACTIONS.propagate.
val on_is_subterm :
+ Sidekick_util.Event.tev_on_propagate Lit.t reason is emitted whenever reason() => Lit.t is a propagated lemma. See CC_ACTIONS.propagate.
val on_is_subterm :
t ->
(t * E_node.t * Sidekick_core.Term.t, Handler_action.t list)
- Sidekick_util.Event.tev_on_is_subterm n t is emitted when n is a subterm of another E_node.t for the first time. t is the Term.t corresponding to the E_node.t n. This can be useful for theory combination.
Misc
val set_as_lit : t -> E_node.t -> Sidekick_core.Lit.t -> unitmap the given e_node to a literal.
val find_t : t -> Sidekick_core.Term.t -> reprCurrent representative of the Term.t.
val add_iter : t -> Sidekick_core.Term.t Iter.t -> unitAdd a sequence of terms to the congruence closure
All current classes. This is costly, only use if there is no other solution
val explain_eq : t -> E_node.t -> E_node.t -> Resolved_expl.tExplain why the two nodes are equal. Fails if they are not, in an unspecified way.
val explain_expl : t -> Expl.t -> Resolved_expl.tTransform explanation into an actionable conflict clause
Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.
val merge_t :
+ Sidekick_util.Event.tev_on_is_subterm n t is emitted when n is a subterm of another E_node.t for the first time. t is the Term.t corresponding to the E_node.t n. This can be useful for theory combination.
Misc
val set_as_lit : t -> E_node.t -> Sidekick_core.Lit.t -> unitmap the given e_node to a literal.
val find_t : t -> Sidekick_core.Term.t -> reprCurrent representative of the Term.t.
val add_iter : t -> Sidekick_core.Term.t Iter.t -> unitAdd a sequence of terms to the congruence closure
All current classes. This is costly, only use if there is no other solution
val explain_eq : t -> E_node.t -> E_node.t -> Resolved_expl.tExplain why the two nodes are equal. Fails if they are not, in an unspecified way.
val explain_expl : t -> Expl.t -> Resolved_expl.tTransform explanation into an actionable conflict clause
Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.
val merge_t :
t ->
Sidekick_core.Term.t ->
Sidekick_core.Term.t ->
Expl.t ->
- unitShortcut for adding + merging
Main API
Main API
val assert_eq :
t ->
Sidekick_core.Term.t ->
Sidekick_core.Term.t ->
@@ -33,13 +33,13 @@
(Sidekick_core.Const.t, Sidekick_core.Term.t, Sidekick_core.Term.t list)
Sidekick_core.CC_view.tmodule type ARG = CC.ARGArguments to a congruence closure's implementation
module type BUILD = CC.BUILDmodule Make = CC.Makeval create :
(module ARG) ->
- ?stat:Sidekick_util.Stat.t ->
- ?size:[ `Small | `Big ] ->
+ ?stat:Sidekick_util.Stat.t ->
+ ?size:[ `Small | `Big ] ->
Sidekick_core.Term.store ->
Sidekick_proof.Tracer.t ->
tCreate a new congruence closure.
val create_default :
- ?stat:Sidekick_util.Stat.t ->
- ?size:[ `Small | `Big ] ->
+ ?stat:Sidekick_util.Stat.t ->
+ ?size:[ `Small | `Big ] ->
Sidekick_core.Term.store ->
Sidekick_proof.Tracer.t ->
- tSame as create but with the default CC view
\ No newline at end of file
+ tSame as create but with the default CC view
DYN_MONOID_PLUGIN.Minclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval of_term :
+M (sidekick.Sidekick_cc.DYN_MONOID_PLUGIN.M) Module DYN_MONOID_PLUGIN.M
include Sidekick_sigs.PRINT with type t := t
val pp : t Sidekick_sigs.printerval of_term :
CC.t ->
state ->
E_node.t ->
@@ -12,4 +12,4 @@
E_node.t ->
t ->
Expl.t ->
- (t * CC.Handler_action.t list, CC.Handler_action.conflict) Stdlib.resultMonoidal combination of two values.
merge cc n1 mon1 n2 mon2 expl returns the result of merging monoid values mon1 (for class n1) and mon2 (for class n2) when n1 and n2 are merged with explanation expl.
\ No newline at end of file
+ (t * CC.Handler_action.t list, CC.Handler_action.conflict) Stdlib.resultMonoidal combination of two values.
merge cc n1 mon1 n2 mon2 expl returns the result of merging monoid values mon1 (for class n1) and mon2 (for class n2) when n1 and n2 are merged with explanation expl.
Sidekick_cc.DYN_MONOID_PLUGINmodule M : sig ... endinclude Sidekick_sigs.DYN_BACKTRACKABLEval mem : E_node.t -> boolDoes the CC E_node.t have a monoid value?
Sidekick_cc.DYN_MONOID_PLUGINmodule M : sig ... endinclude Sidekick_sigs.DYN_BACKTRACKABLEval mem : E_node.t -> boolDoes the CC E_node.t have a monoid value?
Sidekick_cc.MONOID_PLUGIN_ARGinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval of_term :
+MONOID_PLUGIN_ARG (sidekick.Sidekick_cc.MONOID_PLUGIN_ARG) Module type Sidekick_cc.MONOID_PLUGIN_ARG
include Sidekick_sigs.PRINT with type t := t
val pp : t Sidekick_sigs.printerval of_term :
CC.t ->
state ->
E_node.t ->
@@ -12,4 +12,4 @@
E_node.t ->
t ->
Expl.t ->
- (t * CC.Handler_action.t list, CC.Handler_action.conflict) Stdlib.resultMonoidal combination of two values.
merge cc n1 mon1 n2 mon2 expl returns the result of merging monoid values mon1 (for class n1) and mon2 (for class n2) when n1 and n2 are merged with explanation expl.
\ No newline at end of file
+ (t * CC.Handler_action.t list, CC.Handler_action.conflict) Stdlib.resultMonoidal combination of two values.
merge cc n1 mon1 n2 mon2 expl returns the result of merging monoid values mon1 (for class n1) and mon2 (for class n2) when n1 and n2 are merged with explanation expl.
MONOID_PLUGIN_BUILDER.Minclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval of_term :
+M (sidekick.Sidekick_cc.MONOID_PLUGIN_BUILDER.M) Module MONOID_PLUGIN_BUILDER.M
include Sidekick_sigs.PRINT with type t := t
val pp : t Sidekick_sigs.printerval of_term :
CC.t ->
state ->
E_node.t ->
@@ -12,4 +12,4 @@
E_node.t ->
t ->
Expl.t ->
- (t * CC.Handler_action.t list, CC.Handler_action.conflict) Stdlib.resultMonoidal combination of two values.
merge cc n1 mon1 n2 mon2 expl returns the result of merging monoid values mon1 (for class n1) and mon2 (for class n2) when n1 and n2 are merged with explanation expl.
\ No newline at end of file
+ (t * CC.Handler_action.t list, CC.Handler_action.conflict) Stdlib.resultMonoidal combination of two values.
merge cc n1 mon1 n2 mon2 expl returns the result of merging monoid values mon1 (for class n1) and mon2 (for class n2) when n1 and n2 are merged with explanation expl.
Sidekick_cc.MONOID_PLUGIN_BUILDERSidekick_cc.MONOID_PLUGIN_BUILDERMONOID_PLUGIN_BUILDER.DYN_PL_FOR_Mmodule M = Minclude Sidekick_sigs.DYN_BACKTRACKABLEval mem : E_node.t -> boolDoes the CC E_node.t have a monoid value?
MONOID_PLUGIN_BUILDER.DYN_PL_FOR_Mmodule M = Minclude Sidekick_sigs.DYN_BACKTRACKABLEval mem : E_node.t -> boolDoes the CC E_node.t have a monoid value?
Sidekick_cc_pluginSidekick_cc_pluginSidekick_core.Bool_viewBoolean-oriented view of terms
Sidekick_core.Bool_viewBoolean-oriented view of terms
Sidekick_core.Boxval box :
+Box (sidekick.Sidekick_core.Box) Module Sidekick_core.Box
val box :
Sidekick_core_logic.Term.store ->
Sidekick_core_logic.Term.t ->
- Sidekick_core_logic.Term.tbox tst t makes a new constant that "boxes" t. This way it will be opaque.
val const_decoders : Sidekick_core_logic.Const.decodersval as_box : Sidekick_core_logic.Term.t -> Sidekick_core_logic.Term.t optionval is_box : Sidekick_core_logic.Term.t -> bool
\ No newline at end of file
+ Sidekick_core_logic.Term.tbox tst t makes a new constant that "boxes" t. This way it will be opaque.
val const_decoders : Sidekick_core_logic.Const.decodersval as_box : Sidekick_core_logic.Term.t -> Sidekick_core_logic.Term.t optionval is_box : Sidekick_core_logic.Term.t -> boolSidekick_core.CC_viewView terms through the lens of a Congruence Closure
A view of a term fron the point of view of a congruence closure.
'f is the type of function symbols't is the type of terms'ts is the type of sequences of terms (arguments of function application)val map_view :
- f_f:('a -> 'b) ->
- f_t:('c -> 'd) ->
- f_ts:('e -> 'f) ->
+CC_view (sidekick.Sidekick_core.CC_view) Module Sidekick_core.CC_view
View terms through the lens of a Congruence Closure
A view of a term fron the point of view of a congruence closure.
'f is the type of function symbols't is the type of terms'ts is the type of sequences of terms (arguments of function application)
val map_view :
+ f_f:('a -> 'b) ->
+ f_t:('c -> 'd) ->
+ f_ts:('e -> 'f) ->
('a, 'c, 'e) t ->
('b, 'd, 'f) tMap function over a view, one level deep. Each function maps over a different type, e.g. f_t maps over terms
val iter_view :
- f_f:('a -> unit) ->
- f_t:('b -> unit) ->
- f_ts:('c -> unit) ->
+ f_f:('a -> unit) ->
+ f_t:('b -> unit) ->
+ f_ts:('c -> unit) ->
('a, 'b, 'c) t ->
- unitIterate over a view, one level deep.
\ No newline at end of file
+ unitIterate over a view, one level deep.
Sidekick_core.Default_cc_viewval view_as_cc :
+Default_cc_view (sidekick.Sidekick_core.Default_cc_view) Module Sidekick_core.Default_cc_view
val view_as_cc :
Sidekick_core_logic.Term.t ->
(Sidekick_core_logic.Const.t,
Sidekick_core_logic.Term.t,
Sidekick_core_logic.Term.t list)
- CC_view.t
\ No newline at end of file
+ CC_view.tSidekick_core.GensymFresh symbol generation
type term = Sidekick_core_logic.Term.ttype ty = Sidekick_core_logic.Term.tFresh symbol generator.
The theory needs to be able to create new terms with fresh names, to be used as placeholders for complex formulas during Tseitin encoding.
val create : Sidekick_core_logic.Term.store -> tNew (stateful) generator instance.
val const_decoders : Sidekick_core_logic.Const.decodersval reset : t -> unitReset to initial state
Sidekick_core.GensymFresh symbol generation
type term = Sidekick_core_logic.Term.ttype ty = Sidekick_core_logic.Term.tFresh symbol generator.
The theory needs to be able to create new terms with fresh names, to be used as placeholders for complex formulas during Tseitin encoding.
val create : Sidekick_core_logic.Term.store -> tNew (stateful) generator instance.
val const_decoders : Sidekick_core_logic.Const.decodersval reset : t -> unitReset to initial state
Sidekick_core.LitLiterals
Literals are a pair of a boolean-sorted term, and a sign. Positive literals are the same as their term, and negative literals are the negation of their term.
The SAT solver deals only in literals and clauses (sets of literals). Everything else belongs in the SMT solver.
type term = Sidekick_core_logic.Term.tinclude Sidekick_sigs.EQ_ORD_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval pp_limit : max_depth:int -> max_nodes:int -> t Sidekick_util.Fmt.printerval sign : t -> boolGet the sign. A negated literal has sign false.
val atom : ?sign:bool -> Sidekick_core_logic.Term.store -> term -> tatom store t makes a literal out of a term, possibly normalizing its sign in the process.
val make_eq : ?sign:bool -> Sidekick_core_logic.Term.store -> term -> term -> tnorm_sign (+t) is +t, true, and norm_sign (-t) is +t, false. In both cases the term is positive, and the boolean reflects the initial sign.
include Sidekick_sigs.WITH_SET_MAP_TBL with type t := tSidekick_core.LitLiterals
Literals are a pair of a boolean-sorted term, and a sign. Positive literals are the same as their term, and negative literals are the negation of their term.
The SAT solver deals only in literals and clauses (sets of literals). Everything else belongs in the SMT solver.
type term = Sidekick_core_logic.Term.tinclude Sidekick_sigs.EQ_ORD_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval pp_limit : max_depth:int -> max_nodes:int -> t Sidekick_util.Fmt.printerval sign : t -> boolGet the sign. A negated literal has sign false.
val atom : ?sign:bool -> Sidekick_core_logic.Term.store -> term -> tatom store t makes a literal out of a term, possibly normalizing its sign in the process.
val make_eq : ?sign:bool -> Sidekick_core_logic.Term.store -> term -> term -> tnorm_sign (+t) is +t, true, and norm_sign (-t) is +t, false. In both cases the term is positive, and the boolean reflects the initial sign.
include Sidekick_sigs.WITH_SET_MAP_TBL with type t := tTerm.Hooksval empty : tval add :
- (recurse:Sidekick_core_logic.Term.t Sidekick_util.Fmt.printer ->
+Hooks (sidekick.Sidekick_core.Term.Hooks) Module Term.Hooks
val empty : tval add :
+ (recurse:Sidekick_core_logic.Term.t Sidekick_util.Fmt.printer ->
Sidekick_util.Fmt.t ->
Sidekick_core_logic.Term.t ->
bool) ->
t ->
- t
\ No newline at end of file
+ tTerm.RefTerm reference
type t = Sidekick_trace.entry_idReference to another term, by a unique ID in a trace.
This allows a trace to contain terms with explicit references to other terms, but where these references have to be followed explicitly. Thus, each term can be deserialized separately.
For example, a proof term for a given lemma might use references to previous lemmas, instead of their direct proof terms; this allows a checker or proof GUI to only read this particular lemma's proof into a term.
val ref :
+Ref (sidekick.Sidekick_core.Term.Ref) Module Term.Ref
Term reference
type t = Sidekick_trace.entry_idReference to another term, by a unique ID in a trace.
This allows a trace to contain terms with explicit references to other terms, but where these references have to be followed explicitly. Thus, each term can be deserialized separately.
For example, a proof term for a given lemma might use references to previous lemmas, instead of their direct proof terms; this allows a checker or proof GUI to only read this particular lemma's proof into a term.
val ref :
Sidekick_core_logic.Term.store ->
t ->
- ty:Sidekick_core_logic.Term.t ->
- Sidekick_core_logic.Term.tref tst id ~ty is the reference to entry id in a trace, which must be a term of type ty.
val as_ref : Sidekick_core_logic.Term.t -> t optionas_ref (ref tst id ~ty) is Some id.
val const_decoders : Sidekick_core_logic.Const.decoders
\ No newline at end of file
+ ty:Sidekick_core_logic.Term.t ->
+ Sidekick_core_logic.Term.tref tst id ~ty is the reference to entry id in a trace, which must be a term of type ty.
val as_ref : Sidekick_core_logic.Term.t -> t optionas_ref (ref tst id ~ty) is Some id.
val const_decoders : Sidekick_core_logic.Const.decodersTerm.Trace_readermodule Tr = Sidekick_tracemodule Dec = Sidekick_util.Ser_decodetype term_ref = Tr.entry_idtype const_decoders = Sidekick_core_logic.Const.decodersval create :
- ?const_decoders:const_decoders list ->
- source:Tr.Source.t ->
+Trace_reader (sidekick.Sidekick_core.Term.Trace_reader) Module Term.Trace_reader
module Tr = Sidekick_tracemodule Dec = Sidekick_util.Ser_decodetype term_ref = Tr.entry_idtype const_decoders = Sidekick_core_logic.Const.decodersval create :
+ ?const_decoders:const_decoders list ->
+ source:Tr.Source.t ->
Sidekick_core_logic.Term.store ->
tval store : t -> Sidekick_core_logic.Term.storeval add_const_decoders : t -> const_decoders -> unitval read_term :
t ->
@@ -9,4 +9,4 @@
(Sidekick_core_logic.Term.t, string) Stdlib.resultval read_term_err :
t ->
term_ref ->
- (Sidekick_core_logic.Term.t, Sidekick_util.Ser_decode.Error.t) Stdlib.resultval read_term_exn : t -> term_ref -> Sidekick_core_logic.Term.tval deref_term : t -> Sidekick_core_logic.Term.t -> Sidekick_core_logic.Term.tderef_term reader t dereferences the root node of t. If t is Ref id, this returns the term at id instead.
\ No newline at end of file
+ (Sidekick_core_logic.Term.t, Sidekick_util.Ser_decode.Error.t) Stdlib.resultval read_term_exn : t -> term_ref -> Sidekick_core_logic.Term.tval deref_term : t -> Sidekick_core_logic.Term.t -> Sidekick_core_logic.Term.tderef_term reader t dereferences the root node of t. If t is Ref id, this returns the term at id instead.
Tracer.concreteConcrete implementation of t
method emit_term : Sidekick_core_logic.Term.t -> term_refTracer.concreteConcrete implementation of t
method emit_term : Sidekick_core_logic.Term.t -> term_refTracer.dummyDummy implementation, returns Tr.Entry_id.dummy
inherit tmethod emit_term : Sidekick_core_logic.Term.t -> term_refTracer.dummyDummy implementation, returns Tr.Entry_id.dummy
inherit tmethod emit_term : Sidekick_core_logic.Term.t -> term_refTracer.tmethod emit_term : Sidekick_core_logic.Term.t -> term_refTracer.tmethod emit_term : Sidekick_core_logic.Term.t -> term_refTerm.TracerEmit terms in traces.
Traces will contains terms, encoded as a DAG. Each subterm is its own event, and gets a term identifier used in other subsequent entries to refer to it.
module Tr = Sidekick_tracetype term_ref = Sidekick_trace.entry_idclass type t = object ... endclass dummy : object ... endDummy implementation, returns Tr.Entry_id.dummy
create ~sink () makes a tracer that will write terms into the given sink.
val emit : t -> Sidekick_core_logic.Term.t -> term_refval emit' : t -> Sidekick_core_logic.Term.t -> unitTerm.TracerEmit terms in traces.
Traces will contains terms, encoded as a DAG. Each subterm is its own event, and gets a term identifier used in other subsequent entries to refer to it.
module Tr = Sidekick_tracetype term_ref = Sidekick_trace.entry_idclass type t = object ... endclass dummy : object ... endDummy implementation, returns Tr.Entry_id.dummy
create ~sink () makes a tracer that will write terms into the given sink.
val emit : t -> Sidekick_core_logic.Term.t -> term_refval emit' : t -> Sidekick_core_logic.Term.t -> unitSidekick_core.Terminclude module type of struct include Sidekick_core_logic.Term endtype var = Sidekick_core_logic.Var.ttype bvar = Sidekick_core_logic.Bvar.ttype store = Sidekick_core_logic.Term.storeThe store for terms.
The store is responsible for allocating unique IDs to terms, and enforcing their hashconsing (so that syntactic equality is just a pointer comparison).
include Sidekick_sigs.EQ_ORD_HASH with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intval pp_debug : t Sidekick_util.Fmt.printerval pp_debug_with_ids : t Sidekick_util.Fmt.printerinclude Sidekick_sigs.WITH_SET_MAP_TBL with type t := tmodule Set = Sidekick_core_logic.Term.Setmodule Map = Sidekick_core_logic.Term.Mapmodule Tbl = Sidekick_core_logic.Term.Tblinclude Sidekick_sigs.WITH_WEAK with type t := tmodule Weak_set = Sidekick_core_logic.Term.Weak_setmodule Weak_map = Sidekick_core_logic.Term.Weak_mapval is_app : t -> boolval is_const : t -> boolval is_pi : t -> booliter_dag t ~f calls f once on each subterm of t, t included. It must not traverse t as a tree, but rather as a perfectly shared DAG.
For example, in:
let x = 2 in
+Term (sidekick.Sidekick_core.Term) Module Sidekick_core.Term
include module type of struct include Sidekick_core_logic.Term end
type var = Sidekick_core_logic.Var.ttype bvar = Sidekick_core_logic.Bvar.ttype store = Sidekick_core_logic.Term.storeThe store for terms.
The store is responsible for allocating unique IDs to terms, and enforcing their hashconsing (so that syntactic equality is just a pointer comparison).
include Sidekick_sigs.EQ_ORD_HASH with type t := t
include Sidekick_sigs.EQ with type t := t
include Sidekick_sigs.ORD with type t := t
include Sidekick_sigs.HASH with type t := t
val hash : t -> intval pp_debug : t Sidekick_util.Fmt.printerval pp_debug_with_ids : t Sidekick_util.Fmt.printerContainers
include Sidekick_sigs.WITH_SET_MAP_TBL with type t := t
module Set = Sidekick_core_logic.Term.Setmodule Map = Sidekick_core_logic.Term.Mapmodule Tbl = Sidekick_core_logic.Term.Tblinclude Sidekick_sigs.WITH_WEAK with type t := t
module Weak_set = Sidekick_core_logic.Term.Weak_setmodule Weak_map = Sidekick_core_logic.Term.Weak_mapUtils
val is_app : t -> boolval is_const : t -> boolval is_pi : t -> booliter_dag t ~f calls f once on each subterm of t, t included. It must not traverse t as a tree, but rather as a perfectly shared DAG.
For example, in:
let x = 2 in
let y = f x x in
let z = g y x in
z = z
the DAG has the following nodes:
n1: 2
n2: f n1 n1
n3: g n2 n1
-n4: = n3 n3
iter_shallow f e iterates on immediate subterms of e, calling f trdb e' for each subterm e', with trdb = true iff e' is directly under a binder.
iter_shallow f e iterates on immediate subterms of e, calling f trdb e' for each subterm e', with trdb = true iff e' is directly under a binder.
val free_vars :
+ ?init:Sidekick_core_logic__.Var.Set.t ->
t ->
- Sidekick_core_logic__.Var.Set.tval is_type : t -> boolis_type t is true iff view t is Type _
val is_a_type : t -> boolis_a_type t is true if is_ty (ty t)
val is_closed : t -> boolIs the term closed (all bound variables are paired with a binder)? time: O(1)
val has_fvars : t -> boolDoes the term contain free variables? time: O(1)
Creation
module Store = Sidekick_core_logic.Term.Storemodule DB = Sidekick_core_logic.Term.DBDe bruijn indices
include module type of struct include Sidekick_core_logic.T_builtins end
val bool : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval proof : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval c_not : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval c_eq : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval c_ite : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval true_ : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval false_ : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval is_type : t -> boolis_type t is true iff view t is Type _
val is_a_type : t -> boolis_a_type t is true if is_ty (ty t)
val is_closed : t -> boolIs the term closed (all bound variables are paired with a binder)? time: O(1)
val has_fvars : t -> boolDoes the term contain free variables? time: O(1)
Creation
module Store = Sidekick_core_logic.Term.Storemodule DB = Sidekick_core_logic.Term.DBDe bruijn indices
include module type of struct include Sidekick_core_logic.T_builtins end
val bool : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval proof : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval c_not : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval c_eq : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval c_ite : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval true_ : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval false_ : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval bool_val :
Sidekick_core_logic.Term.store ->
bool ->
Sidekick_core_logic.Term.tval const_decoders : Sidekick_core_logic.Const.decodersSidekick_core_logic.Term.tabs t returns an "absolute value" for the term, along with the sign of t.
The idea is that we want to turn not a into (false, a), or (a != b) into (false, a=b). For terms without a negation this should return (true, t).
val as_bool_val : Sidekick_core_logic.Term.t -> bool optionval open_eq :
Sidekick_core_logic.Term.t ->
(Sidekick_core_logic.Term.t * Sidekick_core_logic.Term.t) optionopen_eq (a=b) returns Some (a,b), None for other terms.
type term = Sidekick_core_logic.Term.ttype hook =
- recurse:term Sidekick_util.Fmt.printer ->
+ recurse:term Sidekick_util.Fmt.printer ->
Sidekick_util.Fmt.t ->
term ->
- boolPrinting hook, responsible for printing certain subterms
module Hooks : sig ... endval default_hooks : Hooks.t Stdlib.refval pp : term Sidekick_util.Fmt.printerPrint using default_hooks
val pp_limit : max_depth:int -> max_nodes:int -> term Sidekick_util.Fmt.printerPrint with a limit on the number of nodes printed. An ellipsis is displayed otherwise.
module Tracer : sig ... endEmit terms in traces.
module Trace_reader : sig ... endmodule Ref : sig ... endTerm reference
\ No newline at end of file
+ boolPrinting hook, responsible for printing certain subterms
module Hooks : sig ... endval default_hooks : Hooks.t Stdlib.refval pp : term Sidekick_util.Fmt.printerPrint using default_hooks
val pp_limit : max_depth:int -> max_nodes:int -> term Sidekick_util.Fmt.printerPrint with a limit on the number of nodes printed. An ellipsis is displayed otherwise.
module Tracer : sig ... endEmit terms in traces.
module Trace_reader : sig ... endmodule Ref : sig ... endTerm reference
Sidekick_coreMain Signatures.
Theories and concrete solvers rely on an environment that defines several important types:
In this module we define most of the main signatures used throughout Sidekick.
module Const = Sidekick_core_logic.Constmodule Str_const = Sidekick_core_logic.Str_constmodule Term : sig ... endmodule Bool_view : sig ... endBoolean-oriented view of terms
module CC_view : sig ... endView terms through the lens of a Congruence Closure
module Default_cc_view : sig ... endmodule Bvar = Sidekick_core_logic.Bvarmodule Lit : sig ... endLiterals
module Subst = Sidekick_core_logic.Substmodule Var = Sidekick_core_logic.Varmodule Box : sig ... endmodule Gensym : sig ... endFresh symbol generation
val const_decoders :
+Sidekick_core (sidekick.Sidekick_core) Module Sidekick_core
Main Signatures.
Theories and concrete solvers rely on an environment that defines several important types:
- types
- terms (to represent logic expressions and formulas)
- a congruence closure instance
- a bridge to some SAT solver
In this module we define most of the main signatures used throughout Sidekick.
Re-exports from core-logic
module Const = Sidekick_core_logic.Constmodule Str_const = Sidekick_core_logic.Str_constmodule Term : sig ... endview
module Bool_view : sig ... endBoolean-oriented view of terms
module CC_view : sig ... endView terms through the lens of a Congruence Closure
module Default_cc_view : sig ... endMain modules
module Bvar = Sidekick_core_logic.Bvarmodule Lit : sig ... endLiterals
module Subst = Sidekick_core_logic.Substmodule Var = Sidekick_core_logic.Varmodule Box : sig ... endmodule Gensym : sig ... endFresh symbol generation
Const decoders for traces
val const_decoders :
(string
* Sidekick_core_logic.Const.Ops.t
* (Sidekick_core_logic__.Types_.term Sidekick_util.Ser_decode.t ->
Sidekick_core_logic.Const.view Sidekick_util.Ser_decode.t))
- list
\ No newline at end of file
+ listSidekick_core_logic.BvarBound variable
include Sidekick_sigs.EQ_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval make : int -> Sidekick_core_logic__.Types_.term -> tval idx : t -> intval ty : t -> Sidekick_core_logic__.Types_.termSidekick_core_logic.BvarBound variable
include Sidekick_sigs.EQ_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval make : int -> Sidekick_core_logic__.Types_.term -> tval idx : t -> intval ty : t -> Sidekick_core_logic__.Types_.termConst.Opstype t = {pp : Sidekick_core_logic__.Types_.const_view Sidekick_util.Fmt.printer;Pretty-print constant
*)equal : Sidekick_core_logic__.Types_.const_view ->
+Ops (sidekick.Sidekick_core_logic.Const.Ops) Module Const.Ops
type t = {pp : Sidekick_core_logic__.Types_.const_view Sidekick_util.Fmt.printer;(*Pretty-print constant
*)equal : Sidekick_core_logic__.Types_.const_view ->
Sidekick_core_logic__.Types_.const_view ->
bool;(*Equality of constant with any other constant
*)hash : Sidekick_core_logic__.Types_.const_view -> int;(*Hash constant
*)ser : (Sidekick_core_logic__.Types_.term -> Sidekick_util.Ser_value.t) ->
Sidekick_core_logic__.Types_.const_view ->
- string * Sidekick_util.Ser_value.t;(*Serialize a constant, along with a tag to recognize it.
*)
}
\ No newline at end of file
+ string * Sidekick_util.Ser_value.t;Serialize a constant, along with a tag to recognize it.
*)}Sidekick_core_logic.ConstConstants.
Constants are logical symbols, defined by the user thanks to an open type
module Ops : sig ... endval ser :
- ser_t:(Sidekick_core_logic__.Types_.term -> Sidekick_util.Ser_value.t) ->
+Const (sidekick.Sidekick_core_logic.Const) Module Sidekick_core_logic.Const
Constants.
Constants are logical symbols, defined by the user thanks to an open type
module Ops : sig ... endval ser :
+ ser_t:(Sidekick_core_logic__.Types_.term -> Sidekick_util.Ser_value.t) ->
t ->
string * Sidekick_util.Ser_value.tval ty : t -> Sidekick_core_logic__.Types_.termtype decoders =
(string
* Ops.t
* (Sidekick_core_logic__.Types_.term Sidekick_util.Ser_decode.t ->
view Sidekick_util.Ser_decode.t))
- listDecoders for constants: given a term store, return a list of supported tags, and for each tag, a decoder for constants that have this particular tag.
include Sidekick_sigs.EQ_HASH_PRINT with type t := t
include Sidekick_sigs.EQ with type t := t
include Sidekick_sigs.HASH with type t := t
val hash : t -> intinclude Sidekick_sigs.PRINT with type t := t
val pp : t Sidekick_sigs.printer
\ No newline at end of file
+ listDecoders for constants: given a term store, return a list of supported tags, and for each tag, a decoder for constants that have this particular tag.
include Sidekick_sigs.EQ_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerSidekick_core_logic.Str_constBasic string constants.
These constants are a string name, coupled with a type.
val const_decoders : Const.decodersval make :
+Str_const (sidekick.Sidekick_core_logic.Str_const) Module Sidekick_core_logic.Str_const
Basic string constants.
These constants are a string name, coupled with a type.
val const_decoders : Const.decoders
\ No newline at end of file
+ ty:Sidekick_core_logic__.Types_.term ->
+ Sidekick_core_logic__.Types_.constSidekick_core_logic.SubstSubstitutions
include Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval empty : tval is_empty : t -> boolval of_list :
+Subst (sidekick.Sidekick_core_logic.Subst) Module Sidekick_core_logic.Subst
Substitutions
include Sidekick_sigs.PRINT with type t := t
val pp : t Sidekick_sigs.printerval empty : tval is_empty : t -> boolval of_list :
(Sidekick_core_logic__.Types_.var * Sidekick_core_logic__.Types_.term) list ->
tval apply :
Term.store ->
- recursive:bool ->
+ recursive:bool ->
t ->
Sidekick_core_logic__.Types_.term ->
- Sidekick_core_logic__.Types_.term
\ No newline at end of file
+ Sidekick_core_logic__.Types_.termSidekick_core_logic.T_builtinsCore builtins
val bool : Term.store -> Term.tval proof : Term.store -> Term.tval c_not : Term.store -> Term.tval c_eq : Term.store -> Term.tval c_ite : Term.store -> Term.tval true_ : Term.store -> Term.tval false_ : Term.store -> Term.tval bool_val : Term.store -> bool -> Term.tval const_decoders : Const.decodersval eq : Term.store -> Term.t -> Term.t -> Term.teq a b is a = b
val not : Term.store -> Term.t -> Term.tval ite : Term.store -> Term.t -> Term.t -> Term.t -> Term.tite a b c is if a then b else c
val is_eq : Term.t -> boolval is_bool : Term.t -> boolval abs : Term.store -> Term.t -> bool * Term.tabs t returns an "absolute value" for the term, along with the sign of t.
The idea is that we want to turn not a into (false, a), or (a != b) into (false, a=b). For terms without a negation this should return (true, t).
val as_bool_val : Term.t -> bool optionSidekick_core_logic.T_builtinsCore builtins
val bool : Term.store -> Term.tval proof : Term.store -> Term.tval c_not : Term.store -> Term.tval c_eq : Term.store -> Term.tval c_ite : Term.store -> Term.tval true_ : Term.store -> Term.tval false_ : Term.store -> Term.tval bool_val : Term.store -> bool -> Term.tval const_decoders : Const.decodersval eq : Term.store -> Term.t -> Term.t -> Term.teq a b is a = b
val not : Term.store -> Term.t -> Term.tval ite : Term.store -> Term.t -> Term.t -> Term.t -> Term.tite a b c is if a then b else c
val is_eq : Term.t -> boolval is_bool : Term.t -> boolval abs : Term.store -> Term.t -> bool * Term.tabs t returns an "absolute value" for the term, along with the sign of t.
The idea is that we want to turn not a into (false, a), or (a != b) into (false, a=b). For terms without a negation this should return (true, t).
val as_bool_val : Term.t -> bool optionTerm.DBDe bruijn indices
lam_db store ~var_ty bod is \ _:var_ty. bod. Not DB shifting is done.
pi_db store ~var_ty bod is pi _:var_ty. bod. Not DB shifting is done.
subst_db0 store t ~by replaces bound variable 0 in t with the term by. This is useful, for example, to implement beta-reduction.
For example, with t being _[0] = (\x. _[2] _[1] x[0]), subst_db0 store t ~by:"hello" is "hello" = (\x. _[2] "hello" x[0]).
shift store t ~by shifts all bound variables in t that are not closed on, by amount by (which must be >= 0).
For example, with term t being \x. _[1] _[2] x[0], shift store t ~by:5 is \x. _[6] _[7] x[0].
Term.DBDe bruijn indices
lam_db store ~var_ty bod is \ _:var_ty. bod. Not DB shifting is done.
pi_db store ~var_ty bod is pi _:var_ty. bod. Not DB shifting is done.
subst_db0 store t ~by replaces bound variable 0 in t with the term by. This is useful, for example, to implement beta-reduction.
For example, with t being _[0] = (\x. _[2] _[1] x[0]), subst_db0 store t ~by:"hello" is "hello" = (\x. _[2] "hello" x[0]).
shift store t ~by shifts all bound variables in t that are not closed on, by amount by (which must be >= 0).
For example, with term t being \x. _[1] _[2] x[0], shift store t ~by:5 is \x. _[6] _[7] x[0].
Term.StoreTerm.StoreSidekick_core_logic.TermCore logic terms.
The core terms are expressions in the calculus of constructions, with no universe polymorphism nor cumulativity. It should be fast, with hashconsing; and simple enough (no inductives, no universe trickery).
It is intended to be the foundation for user-level terms and types and formulas.
type var = Var.ttype bvar = Bvar.ttype t = termA term, in the calculus of constructions
The store for terms.
The store is responsible for allocating unique IDs to terms, and enforcing their hashconsing (so that syntactic equality is just a pointer comparison).
include Sidekick_sigs.EQ_ORD_HASH with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intval pp_debug : t Sidekick_util.Fmt.printerval pp_debug_with_ids : t Sidekick_util.Fmt.printerinclude Sidekick_sigs.WITH_SET_MAP_TBL with type t := tinclude Sidekick_sigs.WITH_WEAK with type t := tval is_app : t -> boolval is_const : t -> boolval is_pi : t -> booliter_dag t ~f calls f once on each subterm of t, t included. It must not traverse t as a tree, but rather as a perfectly shared DAG.
For example, in:
let x = 2 in
+Term (sidekick.Sidekick_core_logic.Term) Module Sidekick_core_logic.Term
Core logic terms.
The core terms are expressions in the calculus of constructions, with no universe polymorphism nor cumulativity. It should be fast, with hashconsing; and simple enough (no inductives, no universe trickery).
It is intended to be the foundation for user-level terms and types and formulas.
type var = Var.ttype bvar = Bvar.ttype t = termA term, in the calculus of constructions
The store for terms.
The store is responsible for allocating unique IDs to terms, and enforcing their hashconsing (so that syntactic equality is just a pointer comparison).
include Sidekick_sigs.EQ_ORD_HASH with type t := t
include Sidekick_sigs.EQ with type t := t
include Sidekick_sigs.ORD with type t := t
include Sidekick_sigs.HASH with type t := t
val hash : t -> intval pp_debug : t Sidekick_util.Fmt.printerval pp_debug_with_ids : t Sidekick_util.Fmt.printerContainers
include Sidekick_sigs.WITH_SET_MAP_TBL with type t := t
include Sidekick_sigs.WITH_WEAK with type t := t
Utils
val is_app : t -> boolval is_const : t -> boolval is_pi : t -> booliter_dag t ~f calls f once on each subterm of t, t included. It must not traverse t as a tree, but rather as a perfectly shared DAG.
For example, in:
let x = 2 in
let y = f x x in
let z = g y x in
z = z
the DAG has the following nodes:
n1: 2
n2: f n1 n1
n3: g n2 n1
-n4: = n3 n3
iter_shallow f e iterates on immediate subterms of e, calling f trdb e' for each subterm e', with trdb = true iff e' is directly under a binder.
iter_shallow f e iterates on immediate subterms of e, calling f trdb e' for each subterm e', with trdb = true iff e' is directly under a binder.
val free_vars :
+ ?init:Sidekick_core_logic__.Var.Set.t ->
t ->
- Sidekick_core_logic__.Var.Set.tval is_type : t -> boolis_type t is true iff view t is Type _
val is_a_type : t -> boolis_a_type t is true if is_ty (ty t)
val is_closed : t -> boolIs the term closed (all bound variables are paired with a binder)? time: O(1)
val has_fvars : t -> boolDoes the term contain free variables? time: O(1)
Creation
module Store : sig ... endmodule DB : sig ... endDe bruijn indices
\ No newline at end of file
+ Sidekick_core_logic__.Var.Set.tval is_type : t -> boolis_type t is true iff view t is Type _
val is_a_type : t -> boolis_a_type t is true if is_ty (ty t)
val is_closed : t -> boolIs the term closed (all bound variables are paired with a binder)? time: O(1)
val has_fvars : t -> boolDoes the term contain free variables? time: O(1)
module Store : sig ... endmodule DB : sig ... endDe bruijn indices
Sidekick_core_logic.VarFree variable
include Sidekick_sigs.EQ_ORD_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval pp_with_ty : t Sidekick_util.Fmt.printerval make : string -> Sidekick_core_logic__.Types_.term -> tval makef :
+Var (sidekick.Sidekick_core_logic.Var) Module Sidekick_core_logic.Var
Free variable
include Sidekick_sigs.EQ_ORD_HASH_PRINT with type t := t
include Sidekick_sigs.EQ with type t := t
include Sidekick_sigs.ORD with type t := t
include Sidekick_sigs.HASH with type t := t
val hash : t -> intinclude Sidekick_sigs.PRINT with type t := t
val pp : t Sidekick_sigs.printerval pp_with_ty : t Sidekick_util.Fmt.printerval make : string -> Sidekick_core_logic__.Types_.term -> tval makef :
('a, Stdlib.Format.formatter, unit, t) Stdlib.format4 ->
Sidekick_core_logic__.Types_.term ->
- 'aval name : t -> stringval ty : t -> Sidekick_core_logic__.Types_.terminclude Sidekick_sigs.WITH_SET_MAP_TBL with type t := t
\ No newline at end of file
+ 'aval name : t -> stringval ty : t -> Sidekick_core_logic__.Types_.terminclude Sidekick_sigs.WITH_SET_MAP_TBL with type t := tSidekick_core_logicmodule Term : sig ... endCore logic terms.
module Var : sig ... endFree variable
module Bvar : sig ... endBound variable
module Const : sig ... endConstants.
module Subst : sig ... endSubstitutions
module T_builtins : sig ... endCore builtins
module Store = Term.Storemodule Str_const : sig ... endBasic string constants.
Sidekick_core_logicmodule Term : sig ... endCore logic terms.
module Var : sig ... endFree variable
module Bvar : sig ... endBound variable
module Const : sig ... endConstants.
module Subst : sig ... endSubstitutions
module T_builtins : sig ... endCore builtins
module Store = Term.Storemodule Str_const : sig ... endBasic string constants.
Make.Atomval hash : t -> intval sign : t -> boolval pp : t Fmt.printertype atom = tval of_int_dimacs : int -> tTurn a signed integer into an atom. Positive integers are positive atoms, and -i is neg (of_int i).
Make.Atomval hash : t -> intval sign : t -> boolval pp : t Fmt.printertype atom = tval of_int_dimacs : int -> tTurn a signed integer into an atom. Positive integers are positive atoms, and -i is neg (of_int i).
Make.Checkerval create : Clause.store -> tMake.Checkerval create : Clause.store -> tMake.ClauseMake.ClauseSidekick_drup.Makemodule Atom : sig ... endtype atom = Atom.tmodule Clause : sig ... endtype clause = Clause.tmodule Checker : sig ... endSidekick_drup.Makemodule Atom : sig ... endtype atom = Atom.tmodule Clause : sig ... endtype clause = Clause.tmodule Checker : sig ... endSidekick_drupDRUP trace checker.
This module provides a checker for DRUP traces, including proof_rule-by-proof_rule checking for traces that interleave DRUP steps with other kinds of steps.
module Veci = Sidekick_util.Vecimodule type S = sig ... endAn instance of the checker
Sidekick_drupDRUP trace checker.
This module provides a checker for DRUP traces, including proof_rule-by-proof_rule checking for traces that interleave DRUP steps with other kinds of steps.
module Veci = Sidekick_util.Vecimodule type S = sig ... endAn instance of the checker
S.Atomval hash : t -> intval sign : t -> boolval pp : t Fmt.printertype atom = tval of_int_dimacs : int -> tTurn a signed integer into an atom. Positive integers are positive atoms, and -i is neg (of_int i).
S.Atomval hash : t -> intval sign : t -> boolval pp : t Fmt.printertype atom = tval of_int_dimacs : int -> tTurn a signed integer into an atom. Positive integers are positive atoms, and -i is neg (of_int i).
S.Checkerval create : Clause.store -> tS.Checkerval create : Clause.store -> tS.ClauseS.ClauseSidekick_drup.SAn instance of the checker
module Atom : sig ... endtype atom = Atom.tmodule Clause : sig ... endtype clause = Clause.tmodule Checker : sig ... endSidekick_drup.SAn instance of the checker
module Atom : sig ... endtype atom = Atom.tmodule Clause : sig ... endtype clause = Clause.tmodule Checker : sig ... endSidekick_memtraceSidekick_mini_ccMini congruence closure
This implementation is as simple as possible, and doesn't provide backtracking, theories, or explanations. It just decides the satisfiability of a set of (dis)equations.
module type ARG = sig ... endArgument for the functor Make
val create : arg:(module ARG) -> Sidekick_core.Term.store -> tInstantiate the congruence closure for the given argument structure.
val create_default : Sidekick_core.Term.store -> tUse the default cc view
val clear : t -> unitFully reset the congruence closure's state
val add_lit : t -> Sidekick_core.Term.t -> bool -> unitadd_lit cc p sign asserts that p is true if sign, or p is false if not sign. If p is an equation and sign is true, this adds a new equation to the congruence relation.
val check_sat : t -> boolcheck_sat cc returns true if the current state is satisfiable, false if it's unsatisfiable.
val classes : t -> Sidekick_core.Term.t Iter.t Iter.tTraverse the set of classes in the congruence closure. This should be called only if check returned Sat.
Sidekick_mini_ccMini congruence closure
This implementation is as simple as possible, and doesn't provide backtracking, theories, or explanations. It just decides the satisfiability of a set of (dis)equations.
module type ARG = sig ... endArgument for the functor Make
val create : arg:(module ARG) -> Sidekick_core.Term.store -> tInstantiate the congruence closure for the given argument structure.
val create_default : Sidekick_core.Term.store -> tUse the default cc view
val clear : t -> unitFully reset the congruence closure's state
val add_lit : t -> Sidekick_core.Term.t -> bool -> unitadd_lit cc p sign asserts that p is true if sign, or p is false if not sign. If p is an equation and sign is true, this adds a new equation to the congruence relation.
val check_sat : t -> boolcheck_sat cc returns true if the current state is satisfiable, false if it's unsatisfiable.
val classes : t -> Sidekick_core.Term.t Iter.t Iter.tTraverse the set of classes in the congruence closure. This should be called only if check returned Sat.
Sidekick_mini_cc.ARGArgument for the functor Make
It only requires a Term.t structure, and a congruence-oriented view.
val view_as_cc :
+ARG (sidekick.Sidekick_mini_cc.ARG) Module type Sidekick_mini_cc.ARG
Argument for the functor Make
It only requires a Term.t structure, and a congruence-oriented view.
val view_as_cc :
Sidekick_core.Term.t ->
(Sidekick_core.Const.t, Sidekick_core.Term.t, Sidekick_core.Term.t list)
- Sidekick_core.CC_view.t
\ No newline at end of file
+ Sidekick_core.CC_view.tSidekick_proof.Core_rulesCore proofs for SMT and congruence closure.
type lit = Sidekick_core.Lit.tlemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.
val define_term :
+Core_rules (sidekick.Sidekick_proof.Core_rules) Module Sidekick_proof.Core_rules
Core proofs for SMT and congruence closure.
type lit = Sidekick_core.Lit.tlemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.
val define_term :
Sidekick_core_logic.Term.t ->
Sidekick_core_logic.Term.t ->
Pterm.tdefine_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u
val proof_p1 : Pterm.step_id -> Pterm.step_id -> Pterm.tproof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the Pterm.t that produces C \/ u, i.e unit paramodulation.
val proof_r1 : Pterm.step_id -> Pterm.step_id -> Pterm.tproof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the Pterm.t that produces C \/ u, i.e unit resolution.
val proof_res :
- pivot:Sidekick_core_logic.Term.t ->
+ pivot:Sidekick_core_logic.Term.t ->
Pterm.step_id ->
Pterm.step_id ->
Pterm.tproof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the Pterm.t that produces C \/ D, i.e boolean resolution.
val with_defs : Pterm.step_id -> Pterm.step_id list -> Pterm.twith_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.
val lemma_true : Sidekick_core_logic.Term.t -> Pterm.tlemma_true (true) p asserts the clause (true)
val lemma_preprocess :
Sidekick_core_logic.Term.t ->
Sidekick_core_logic.Term.t ->
- using:Pterm.step_id list ->
+ using:Pterm.step_id list ->
Pterm.tlemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.
The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.
From now on, t and u will be used interchangeably.
val lemma_rw_clause :
Pterm.step_id ->
- res:lit list ->
- using:Pterm.step_id list ->
- Pterm.tlemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).
\ No newline at end of file
+ res:lit list ->
+ using:Pterm.step_id list ->
+ Pterm.tlemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).
Sidekick_proof.PtermProof terms.
A proof term is the description of a reasoning step, that yields a clause.
type step_id = Step.idtype lit = Sidekick_core.Lit.ttype local_ref = Step.idA local reference is a step id that is only valid in the scope of a P_let. Typically one can use negative integers to avoid accidental shadowing.
type rule_apply = {rule_name : string;lit_args : lit list;term_args : Sidekick_core.Term.t list;subst_args : Sidekick_core.Subst.t list;premises : step_id list;indices : int list;}type delayed = unit -> tinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval dummy : tReference to the dummy step
val apply_rule :
- ?lits:lit list ->
- ?terms:Sidekick_core.Term.t list ->
- ?substs:Sidekick_core.Subst.t list ->
- ?premises:step_id list ->
- ?indices:int list ->
+Pterm (sidekick.Sidekick_proof.Pterm) Module Sidekick_proof.Pterm
Proof terms.
A proof term is the description of a reasoning step, that yields a clause.
type step_id = Step.idtype lit = Sidekick_core.Lit.ttype local_ref = Step.idA local reference is a step id that is only valid in the scope of a P_let. Typically one can use negative integers to avoid accidental shadowing.
type rule_apply = {rule_name : string;lit_args : lit list;term_args : Sidekick_core.Term.t list;subst_args : Sidekick_core.Subst.t list;premises : step_id list;indices : int list;
}type delayed = unit -> tinclude Sidekick_sigs.PRINT with type t := t
val pp : t Sidekick_sigs.printerval dummy : tReference to the dummy step
val apply_rule :
+ ?lits:lit list ->
+ ?terms:Sidekick_core.Term.t list ->
+ ?substs:Sidekick_core.Subst.t list ->
+ ?premises:step_id list ->
+ ?indices:int list ->
string ->
- tval to_ser : Sidekick_core.Term.Tracer.t -> t -> Sidekick_util.Ser_value.tSerialize
val deser : Sidekick_core.Term.Trace_reader.t -> t Sidekick_util.Ser_decode.t
\ No newline at end of file
+ tval to_ser : Sidekick_core.Term.Tracer.t -> t -> Sidekick_util.Ser_value.tSerialize
val deser : Sidekick_core.Term.Trace_reader.t -> t Sidekick_util.Ser_decode.tSidekick_proof.Sat_rulesSAT-solver proof emission.
type lit = Sidekick_core.Lit.tEmit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.
Sidekick_proof.Sat_rulesSAT-solver proof emission.
type lit = Sidekick_core.Lit.tEmit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.
Sidekick_proof.StepSidekick_proof.StepSidekick_proof.Step_vecA vector indexed by steps.
include Sidekick_util.Vec_sig.BASE with type elt = Step.idval create : ?cap:int -> unit -> tval clear : t -> unitval is_empty : t -> boolval fast_remove : t -> int -> unitRemove element at index i without preserving order (swap with last element)
val ensure_size : t -> int -> unitval shrink : t -> int -> unitSidekick_proof.Step_vecA vector indexed by steps.
include Sidekick_util.Vec_sig.BASE with type elt = Step.idval create : ?cap:int -> unit -> tval clear : t -> unitval is_empty : t -> boolval fast_remove : t -> int -> unitRemove element at index i without preserving order (swap with last element)
val ensure_size : t -> int -> unitval shrink : t -> int -> unitSidekick_proof.Trace_readermodule Tr = Sidekick_tracemodule Dec = Sidekick_util.Ser_decodetype step_id = Step.idval create : src:Tr.Source.t -> Sidekick_core.Term.Trace_reader.t -> tval read_step :
- ?fix:bool ->
+Trace_reader (sidekick.Sidekick_proof.Trace_reader) Module Sidekick_proof.Trace_reader
module Tr = Sidekick_tracemodule Dec = Sidekick_util.Ser_decodetype step_id = Step.idval create : src:Tr.Source.t -> Sidekick_core.Term.Trace_reader.t -> tval read_step :
+ ?fix:bool ->
t ->
step_id ->
- (Pterm.t, Dec.Error.t) Stdlib.resultRead a step from the source at the given step id, using the trace reader.
\ No newline at end of file
+ (Pterm.t, Dec.Error.t) Stdlib.resultRead a step from the source at the given step id, using the trace reader.
Tracer.concreteConcrete implementation of t
inherit Sidekick_core.Term.Tracer.tmethod emit_proof_step : Sidekick_proof__.Pterm.delayed -> step_idCreate a new step in the trace.
method emit_proof_delete : step_id -> unitForget a step that won't be used in the rest of the trace. Only useful for performance/memory considerations.
Tracer.concreteConcrete implementation of t
inherit Sidekick_core.Term.Tracer.tmethod emit_proof_step : Sidekick_proof__.Pterm.delayed -> step_idCreate a new step in the trace.
method emit_proof_delete : step_id -> unitForget a step that won't be used in the rest of the trace. Only useful for performance/memory considerations.
Tracer.dummyDummy proof trace, logs nothing.
inherit Sidekick_core.Term.Tracer.tmethod emit_proof_step : Sidekick_proof__.Pterm.delayed -> step_idCreate a new step in the trace.
method emit_proof_delete : step_id -> unitForget a step that won't be used in the rest of the trace. Only useful for performance/memory considerations.
Tracer.dummyDummy proof trace, logs nothing.
inherit Sidekick_core.Term.Tracer.tmethod emit_proof_step : Sidekick_proof__.Pterm.delayed -> step_idCreate a new step in the trace.
method emit_proof_delete : step_id -> unitForget a step that won't be used in the rest of the trace. Only useful for performance/memory considerations.
Tracer.tA proof tracer.
A proof tracer builds a log of all deductive steps taken by the solver, so we can later reconstruct a certificate for proof-checking.
Each step in the proof trace should be a valid lemma (of its theory) or a valid consequence of previous steps.
inherit Sidekick_core.Term.Tracer.tmethod emit_proof_step : Sidekick_proof__.Pterm.delayed -> step_idCreate a new step in the trace.
method emit_proof_delete : step_id -> unitForget a step that won't be used in the rest of the trace. Only useful for performance/memory considerations.
Tracer.tA proof tracer.
A proof tracer builds a log of all deductive steps taken by the solver, so we can later reconstruct a certificate for proof-checking.
Each step in the proof trace should be a valid lemma (of its theory) or a valid consequence of previous steps.
inherit Sidekick_core.Term.Tracer.tmethod emit_proof_step : Sidekick_proof__.Pterm.delayed -> step_idCreate a new step in the trace.
method emit_proof_delete : step_id -> unitForget a step that won't be used in the rest of the trace. Only useful for performance/memory considerations.
Sidekick_proof.TracerProof traces.
A proof trace is a log of all the deductive reasoning steps made by the SMT solver and other reasoning components. It essentially stores a DAG of all these steps, where each step points (via step_id) to its premises.
type step_id = Step.idIdentifier for a tracing step (like a unique ID for a clause previously added/proved)
class type t = object ... endA proof tracer.
val enabled : t -> boolIs proof tracing enabled?
val enable : t -> bool -> unitEnable proof tracing
val add_step : t -> Pterm.delayed -> step_idCreate a new step in the trace.
Forget a step that won't be used in the rest of the trace. Only useful for performance/memory considerations.
val dummy : tclass concrete : sink:Sidekick_trace.Sink.t -> tConcrete implementation of t
Sidekick_proof.TracerProof traces.
A proof trace is a log of all the deductive reasoning steps made by the SMT solver and other reasoning components. It essentially stores a DAG of all these steps, where each step points (via step_id) to its premises.
type step_id = Step.idIdentifier for a tracing step (like a unique ID for a clause previously added/proved)
class type t = object ... endA proof tracer.
val enabled : t -> boolIs proof tracing enabled?
val enable : t -> bool -> unitEnable proof tracing
val add_step : t -> Pterm.delayed -> step_idCreate a new step in the trace.
Forget a step that won't be used in the rest of the trace. Only useful for performance/memory considerations.
val dummy : tclass concrete : sink:Sidekick_trace.Sink.t -> tConcrete implementation of t
Sidekick_proofmodule Step : sig ... endmodule Step_vec : sig ... endA vector indexed by steps.
module Sat_rules : sig ... endSAT-solver proof emission.
module Core_rules : sig ... endCore proofs for SMT and congruence closure.
module Pterm : sig ... endProof terms.
module Tracer : sig ... endProof traces.
module Trace_reader : sig ... endtype term = Pterm.ttype term_ref = Step.idtype step_id = Step.idSidekick_proofmodule Step : sig ... endmodule Step_vec : sig ... endA vector indexed by steps.
module Sat_rules : sig ... endSAT-solver proof emission.
module Core_rules : sig ... endCore proofs for SMT and congruence closure.
module Pterm : sig ... endProof terms.
module Tracer : sig ... endProof traces.
module Trace_reader : sig ... endtype term = Pterm.ttype term_ref = Step.idtype step_id = Step.idProof.FunProof.FunProof.Litval pp_with :
- pp_t:(Sidekick_util.Fmt.t -> term -> unit) ->
+Lit (sidekick.Sidekick_quip.Proof.Lit) Module Proof.Lit
\ No newline at end of file
+ unitval pp : Sidekick_util.Fmt.t -> t -> unitProof.TRepresentation of terms, with explicit sharing
val hash : t -> intval true_ : tval false_ : tval bool : bool -> tval ref : string -> tval pp : t Sidekick_util.Util.printerProof.TRepresentation of terms, with explicit sharing
val hash : t -> intval true_ : tval false_ : tval bool : bool -> tval ref : string -> tval pp : t Sidekick_util.Util.printerProof.TyRepresentation of types
val hash : t -> intval pp : t Sidekick_util.Util.printerProof.TyRepresentation of types
val hash : t -> intval pp : t Sidekick_util.Util.printerSidekick_quip.Proofmodule Ty : sig ... endRepresentation of types
module Fun : sig ... endmodule Cstor = Funmodule T : sig ... endRepresentation of terms, with explicit sharing
type term = T.ttype ty = Ty.tmodule Lit : sig ... endtype clause = Lit.t listtype t = | Unspecified| Sorry| Sorry_c of clause| Named of string| Refl of term| CC_lemma_imply of t list * term * term| CC_lemma of clause| Assertion of term| Assertion_c of clause| Hres of t * hres_step list| Res of term * t * t| Res1 of t * t| Paramod1 of t * t| Rup of clause * t list| Clause_rw of {}| DT_isa_split of ty * term list| DT_isa_disj of ty * term * term| DT_cstor_inj of Cstor.t * int * term list * term list| Bool_true_is_true| Bool_true_neq_false| Bool_eq of term * term| Bool_c of bool_c_name * term list| Ite_true of term| Ite_false of term| LRA of clause| Composite of {assumptions : (string * Lit.t) list;steps : composite_step array;}and composite_step = | S_step_c of {}A named step in Composite, with the expected result. This decouples the checking of the sub-proof, from its use in the rest of the proof, as we can use res even if checking proof failed.
| S_step_anon of {name : string;proof : t;}A named intermediate proof, to be reused in subsequent proofs. Unlike S_step_c we do not specify the expected result so if this fails, any proof downstream will also fail.
| S_define_t of term * term| S_define_t_name of string * termval stepc : name:string -> clause -> t -> composite_stepval step_anon : name:string -> t -> composite_stepval deft : term -> term -> composite_stepval deft_name : string -> term -> composite_stepval is_trivial_refl : t -> boolval default : tval sorry : tval ref_by_name : string -> tval composite_a : ?assms:(string * Lit.t) list -> composite_step array -> tval composite_l : ?assms:(string * Lit.t) list -> composite_step list -> tval composite_iter : ?assms:(string * Lit.t) list -> composite_step Iter.t -> tval true_is_true : tval true_neq_false : tval bool_c : bool_c_name -> term list -> tSidekick_quip.Proofmodule Ty : sig ... endRepresentation of types
module Fun : sig ... endmodule Cstor = Funmodule T : sig ... endRepresentation of terms, with explicit sharing
type term = T.ttype ty = Ty.tmodule Lit : sig ... endtype clause = Lit.t listtype t = | Unspecified| Sorry| Sorry_c of clause| Named of string| Refl of term| CC_lemma_imply of t list * term * term| CC_lemma of clause| Assertion of term| Assertion_c of clause| Hres of t * hres_step list| Res of term * t * t| Res1 of t * t| Paramod1 of t * t| Rup of clause * t list| Clause_rw of {}| DT_isa_split of ty * term list| DT_isa_disj of ty * term * term| DT_cstor_inj of Cstor.t * int * term list * term list| Bool_true_is_true| Bool_true_neq_false| Bool_eq of term * term| Bool_c of bool_c_name * term list| Ite_true of term| Ite_false of term| LRA of clause| Composite of {assumptions : (string * Lit.t) list;steps : composite_step array;}and composite_step = | S_step_c of {}A named step in Composite, with the expected result. This decouples the checking of the sub-proof, from its use in the rest of the proof, as we can use res even if checking proof failed.
| S_step_anon of {name : string;proof : t;}A named intermediate proof, to be reused in subsequent proofs. Unlike S_step_c we do not specify the expected result so if this fails, any proof downstream will also fail.
| S_define_t of term * term| S_define_t_name of string * termval stepc : name:string -> clause -> t -> composite_stepval step_anon : name:string -> t -> composite_stepval deft : term -> term -> composite_stepval deft_name : string -> term -> composite_stepval is_trivial_refl : t -> boolval default : tval sorry : tval ref_by_name : string -> tval composite_a : ?assms:(string * Lit.t) list -> composite_step array -> tval composite_l : ?assms:(string * Lit.t) list -> composite_step list -> tval composite_iter : ?assms:(string * Lit.t) list -> composite_step Iter.t -> tval true_is_true : tval true_neq_false : tval bool_c : bool_c_name -> term list -> tSidekick_quipProofs of unsatisfiability in the Quip proof format..
This targets Quip as an experimental proof backend.
module Proof : sig ... endtype t = Proof.tThe state holding the whole proof.
What format to use to serialize the proof?
val pp_out_format : out_format Sidekick_util.Fmt.printerval output : ?fmt:out_format -> Stdlib.out_channel -> t -> unitval pp_debug : t Sidekick_util.Fmt.printerSidekick_quipProofs of unsatisfiability in the Quip proof format..
This targets Quip as an experimental proof backend.
module Proof : sig ... endtype t = Proof.tThe state holding the whole proof.
What format to use to serialize the proof?
val pp_out_format : out_format Sidekick_util.Fmt.printerval output : ?fmt:out_format -> Stdlib.out_channel -> t -> unitval pp_debug : t Sidekick_util.Fmt.printerSolver.Clausetype t = clauseval lits_iter : store -> t -> Sidekick_core.Lit.t Iter.tLiterals of a clause
val lits_a : store -> t -> Sidekick_core.Lit.t arrayAtoms of a clause
val lits_l : store -> t -> Sidekick_core.Lit.t listList of atoms of a clause
Solver.Clausetype t = clauseval lits_iter : store -> t -> Sidekick_core.Lit.t Iter.tLiterals of a clause
val lits_a : store -> t -> Sidekick_core.Lit.t arrayAtoms of a clause
val lits_l : store -> t -> Sidekick_core.Lit.t listList of atoms of a clause
Sidekick_sat.SolverThe external interface implemented by SAT solvers.
module Clause : sig ... endtype t = solverMain solver type, containing all state for solving.
val stat : t -> Sidekick_util.Stat.tStatistics
val on_conflict : t -> (Clause.t, unit) Sidekick_util.Event.tval on_decision : t -> (Sidekick_core.Lit.t, unit) Sidekick_util.Event.tval on_learnt : t -> (Clause.t, unit) Sidekick_util.Event.tval on_gc : t -> (Sidekick_core.Lit.t array, unit) Sidekick_util.Event.ttype res = | Sat of (module Sidekick_sat__.Sigs.SAT_STATE)Returned when the solver reaches SAT, with a model
*)| Unsat of (module Sidekick_sat__.Sigs.UNSAT_STATE with type clause = clause)Returned when the solver reaches UNSAT, with a proof
*)Result type for the solver
Exception raised by the evaluating functions when a literal has not yet been assigned a value.
val assume : t -> Sidekick_core.Lit.t list list -> unitAdd the list of clauses to the current set of assumptions. Modifies the sat solver state in place.
val add_clause :
+Solver (sidekick.Sidekick_sat.Solver) Module Sidekick_sat.Solver
The external interface implemented by SAT solvers.
module Clause : sig ... endMain Solver Type
type t = solverMain solver type, containing all state for solving.
val stat : t -> Sidekick_util.Stat.tStatistics
val on_conflict : t -> (Clause.t, unit) Sidekick_util.Event.tval on_decision : t -> (Sidekick_core.Lit.t, unit) Sidekick_util.Event.tval on_learnt : t -> (Clause.t, unit) Sidekick_util.Event.tval on_gc : t -> (Sidekick_core.Lit.t array, unit) Sidekick_util.Event.tTypes
type res = | Sat of (module Sidekick_sat__.Sigs.SAT_STATE)(*Returned when the solver reaches SAT, with a model
*)| Unsat of (module Sidekick_sat__.Sigs.UNSAT_STATE with type clause = clause)(*Returned when the solver reaches UNSAT, with a proof
*)
Result type for the solver
Exception raised by the evaluating functions when a literal has not yet been assigned a value.
Base operations
val assume : t -> Sidekick_core.Lit.t list list -> unitAdd the list of clauses to the current set of assumptions. Modifies the sat solver state in place.
val add_clause :
t ->
Sidekick_core.Lit.t list ->
Sidekick_proof.Pterm.delayed ->
@@ -8,28 +8,28 @@
Sidekick_core.Lit.t array ->
Sidekick_proof.Pterm.delayed ->
unitLower level addition of clauses
val add_input_clause : t -> Sidekick_core.Lit.t list -> unitLike add_clause but with the justification of being an input clause
val add_input_clause_a : t -> Sidekick_core.Lit.t array -> unitLike add_clause_a but with justification of being an input clause
Solving
val solve :
- ?on_progress:(unit -> unit) ->
- ?assumptions:Sidekick_core.Lit.t list ->
+ ?on_progress:(unit -> unit) ->
+ ?assumptions:Sidekick_core.Lit.t list ->
t ->
- resTry and solves the current set of clauses.
Evaluating and adding literals
val add_lit : t -> ?default_pol:bool -> Sidekick_core.Lit.t -> unitEnsure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.
val set_default_pol : t -> Sidekick_core.Lit.t -> bool -> unitSet default polarity for the given boolean variable. Sign of the literal is ignored.
val true_at_level0 : t -> Sidekick_core.Lit.t -> booltrue_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models
val eval_lit : t -> Sidekick_core.Lit.t -> Sidekick_sat__.Sigs.lboolEvaluate atom in current state
Assumption stack
val push_assumption : t -> Sidekick_core.Lit.t -> unitPushes an assumption onto the assumption stack. It will remain there until it's pop'd by pop_assumptions.
val pop_assumptions : t -> int -> unitpop_assumptions solver n removes n assumptions from the stack. It removes the assumptions that were the most recently added via push_assumptions.
type propagation_result = | PR_sat| PR_conflict of {}| PR_unsat of (module Sidekick_sat__.Sigs.UNSAT_STATE with type clause = clause)
Result returned by check_sat_propagations_only
val check_sat_propagations_only :
- ?assumptions:Sidekick_core.Lit.t list ->
+ resTry and solves the current set of clauses.
Evaluating and adding literals
val add_lit : t -> ?default_pol:bool -> Sidekick_core.Lit.t -> unitEnsure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.
val set_default_pol : t -> Sidekick_core.Lit.t -> bool -> unitSet default polarity for the given boolean variable. Sign of the literal is ignored.
val true_at_level0 : t -> Sidekick_core.Lit.t -> booltrue_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models
val eval_lit : t -> Sidekick_core.Lit.t -> Sidekick_sat__.Sigs.lboolEvaluate atom in current state
Assumption stack
val push_assumption : t -> Sidekick_core.Lit.t -> unitPushes an assumption onto the assumption stack. It will remain there until it's pop'd by pop_assumptions.
val pop_assumptions : t -> int -> unitpop_assumptions solver n removes n assumptions from the stack. It removes the assumptions that were the most recently added via push_assumptions.
type propagation_result = | PR_sat| PR_conflict of {}| PR_unsat of (module Sidekick_sat__.Sigs.UNSAT_STATE with type clause = clause)
Result returned by check_sat_propagations_only
val check_sat_propagations_only :
+ ?assumptions:Sidekick_core.Lit.t list ->
t ->
propagation_resultcheck_sat_propagations_only solver uses the added clauses and local assumptions (using push_assumptions and assumptions) to quickly assess whether the context is satisfiable. It is not complete; calling solve is required to get an accurate result.
Initialization
val mk_plugin_cdcl_t :
- push_level:(unit -> unit) ->
- pop_levels:(int -> unit) ->
- ?partial_check:((module Sidekick_sat__.Sigs.ACTS) -> unit) ->
- final_check:((module Sidekick_sat__.Sigs.ACTS) -> unit) ->
+ push_level:(unit -> unit) ->
+ pop_levels:(int -> unit) ->
+ ?partial_check:((module Sidekick_sat__.Sigs.ACTS) -> unit) ->
+ final_check:((module Sidekick_sat__.Sigs.ACTS) -> unit) ->
unit ->
(module Sidekick_sat__.Sigs.PLUGIN)Create a plugin
val create :
- ?stat:Sidekick_util.Stat.t ->
- ?size:[ `Tiny | `Small | `Big ] ->
- tracer:Tracer.t ->
+ ?stat:Sidekick_util.Stat.t ->
+ ?size:[ `Tiny | `Small | `Big ] ->
+ tracer:Tracer.t ->
plugin ->
tCreate new solver
val plugin_pure_sat : pluginval create_pure_sat :
- ?stat:Sidekick_util.Stat.t ->
- ?size:[ `Tiny | `Small | `Big ] ->
- tracer:Tracer.t ->
+ ?stat:Sidekick_util.Stat.t ->
+ ?size:[ `Tiny | `Small | `Big ] ->
+ tracer:Tracer.t ->
unit ->
- t
\ No newline at end of file
+ tTracer.dummyinherit Proof.Tracer.tmethod sat_assert_clause : id:int ->
+dummy (sidekick.Sidekick_sat.Tracer.dummy) Class Tracer.dummy
inherit Proof.Tracer.tmethod sat_assert_clause : id:int ->
Sidekick_core.Lit.t Iter.t ->
Proof.Step.id ->
- Tr.Entry_id.tmethod sat_delete_clause : id:int -> Sidekick_core.Lit.t Iter.t -> unitmethod sat_unsat_clause : id:int -> Tr.Entry_id.tmethod sat_encode_lit : Sidekick_core.Lit.t -> Sidekick_util.Ser_value.t
\ No newline at end of file
+ Tr.Entry_id.tmethod sat_delete_clause : id:int -> Sidekick_core.Lit.t Iter.t -> unitmethod sat_unsat_clause : id:int -> Tr.Entry_id.tmethod sat_encode_lit : Sidekick_core.Lit.t -> Sidekick_util.Ser_value.tTracer.tTracer for the SAT solver.
inherit Proof.Tracer.tmethod sat_assert_clause : id:int ->
+t (sidekick.Sidekick_sat.Tracer.t) Class type Tracer.t
Tracer for the SAT solver.
inherit Proof.Tracer.tmethod sat_assert_clause : id:int ->
Sidekick_core.Lit.t Iter.t ->
Proof.Step.id ->
- Tr.Entry_id.tmethod sat_delete_clause : id:int -> Sidekick_core.Lit.t Iter.t -> unitmethod sat_unsat_clause : id:int -> Tr.Entry_id.tmethod sat_encode_lit : Sidekick_core.Lit.t -> Sidekick_util.Ser_value.t
\ No newline at end of file
+ Tr.Entry_id.tmethod sat_delete_clause : id:int -> Sidekick_core.Lit.t Iter.t -> unitmethod sat_unsat_clause : id:int -> Tr.Entry_id.tmethod sat_encode_lit : Sidekick_core.Lit.t -> Sidekick_util.Ser_value.tSidekick_sat.TracerTracer for clauses and literals
module Tr = Sidekick_tracemodule Proof = Sidekick_proofclass type t = object ... endTracer for the SAT solver.
val dummy : tDummy tracer, recording nothing.
val assert_clause :
+Tracer (sidekick.Sidekick_sat.Tracer) Module Sidekick_sat.Tracer
Tracer for clauses and literals
module Tr = Sidekick_tracemodule Proof = Sidekick_proofclass type t = object ... endTracer for the SAT solver.
val dummy : tDummy tracer, recording nothing.
val assert_clause :
t ->
- id:int ->
+ id:int ->
Sidekick_core.Lit.t Iter.t ->
Proof.Step.id ->
Tr.Entry_id.tval assert_clause' :
t ->
- id:int ->
+ id:int ->
Sidekick_core.Lit.t Iter.t ->
Proof.Step.id ->
- unitval delete_clause : t -> id:int -> Sidekick_core.Lit.t Iter.t -> unitval unsat_clause : t -> id:int -> Tr.Entry_id.tval unsat_clause' : t -> id:int -> unitval encode_lit : t -> Sidekick_core.Lit.t -> Sidekick_util.Ser_value.t
\ No newline at end of file
+ unitval delete_clause : t -> id:int -> Sidekick_core.Lit.t Iter.t -> unitval unsat_clause : t -> id:int -> Tr.Entry_id.tval unsat_clause' : t -> id:int -> unitval encode_lit : t -> Sidekick_core.Lit.t -> Sidekick_util.Ser_value.tSidekick_satMain API
module Proof = Sidekick_proofmodule type SAT_STATE = sig ... endSolver in a "SATISFIABLE" state
type sat_state = (module SAT_STATE)The type of values returned when the solver reaches a SAT state.
module type UNSAT_STATE = sig ... endSolver in an "UNSATISFIABLE" state
type 'clause unsat_state = (module UNSAT_STATE with type clause = 'clause)The type of values returned when the solver reaches an UNSAT state.
This type is used during the normalisation of lits. true means the literal stayed the same, false that its sign was flipped.
The type of reasons for propagations of a lit f.
Consequence (l, p) means that the lits in l imply the propagated lit f. The proof should be a proof of the clause "l implies f".
invariant: in Consequence (fun () -> l,p), all elements of l must be true in the current trail.
note on lazyiness: the justification is suspended (using unit -> …) to avoid potentially costly computations that might never be used if this literal is backtracked without participating in a conflict. Therefore the function that produces (l,p) needs only be safe in trails (partial models) that are conservative extensions of the current trail. If the theory isn't robust w.r.t. extensions of the trail (e.g. if its internal state undergoes significant changes), it can be easier to produce the explanation eagerly when propagating, and then use Consequence (fun () -> expl, proof) with the already produced (expl,proof) tuple.
val pp_lbool : Sidekick_core.Fmt.t -> lbool -> unitmodule type ACTS = sig ... endActions available to the Plugin.
type acts = (module ACTS)The type for a slice of assertions to assume/propagate in the theory.
module type THEORY_CDCL_T = sig ... endSignature for theories to be given to the CDCL(T) solver
module type PLUGIN = sig ... endmodule Solver : sig ... endThe external interface implemented by SAT solvers.
module Tracer : sig ... endTracer for clauses and literals
include module type of struct include Solver endtype clause = Solver.clausetype solver = Solver.solverThe main solver type.
type store = Solver.storeStores atoms, clauses, etc.
module Clause = Solver.Clausetype t = solverMain solver type, containing all state for solving.
val stat : t -> Sidekick_util.Stat.tStatistics
val on_conflict : t -> (Clause.t, unit) Sidekick_util.Event.tval on_decision : t -> (Sidekick_core.Lit.t, unit) Sidekick_util.Event.tval on_learnt : t -> (Clause.t, unit) Sidekick_util.Event.tval on_gc : t -> (Sidekick_core.Lit.t array, unit) Sidekick_util.Event.ttype res = Solver.res = | Sat of (module Sidekick_sat__.Sigs.SAT_STATE)Returned when the solver reaches SAT, with a model
*)| Unsat of (module Sidekick_sat__.Sigs.UNSAT_STATE with type clause = clause)Returned when the solver reaches UNSAT, with a proof
*)Result type for the solver
Exception raised by the evaluating functions when a literal has not yet been assigned a value.
val assume : t -> Sidekick_core.Lit.t list list -> unitAdd the list of clauses to the current set of assumptions. Modifies the sat solver state in place.
val add_clause :
+Sidekick_sat (sidekick.Sidekick_sat) Module Sidekick_sat
Main API
module Proof = Sidekick_proofmodule type SAT_STATE = sig ... endSolver in a "SATISFIABLE" state
type sat_state = (module SAT_STATE)The type of values returned when the solver reaches a SAT state.
module type UNSAT_STATE = sig ... endSolver in an "UNSATISFIABLE" state
type 'clause unsat_state = (module UNSAT_STATE with type clause = 'clause)The type of values returned when the solver reaches an UNSAT state.
This type is used during the normalisation of lits. true means the literal stayed the same, false that its sign was flipped.
The type of reasons for propagations of a lit f.
Consequence (l, p) means that the lits in l imply the propagated lit f. The proof should be a proof of the clause "l implies f".
invariant: in Consequence (fun () -> l,p), all elements of l must be true in the current trail.
note on lazyiness: the justification is suspended (using unit -> …) to avoid potentially costly computations that might never be used if this literal is backtracked without participating in a conflict. Therefore the function that produces (l,p) needs only be safe in trails (partial models) that are conservative extensions of the current trail. If the theory isn't robust w.r.t. extensions of the trail (e.g. if its internal state undergoes significant changes), it can be easier to produce the explanation eagerly when propagating, and then use Consequence (fun () -> expl, proof) with the already produced (expl,proof) tuple.
val pp_lbool : Sidekick_core.Fmt.t -> lbool -> unitmodule type ACTS = sig ... endActions available to the Plugin.
type acts = (module ACTS)The type for a slice of assertions to assume/propagate in the theory.
module type THEORY_CDCL_T = sig ... endSignature for theories to be given to the CDCL(T) solver
module type PLUGIN = sig ... endmodule Solver : sig ... endThe external interface implemented by SAT solvers.
module Tracer : sig ... endTracer for clauses and literals
include module type of struct include Solver end
type clause = Solver.clausetype solver = Solver.solverThe main solver type.
type store = Solver.storeStores atoms, clauses, etc.
module Clause = Solver.ClauseMain Solver Type
type t = solverMain solver type, containing all state for solving.
val stat : t -> Sidekick_util.Stat.tStatistics
val on_conflict : t -> (Clause.t, unit) Sidekick_util.Event.tval on_decision : t -> (Sidekick_core.Lit.t, unit) Sidekick_util.Event.tval on_learnt : t -> (Clause.t, unit) Sidekick_util.Event.tval on_gc : t -> (Sidekick_core.Lit.t array, unit) Sidekick_util.Event.tTypes
type res = Solver.res = | Sat of (module Sidekick_sat__.Sigs.SAT_STATE)(*Returned when the solver reaches SAT, with a model
*)| Unsat of (module Sidekick_sat__.Sigs.UNSAT_STATE with type clause = clause)(*Returned when the solver reaches UNSAT, with a proof
*)
Result type for the solver
Exception raised by the evaluating functions when a literal has not yet been assigned a value.
Base operations
val assume : t -> Sidekick_core.Lit.t list list -> unitAdd the list of clauses to the current set of assumptions. Modifies the sat solver state in place.
val add_clause :
t ->
Sidekick_core.Lit.t list ->
Sidekick_proof.Pterm.delayed ->
@@ -7,29 +7,29 @@
t ->
Sidekick_core.Lit.t array ->
Sidekick_proof.Pterm.delayed ->
- unitLower level addition of clauses
val add_input_clause : t -> Sidekick_core.Lit.t list -> unitLike add_clause but with the justification of being an input clause
val add_input_clause_a : t -> Sidekick_core.Lit.t array -> unitLike add_clause_a but with justification of being an input clause
Solving
val solve :
- ?on_progress:(unit -> unit) ->
- ?assumptions:Sidekick_core.Lit.t list ->
+ unitLower level addition of clauses
val add_input_clause : t -> Sidekick_core.Lit.t list -> unitLike add_clause but with the justification of being an input clause
val add_input_clause_a : t -> Sidekick_core.Lit.t array -> unitLike add_clause_a but with justification of being an input clause
Solving
val solve :
+ ?on_progress:(unit -> unit) ->
+ ?assumptions:Sidekick_core.Lit.t list ->
t ->
- resTry and solves the current set of clauses.
Evaluating and adding literals
val add_lit : t -> ?default_pol:bool -> Sidekick_core.Lit.t -> unitEnsure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.
val set_default_pol : t -> Sidekick_core.Lit.t -> bool -> unitSet default polarity for the given boolean variable. Sign of the literal is ignored.
val true_at_level0 : t -> Sidekick_core.Lit.t -> booltrue_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models
val eval_lit : t -> Sidekick_core.Lit.t -> Sidekick_sat__.Sigs.lboolEvaluate atom in current state
Assumption stack
val push_assumption : t -> Sidekick_core.Lit.t -> unitPushes an assumption onto the assumption stack. It will remain there until it's pop'd by pop_assumptions.
val pop_assumptions : t -> int -> unitpop_assumptions solver n removes n assumptions from the stack. It removes the assumptions that were the most recently added via push_assumptions.
type propagation_result = Solver.propagation_result = | PR_sat| PR_conflict of {}| PR_unsat of (module Sidekick_sat__.Sigs.UNSAT_STATE with type clause = clause)
Result returned by check_sat_propagations_only
val check_sat_propagations_only :
- ?assumptions:Sidekick_core.Lit.t list ->
+ resTry and solves the current set of clauses.
Evaluating and adding literals
val add_lit : t -> ?default_pol:bool -> Sidekick_core.Lit.t -> unitEnsure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.
val set_default_pol : t -> Sidekick_core.Lit.t -> bool -> unitSet default polarity for the given boolean variable. Sign of the literal is ignored.
val true_at_level0 : t -> Sidekick_core.Lit.t -> booltrue_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models
val eval_lit : t -> Sidekick_core.Lit.t -> Sidekick_sat__.Sigs.lboolEvaluate atom in current state
Assumption stack
val push_assumption : t -> Sidekick_core.Lit.t -> unitPushes an assumption onto the assumption stack. It will remain there until it's pop'd by pop_assumptions.
val pop_assumptions : t -> int -> unitpop_assumptions solver n removes n assumptions from the stack. It removes the assumptions that were the most recently added via push_assumptions.
type propagation_result = Solver.propagation_result = | PR_sat| PR_conflict of {}| PR_unsat of (module Sidekick_sat__.Sigs.UNSAT_STATE with type clause = clause)
Result returned by check_sat_propagations_only
val check_sat_propagations_only :
+ ?assumptions:Sidekick_core.Lit.t list ->
t ->
- propagation_resultcheck_sat_propagations_only solver uses the added clauses and local assumptions (using push_assumptions and assumptions) to quickly assess whether the context is satisfiable. It is not complete; calling solve is required to get an accurate result.
Initialization
val plugin_cdcl_t :
+ propagation_resultcheck_sat_propagations_only solver uses the added clauses and local assumptions (using push_assumptions and assumptions) to quickly assess whether the context is satisfiable. It is not complete; calling solve is required to get an accurate result.
Initialization
val mk_plugin_cdcl_t :
- push_level:(unit -> unit) ->
- pop_levels:(int -> unit) ->
- ?partial_check:((module Sidekick_sat__.Sigs.ACTS) -> unit) ->
- final_check:((module Sidekick_sat__.Sigs.ACTS) -> unit) ->
+ push_level:(unit -> unit) ->
+ pop_levels:(int -> unit) ->
+ ?partial_check:((module Sidekick_sat__.Sigs.ACTS) -> unit) ->
+ final_check:((module Sidekick_sat__.Sigs.ACTS) -> unit) ->
unit ->
(module Sidekick_sat__.Sigs.PLUGIN)Create a plugin
val create :
- ?stat:Sidekick_util.Stat.t ->
- ?size:[ `Tiny | `Small | `Big ] ->
- tracer:Tracer.t ->
+ ?stat:Sidekick_util.Stat.t ->
+ ?size:[ `Tiny | `Small | `Big ] ->
+ tracer:Tracer.t ->
plugin ->
tCreate new solver
val plugin_pure_sat : pluginval create_pure_sat :
- ?stat:Sidekick_util.Stat.t ->
- ?size:[ `Tiny | `Small | `Big ] ->
- tracer:Tracer.t ->
+ ?stat:Sidekick_util.Stat.t ->
+ ?size:[ `Tiny | `Small | `Big ] ->
+ tracer:Tracer.t ->
unit ->
- t
\ No newline at end of file
+ tSidekick_sat.ACTSActions available to the Plugin.
The plugin provides callbacks for the SAT solver to use. These callbacks are provided with a (module ACTS) so they can modify the SAT solver by adding new lemmas, raise conflicts, etc.
val proof_tracer : Sidekick_proof.Tracer.tval iter_assumptions : (Sidekick_core.Lit.t -> unit) -> unitTraverse the new assumptions on the boolean trail.
val eval_lit : Sidekick_core.Lit.t -> Sidekick_sat__.Sigs.lboolObtain current value of the given literal
val add_lit : ?default_pol:bool -> Sidekick_core.Lit.t -> unitMap the given lit to an internal atom, which will be decided by the SAT solver.
val add_clause :
- ?keep:bool ->
+ACTS (sidekick.Sidekick_sat.ACTS) Module type Sidekick_sat.ACTS
Actions available to the Plugin.
The plugin provides callbacks for the SAT solver to use. These callbacks are provided with a (module ACTS) so they can modify the SAT solver by adding new lemmas, raise conflicts, etc.
val proof_tracer : Sidekick_proof.Tracer.tval iter_assumptions : (Sidekick_core.Lit.t -> unit) -> unitTraverse the new assumptions on the boolean trail.
val eval_lit : Sidekick_core.Lit.t -> Sidekick_sat__.Sigs.lboolObtain current value of the given literal
val add_lit : ?default_pol:bool -> Sidekick_core.Lit.t -> unitMap the given lit to an internal atom, which will be decided by the SAT solver.
val add_clause :
+ ?keep:bool ->
Sidekick_core.Lit.t list ->
Sidekick_proof.Pterm.delayed ->
unitAdd a clause to the solver.
val raise_conflict :
Sidekick_core.Lit.t list ->
Sidekick_proof.Pterm.delayed ->
- 'bRaise a conflict, yielding control back to the solver. The list of atoms must be a valid theory lemma that is false in the current trail.
val propagate : Sidekick_core.Lit.t -> Sidekick_sat__.Sigs.reason -> unitPropagate a lit, i.e. the theory can evaluate the lit to be true (see the definition of eval_res
val add_decision_lit : Sidekick_core.Lit.t -> bool -> unitAsk the SAT solver to decide on the given lit with given sign before it can answer SAT. The order of decisions is still unspecified. Useful for theory combination. This will be undone on backtracking.
\ No newline at end of file
+ 'bRaise a conflict, yielding control back to the solver. The list of atoms must be a valid theory lemma that is false in the current trail.
val propagate : Sidekick_core.Lit.t -> Sidekick_sat__.Sigs.reason -> unitPropagate a lit, i.e. the theory can evaluate the lit to be true (see the definition of eval_res
val add_decision_lit : Sidekick_core.Lit.t -> bool -> unitAsk the SAT solver to decide on the given lit with given sign before it can answer SAT. The order of decisions is still unspecified. Useful for theory combination. This will be undone on backtracking.
Sidekick_sat.PLUGINAssume the lits in the slice, possibly using the slice to push new lits to be propagated or to raising a conflict or to add new lemmas.
Called at the end of the search in case a model has been found. If no new clause is pushed, then proof search ends and "sat" is returned; if lemmas are added, search is resumed; if a conflict clause is added, search backtracks and then resumes.
Sidekick_sat.PLUGINAssume the lits in the slice, possibly using the slice to push new lits to be propagated or to raising a conflict or to add new lemmas.
Called at the end of the search in case a model has been found. If no new clause is pushed, then proof search ends and "sat" is returned; if lemmas are added, search is resumed; if a conflict clause is added, search backtracks and then resumes.
Sidekick_sat.SAT_STATESolver in a "SATISFIABLE" state
val eval : Sidekick_core.Lit.t -> boolReturns the valuation of a lit in the current state of the sat solver.
val eval_level : Sidekick_core.Lit.t -> bool * intReturn the current assignement of the literals, as well as its decision level. If the level is 0, then it is necessary for the literal to have this value; otherwise it is due to choices that can potentially be backtracked.
val iter_trail : (Sidekick_core.Lit.t -> unit) -> unitIter through the lits in order of decision/propagation (starting from the first propagation, to the last propagation).
Sidekick_sat.SAT_STATESolver in a "SATISFIABLE" state
val eval : Sidekick_core.Lit.t -> boolReturns the valuation of a lit in the current state of the sat solver.
val eval_level : Sidekick_core.Lit.t -> bool * intReturn the current assignement of the literals, as well as its decision level. If the level is 0, then it is necessary for the literal to have this value; otherwise it is due to choices that can potentially be backtracked.
val iter_trail : (Sidekick_core.Lit.t -> unit) -> unitIter through the lits in order of decision/propagation (starting from the first propagation, to the last propagation).
Sidekick_sat.THEORY_CDCL_TSignature for theories to be given to the CDCL(T) solver
Assume the lits in the slice, possibly using the slice to push new lits to be propagated or to raising a conflict or to add new lemmas.
Called at the end of the search in case a model has been found. If no new clause is pushed, then proof search ends and "sat" is returned; if lemmas are added, search is resumed; if a conflict clause is added, search backtracks and then resumes.
Sidekick_sat.THEORY_CDCL_TSignature for theories to be given to the CDCL(T) solver
Assume the lits in the slice, possibly using the slice to push new lits to be propagated or to raising a conflict or to add new lemmas.
Called at the end of the search in case a model has been found. If no new clause is pushed, then proof search ends and "sat" is returned; if lemmas are added, search is resumed; if a conflict clause is added, search backtracks and then resumes.
Sidekick_sat.UNSAT_STATESolver in an "UNSATISFIABLE" state
val unsat_conflict : unit -> clauseReturns the unsat clause found at the toplevel
val unsat_assumptions : unit -> Sidekick_core.Lit.t Iter.tSubset of assumptions responsible for "unsat"
val unsat_proof : unit -> Sidekick_proof.Step.idSidekick_sat.UNSAT_STATESolver in an "UNSATISFIABLE" state
val unsat_conflict : unit -> clauseReturns the unsat clause found at the toplevel
val unsat_assumptions : unit -> Sidekick_core.Lit.t Iter.tSubset of assumptions responsible for "unsat"
val unsat_proof : unit -> Sidekick_proof.Step.idSidekick_sigsmodule type EQ = sig ... endmodule type ORD = sig ... endmodule type HASH = sig ... endmodule type PRINT = sig ... endmodule type EQ_HASH_PRINT = sig ... endmodule type EQ_ORD_HASH_PRINT = sig ... endmodule type EQ_ORD_HASH = sig ... endmodule type DYN_BACKTRACKABLE = sig ... endmodule type BACKTRACKABLE0 = sig ... endmodule type BACKTRACKABLE1 = sig ... endmodule type BACKTRACKABLE1_CB = sig ... endmodule type WITH_SET_MAP_TBL = sig ... endmodule type WITH_WEAK = sig ... endSidekick_sigsmodule type EQ = sig ... endmodule type ORD = sig ... endmodule type HASH = sig ... endmodule type PRINT = sig ... endmodule type EQ_HASH_PRINT = sig ... endmodule type EQ_ORD_HASH_PRINT = sig ... endmodule type EQ_ORD_HASH = sig ... endmodule type DYN_BACKTRACKABLE = sig ... endmodule type BACKTRACKABLE0 = sig ... endmodule type BACKTRACKABLE1 = sig ... endmodule type BACKTRACKABLE1_CB = sig ... endmodule type WITH_SET_MAP_TBL = sig ... endmodule type WITH_WEAK = sig ... endSidekick_sigs.BACKTRACKABLE0val n_levels : t -> intNumber of levels
val push_level : t -> unitPush a backtracking point
val pop_levels : t -> int -> unitpop_levels st n removes n levels
Sidekick_sigs.BACKTRACKABLE0val n_levels : t -> intNumber of levels
val push_level : t -> unitPush a backtracking point
val pop_levels : t -> int -> unitpop_levels st n removes n levels
Sidekick_sigs.BACKTRACKABLE1val n_levels : _ t -> intNumber of levels
val push_level : _ t -> unitPush a backtracking point
val pop_levels : _ t -> int -> unitpop_levels st n removes n levels
Sidekick_sigs.BACKTRACKABLE1val n_levels : _ t -> intNumber of levels
val push_level : _ t -> unitPush a backtracking point
val pop_levels : _ t -> int -> unitpop_levels st n removes n levels
Sidekick_sigs.BACKTRACKABLE1_CBinclude BACKTRACKABLE1val n_levels : _ t -> intNumber of levels
val push_level : _ t -> unitPush a backtracking point
val pop_levels : 'a t -> int -> f:('a -> unit) -> unitpop_levels st n ~f removes n levels, calling f on every removed item
Sidekick_sigs.BACKTRACKABLE1_CBinclude BACKTRACKABLE1val n_levels : _ t -> intNumber of levels
val push_level : _ t -> unitPush a backtracking point
val pop_levels : 'a t -> int -> f:('a -> unit) -> unitpop_levels st n ~f removes n levels, calling f on every removed item
Sidekick_sigs.DYN_BACKTRACKABLESidekick_sigs.DYN_BACKTRACKABLESidekick_sigs.EQSidekick_sigs.EQSidekick_sigs.EQ_HASH_PRINTSidekick_sigs.EQ_HASH_PRINTSidekick_sigs.EQ_ORD_HASHSidekick_sigs.EQ_ORD_HASHSidekick_sigs.EQ_ORD_HASH_PRINTSidekick_sigs.EQ_ORD_HASH_PRINTSidekick_sigs.HASHval hash : t -> intSidekick_sigs.HASHval hash : t -> intSidekick_sigs.ORDSidekick_sigs.ORDSidekick_sigs.PRINTSidekick_sigs.PRINTSidekick_sigs.WITH_SET_MAP_TBLSidekick_sigs.WITH_SET_MAP_TBLSidekick_sigs.WITH_WEAKSidekick_sigs.WITH_WEAKSidekick_simplex.Binary_opval to_string : t -> stringSidekick_simplex.Binary_opval to_string : t -> stringComb.InfixInfix operations on combinations
This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.
Comb.InfixInfix operations on combinations
This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.
Make.CombCombinations.
This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.
val pp : t Sidekick_util.Fmt.printerPrinter for linear combinations.
val is_empty : t -> boolIs the given expression empty ?
val empty : tThe empty linear combination.
as_singleton l returns Some (c,x) if l = c * x, None otherwise
module Infix : sig ... endInfix operations on combinations
Include the previous module.
include module type of InfixInfix operations on combinations
This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.
Make.CombCombinations.
This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.
val pp : t Sidekick_util.Fmt.printerPrinter for linear combinations.
val is_empty : t -> boolIs the given expression empty ?
val empty : tThe empty linear combination.
as_singleton l returns Some (c,x) if l = c * x, None otherwise
module Infix : sig ... endInfix operations on combinations
Include the previous module.
include module type of InfixInfix operations on combinations
This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.
Make.ConstrRepresents constraints on linear expressions.
type op = Linear_expr_intf.bool_opArithmetic comparison operators.
val pp : t Sidekick_util.Fmt.printerStandard printing function.
val of_expr : Expr.t -> Linear_expr_intf.bool_op -> tval make : Comb.t -> Linear_expr_intf.bool_op -> C.t -> tCreate a constraint from a linear expression/combination and a constant.
val op : t -> Linear_expr_intf.bool_opval split : t -> Comb.t * Linear_expr_intf.bool_op * C.tSplit the linear combinations from the constant
Make.ConstrRepresents constraints on linear expressions.
type op = Linear_expr_intf.bool_opArithmetic comparison operators.
val pp : t Sidekick_util.Fmt.printerStandard printing function.
val of_expr : Expr.t -> Linear_expr_intf.bool_op -> tval make : Comb.t -> Linear_expr_intf.bool_op -> C.t -> tCreate a constraint from a linear expression/combination and a constant.
val op : t -> Linear_expr_intf.bool_opval split : t -> Comb.t * Linear_expr_intf.bool_op * C.tSplit the linear combinations from the constant
Expr.InfixInfix operations on expressions
This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.
Expr.InfixInfix operations on expressions
This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.
Make.ExprLinear expressions represent linear arithmetic expressions as a linear combination and a constant.
val is_zero : t -> boolval is_const : t -> boolval pp : t Sidekick_util.Fmt.printerStandard printing function on expressions.
val zero : tThe expression 2.
module Infix : sig ... endInfix operations on expressions
Include the previous module.
include module type of InfixInfix operations on expressions
This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.
Make.ExprLinear expressions represent linear arithmetic expressions as a linear combination and a constant.
val is_zero : t -> boolval is_const : t -> boolval pp : t Sidekick_util.Fmt.printerStandard printing function on expressions.
val zero : tThe expression 2.
module Infix : sig ... endInfix operations on expressions
Include the previous module.
include module type of InfixInfix operations on expressions
This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.
Make.Cval pp : t Sidekick_util.Fmt.printerPrinter for coefficients.
val zero : tThe zero coefficient.
val one : tThe one coefficient (to rule them all, :p).
Make.Cval pp : t Sidekick_util.Fmt.printerPrinter for coefficients.
val zero : tThe zero coefficient.
val one : tThe one coefficient (to rule them all, :p).
Make.Varval pp : t Sidekick_util.Fmt.printerPrinter for variables.
val pp_lit : lit Sidekick_util.Fmt.printerMake.Varval pp : t Sidekick_util.Fmt.printerPrinter for variables.
val pp_lit : lit Sidekick_util.Fmt.printerLinear_expr.Makemodule C = CCoeficients used. Can be integers as well as rationals.
module Var = VarVariables used in expressions.
type var = Var.tThe type of variables appearing in expressions.
module Comb : sig ... endCombinations.
module Expr : sig ... endLinear expressions represent linear arithmetic expressions as a linear combination and a constant.
module Constr : sig ... endLinear_expr.Makemodule C = CCoeficients used. Can be integers as well as rationals.
module Var = VarVariables used in expressions.
type var = Var.tThe type of variables appearing in expressions.
module Comb : sig ... endCombinations.
module Expr : sig ... endLinear expressions represent linear arithmetic expressions as a linear combination and a constant.
module Constr : sig ... endSidekick_simplex.Linear_exprArithmetic expressions
module type COEFF = Linear_expr_intf.COEFFmodule type VAR = Linear_expr_intf.VARmodule type S = Linear_expr_intf.Smodule Make
+Linear_expr (sidekick.Sidekick_simplex.Linear_expr) Module Sidekick_simplex.Linear_expr
Arithmetic expressions
module type COEFF = Linear_expr_intf.COEFFmodule type VAR = Linear_expr_intf.VARmodule type S = Linear_expr_intf.S
\ No newline at end of file
+ S with module C = C and module Var = Var and module Var_map = CCMap.Make(Var)Sidekick_simplex.Linear_expr_intfmodule type COEFF = sig ... endmodule type VAR = sig ... endmodule type S = sig ... endLinear expressions & formulas.
Sidekick_simplex.Linear_expr_intfmodule type COEFF = sig ... endmodule type VAR = sig ... endmodule type S = sig ... endLinear expressions & formulas.
Linear_expr_intf.COEFFCoefficients are used in expressions. They usually are either rationals, or integers.
val pp : t Sidekick_util.Fmt.printerPrinter for coefficients.
val zero : tThe zero coefficient.
val one : tThe one coefficient (to rule them all, :p).
Linear_expr_intf.COEFFCoefficients are used in expressions. They usually are either rationals, or integers.
val pp : t Sidekick_util.Fmt.printerPrinter for coefficients.
val zero : tThe zero coefficient.
val one : tThe one coefficient (to rule them all, :p).
S.CCoeficients used. Can be integers as well as rationals.
val pp : t Sidekick_util.Fmt.printerPrinter for coefficients.
val zero : tThe zero coefficient.
val one : tThe one coefficient (to rule them all, :p).
S.CCoeficients used. Can be integers as well as rationals.
val pp : t Sidekick_util.Fmt.printerPrinter for coefficients.
val zero : tThe zero coefficient.
val one : tThe one coefficient (to rule them all, :p).
Comb.InfixInfix operations on combinations
This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.
Comb.InfixInfix operations on combinations
This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.
S.CombCombinations.
This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.
val pp : t Sidekick_util.Fmt.printerPrinter for linear combinations.
val is_empty : t -> boolIs the given expression empty ?
val empty : tThe empty linear combination.
as_singleton l returns Some (c,x) if l = c * x, None otherwise
module Infix : sig ... endInfix operations on combinations
Include the previous module.
include module type of InfixInfix operations on combinations
This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.
S.CombCombinations.
This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.
val pp : t Sidekick_util.Fmt.printerPrinter for linear combinations.
val is_empty : t -> boolIs the given expression empty ?
val empty : tThe empty linear combination.
as_singleton l returns Some (c,x) if l = c * x, None otherwise
module Infix : sig ... endInfix operations on combinations
Include the previous module.
include module type of InfixInfix operations on combinations
This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.
S.ConstrRepresents constraints on linear expressions.
type op = bool_opArithmetic comparison operators.
val pp : t Sidekick_util.Fmt.printerStandard printing function.
Create a constraint from a linear expression/combination and a constant.
S.ConstrRepresents constraints on linear expressions.
type op = bool_opArithmetic comparison operators.
val pp : t Sidekick_util.Fmt.printerStandard printing function.
Create a constraint from a linear expression/combination and a constant.
Expr.InfixInfix operations on expressions
This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.
Expr.InfixInfix operations on expressions
This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.
S.ExprLinear expressions represent linear arithmetic expressions as a linear combination and a constant.
val is_zero : t -> boolval is_const : t -> boolval pp : t Sidekick_util.Fmt.printerStandard printing function on expressions.
val zero : tThe expression 2.
module Infix : sig ... endInfix operations on expressions
Include the previous module.
include module type of InfixInfix operations on expressions
This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.
S.ExprLinear expressions represent linear arithmetic expressions as a linear combination and a constant.
val is_zero : t -> boolval is_const : t -> boolval pp : t Sidekick_util.Fmt.printerStandard printing function on expressions.
val zero : tThe expression 2.
module Infix : sig ... endInfix operations on expressions
Include the previous module.
include module type of InfixInfix operations on expressions
This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.
S.VarVariables used in expressions.
val pp : t Sidekick_util.Fmt.printerPrinter for variables.
val pp_lit : lit Sidekick_util.Fmt.printerS.VarVariables used in expressions.
val pp : t Sidekick_util.Fmt.printerPrinter for variables.
val pp_lit : lit Sidekick_util.Fmt.printerLinear_expr_intf.SLinear expressions & formulas.
This modules defines linear expressions (which are linear combinations of variables), and linear constraints, where the value of a linear expressions is constrained.
type var = Var.tThe type of variables appearing in expressions.
Maps from variables, used for expressions as well as substitutions.
module Comb : sig ... endCombinations.
module Expr : sig ... endLinear expressions represent linear arithmetic expressions as a linear combination and a constant.
module Constr : sig ... endLinear_expr_intf.SLinear expressions & formulas.
This modules defines linear expressions (which are linear combinations of variables), and linear constraints, where the value of a linear expressions is constrained.
type var = Var.tThe type of variables appearing in expressions.
Maps from variables, used for expressions as well as substitutions.
module Comb : sig ... endCombinations.
module Expr : sig ... endLinear expressions represent linear arithmetic expressions as a linear combination and a constant.
module Constr : sig ... endLinear_expr_intf.VARStandard interface for variables that are meant to be used in expressions.
val pp : t Sidekick_util.Fmt.printerPrinter for variables.
val pp_lit : lit Sidekick_util.Fmt.printerLinear_expr_intf.VARStandard interface for variables that are meant to be used in expressions.
val pp : t Sidekick_util.Fmt.printerPrinter for variables.
val pp_lit : lit Sidekick_util.Fmt.printerMake.ConstraintMake.ConstraintMake.SubstMake.SubstMake.Unsat_certMake.Unsat_certArg.Qinclude Sidekick_arith.NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printertype bigint = Z.tval infinity : t+infinity
val minus_infinity : tval is_real : t -> boolA proper real, not nan/infinity
val is_int : t -> boolIs this a proper integer?
val pp_approx : int -> Stdlib.Format.formatter -> t -> unitPretty print rational with given amount of precision (for example as a floating point number)
Arg.Qinclude Sidekick_arith.NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printertype bigint = Z.tval infinity : t+infinity
val minus_infinity : tval is_real : t -> boolA proper real, not nan/infinity
val is_int : t -> boolIs this a proper integer?
val pp_approx : int -> Stdlib.Format.formatter -> t -> unitPretty print rational with given amount of precision (for example as a floating point number)
Arg.Varval pp : t Sidekick_util.Fmt.printerPrinter for variables.
val pp_lit : lit Sidekick_util.Fmt.printerArg.Varval pp : t Sidekick_util.Fmt.printerPrinter for variables.
val pp_lit : lit Sidekick_util.Fmt.printerArg.Zinclude Sidekick_arith.NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerArg.Zinclude Sidekick_arith.NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerMake.ArgMake.ArgSidekick_simplex.Makemodule V = Arg.Varmodule Z = Arg.Zmodule Q = Arg.Qtype num = Q.tNumbers
module Constraint : sig ... endmodule Subst : sig ... endval create : ?stat:Sidekick_util.Stat.t -> unit -> tCreate a new simplex.
val push_level : t -> unitval pop_levels : t -> int -> unitDefine a basic variable in terms of other variables. This is useful to "name" a linear expression and get back a variable that can be used in a Constraint.t
module Unsat_cert : sig ... endexception E_unsat of Unsat_cert.tval add_constraint :
- ?is_int:bool ->
- on_propagate:ev_on_propagate ->
+Make (sidekick.Sidekick_simplex.Make) Module Sidekick_simplex.Make
Parameters
Signature
module V = Arg.Varmodule Z = Arg.Zmodule Q = Arg.Qtype num = Q.tNumbers
module Constraint : sig ... endmodule Subst : sig ... endval create : ?stat:Sidekick_util.Stat.t -> unit -> tCreate a new simplex.
val push_level : t -> unitval pop_levels : t -> int -> unitDefine a basic variable in terms of other variables. This is useful to "name" a linear expression and get back a variable that can be used in a Constraint.t
module Unsat_cert : sig ... endexception E_unsat of Unsat_cert.tval add_constraint :
+ ?is_int:bool ->
+ on_propagate:ev_on_propagate ->
t ->
Constraint.t ->
V.lit ->
- unitAdd a constraint to the simplex.
This is removed upon backtracking by default.
val declare_bound : ?is_int:bool -> t -> Constraint.t -> V.lit -> unitDeclare that this constraint exists and map it to a literal, so we can possibly propagate it later. Unlike add_constraint this does NOT assert that the constraint is true
Check the whole simplex for satisfiability.
Call check_exn and return a model or a proof of unsat. This does NOT enforce that integer variables map to integer values.
val check_branch_and_bound :
- on_propagate:(V.lit -> reason:V.lit list -> unit) ->
- max_tree_nodes:int ->
+ unitAdd a constraint to the simplex.
This is removed upon backtracking by default.
val declare_bound : ?is_int:bool -> t -> Constraint.t -> V.lit -> unitDeclare that this constraint exists and map it to a literal, so we can possibly propagate it later. Unlike add_constraint this does NOT assert that the constraint is true
Check the whole simplex for satisfiability.
Call check_exn and return a model or a proof of unsat. This does NOT enforce that integer variables map to integer values.
val check_branch_and_bound :
+ on_propagate:(V.lit -> reason:V.lit list -> unit) ->
+ max_tree_nodes:int ->
t ->
- result optionTry to solve and respect the integer constraints.
val n_vars : t -> intval n_rows : t -> int
\ No newline at end of file
+ result optionTry to solve and respect the integer constraints.
val n_vars : t -> intval n_rows : t -> intSidekick_simplex.OpSimplex operator
Sidekick_simplex.OpSimplex operator
Sidekick_simplex.PredicateSidekick_simplex.PredicateSidekick_simplexWe follow the paper "Integrating Simplex with DPLL(T )" from de Moura and Dutertre.
module Linear_expr_intf : sig ... endmodule Linear_expr : sig ... endArithmetic expressions
module Predicate : sig ... endmodule Binary_op : sig ... endmodule type INT = Sidekick_arith.INTmodule type RATIONAL = Sidekick_arith.RATIONALmodule type VAR = Linear_expr_intf.VARmodule Op : sig ... endSimplex operator
module type S = sig ... endmodule type ARG = sig ... endmodule Make
+Sidekick_simplex (sidekick.Sidekick_simplex) Module Sidekick_simplex
Fast Simplex for CDCL(T)
We follow the paper "Integrating Simplex with DPLL(T )" from de Moura and Dutertre.
module Linear_expr_intf : sig ... endmodule Linear_expr : sig ... endArithmetic expressions
module Predicate : sig ... endmodule Binary_op : sig ... endmodule type INT = Sidekick_arith.INTmodule type RATIONAL = Sidekick_arith.RATIONALmodule type VAR = Linear_expr_intf.VARmodule Op : sig ... endSimplex operator
module type S = sig ... endmodule type ARG = sig ... end
\ No newline at end of file
+ S with module V = Arg.Var and module Z = Arg.Z and module Q = Arg.QARG.Qinclude Sidekick_arith.NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printertype bigint = Z.tval infinity : t+infinity
val minus_infinity : tval is_real : t -> boolA proper real, not nan/infinity
val is_int : t -> boolIs this a proper integer?
val pp_approx : int -> Stdlib.Format.formatter -> t -> unitPretty print rational with given amount of precision (for example as a floating point number)
ARG.Qinclude Sidekick_arith.NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printertype bigint = Z.tval infinity : t+infinity
val minus_infinity : tval is_real : t -> boolA proper real, not nan/infinity
val is_int : t -> boolIs this a proper integer?
val pp_approx : int -> Stdlib.Format.formatter -> t -> unitPretty print rational with given amount of precision (for example as a floating point number)
ARG.Varval pp : t Sidekick_util.Fmt.printerPrinter for variables.
val pp_lit : lit Sidekick_util.Fmt.printerARG.Varval pp : t Sidekick_util.Fmt.printerPrinter for variables.
val pp_lit : lit Sidekick_util.Fmt.printerARG.Zinclude Sidekick_arith.NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerARG.Zinclude Sidekick_arith.NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerSidekick_simplex.ARGSidekick_simplex.ARGS.ConstraintS.ConstraintS.Qinclude Sidekick_arith.NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printertype bigint = Z.tval infinity : t+infinity
val minus_infinity : tval is_real : t -> boolA proper real, not nan/infinity
val is_int : t -> boolIs this a proper integer?
val pp_approx : int -> Stdlib.Format.formatter -> t -> unitPretty print rational with given amount of precision (for example as a floating point number)
S.Qinclude Sidekick_arith.NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printertype bigint = Z.tval infinity : t+infinity
val minus_infinity : tval is_real : t -> boolA proper real, not nan/infinity
val is_int : t -> boolIs this a proper integer?
val pp_approx : int -> Stdlib.Format.formatter -> t -> unitPretty print rational with given amount of precision (for example as a floating point number)
S.SubstS.SubstS.Unsat_certS.Unsat_certS.Vval pp : t Sidekick_util.Fmt.printerPrinter for variables.
val pp_lit : lit Sidekick_util.Fmt.printerS.Vval pp : t Sidekick_util.Fmt.printerPrinter for variables.
val pp_lit : lit Sidekick_util.Fmt.printerS.Zinclude Sidekick_arith.NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerS.Zinclude Sidekick_arith.NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerSidekick_simplex.Stype num = Q.tNumbers
module Constraint : sig ... endmodule Subst : sig ... endval create : ?stat:Sidekick_util.Stat.t -> unit -> tCreate a new simplex.
val push_level : t -> unitval pop_levels : t -> int -> unitDefine a basic variable in terms of other variables. This is useful to "name" a linear expression and get back a variable that can be used in a Constraint.t
module Unsat_cert : sig ... endexception E_unsat of Unsat_cert.tval add_constraint :
- ?is_int:bool ->
- on_propagate:ev_on_propagate ->
+S (sidekick.Sidekick_simplex.S) Module type Sidekick_simplex.S
type num = Q.tNumbers
module Constraint : sig ... endmodule Subst : sig ... endval create : ?stat:Sidekick_util.Stat.t -> unit -> tCreate a new simplex.
val push_level : t -> unitval pop_levels : t -> int -> unitDefine a basic variable in terms of other variables. This is useful to "name" a linear expression and get back a variable that can be used in a Constraint.t
module Unsat_cert : sig ... endexception E_unsat of Unsat_cert.tval add_constraint :
+ ?is_int:bool ->
+ on_propagate:ev_on_propagate ->
t ->
Constraint.t ->
V.lit ->
- unitAdd a constraint to the simplex.
This is removed upon backtracking by default.
val declare_bound : ?is_int:bool -> t -> Constraint.t -> V.lit -> unitDeclare that this constraint exists and map it to a literal, so we can possibly propagate it later. Unlike add_constraint this does NOT assert that the constraint is true
Check the whole simplex for satisfiability.
Call check_exn and return a model or a proof of unsat. This does NOT enforce that integer variables map to integer values.
val check_branch_and_bound :
- on_propagate:(V.lit -> reason:V.lit list -> unit) ->
- max_tree_nodes:int ->
+ unitAdd a constraint to the simplex.
This is removed upon backtracking by default.
val declare_bound : ?is_int:bool -> t -> Constraint.t -> V.lit -> unitDeclare that this constraint exists and map it to a literal, so we can possibly propagate it later. Unlike add_constraint this does NOT assert that the constraint is true
Check the whole simplex for satisfiability.
Call check_exn and return a model or a proof of unsat. This does NOT enforce that integer variables map to integer values.
val check_branch_and_bound :
+ on_propagate:(V.lit -> reason:V.lit list -> unit) ->
+ max_tree_nodes:int ->
t ->
- result optionTry to solve and respect the integer constraints.
val n_vars : t -> intval n_rows : t -> int
\ No newline at end of file
+ result optionTry to solve and respect the integer constraints.
val n_vars : t -> intval n_rows : t -> intSidekick_simplifyTerm simplifier
val tst : t -> Sidekick_core.Term.storeval create : Sidekick_core.Term.store -> proof:Sidekick_proof.Tracer.t -> tCreate a simplifier
val clear : t -> unitReset internal cache, etc.
val proof : t -> Sidekick_proof.Tracer.tAccess proof
type hook =
+Sidekick_simplify (sidekick.Sidekick_simplify) Module Sidekick_simplify
Term simplifier
val tst : t -> Sidekick_core.Term.storeval create : Sidekick_core.Term.store -> proof:Sidekick_proof.Tracer.t -> tCreate a simplifier
val clear : t -> unitReset internal cache, etc.
val proof : t -> Sidekick_proof.Tracer.tAccess proof
type hook =
t ->
Sidekick_core.Term.t ->
(Sidekick_core.Term.t * Sidekick_proof.Step.id Iter.t) optionGiven a Term.t, try to simplify it. Return None if it didn't change.
A simple example could be a hook that takes a Term.t t, and if t is app "+" (const x) (const y) where x and y are number, returns Some (const (x+y)), and None otherwise.
The simplifier will take care of simplifying the resulting Term.t further, caching (so that work is not duplicated in subterms), etc.
val normalize :
@@ -8,4 +8,4 @@
(Sidekick_core.Term.t * Sidekick_proof.Step.id) optionNormalize a Term.t using all the hooks. This performs a fixpoint, i.e. it only stops when no hook applies anywhere inside the Term.t.
val normalize_t :
t ->
Sidekick_core.Term.t ->
- Sidekick_core.Term.t * Sidekick_proof.Step.id optionNormalize a Term.t using all the hooks, along with a proof that the simplification is correct. returns t, ø if no simplification occurred.
\ No newline at end of file
+ Sidekick_core.Term.t * Sidekick_proof.Step.id optionNormalize a Term.t using all the hooks, along with a proof that the simplification is correct. returns t, ø if no simplification occurred.
Sidekick_smt_solver.Find_foreignFind foreign variables.
This module is a modular discoverer of foreign variables (and boolean terms). It should run after preprocessing of terms.
module type ACTIONS = sig ... endtype actions = (module ACTIONS)type hook = actions -> is_sub:bool -> Sidekick_core.Term.t -> unitval create : unit -> tval traverse_term : t -> actions -> Sidekick_core.Term.t -> unitTraverse subterms of this term to detect foreign variables and boolean subterms.
Sidekick_smt_solver.Find_foreignFind foreign variables.
This module is a modular discoverer of foreign variables (and boolean terms). It should run after preprocessing of terms.
module type ACTIONS = sig ... endtype actions = (module ACTIONS)type hook = actions -> is_sub:bool -> Sidekick_core.Term.t -> unitval create : unit -> tval traverse_term : t -> actions -> Sidekick_core.Term.t -> unitTraverse subterms of this term to detect foreign variables and boolean subterms.
Find_foreign.ACTIONSval declare_need_th_combination : Sidekick_core.Term.t -> unitDeclare that this term is a foreign variable in some other subterm.
val add_lit_for_bool_term : ?default_pol:bool -> Sidekick_core.Term.t -> unitAdd the (boolean) term to the SAT solver
Find_foreign.ACTIONSval declare_need_th_combination : Sidekick_core.Term.t -> unitDeclare that this term is a foreign variable in some other subterm.
val add_lit_for_bool_term : ?default_pol:bool -> Sidekick_core.Term.t -> unitAdd the (boolean) term to the SAT solver
Sidekick_smt_solver.ModelSMT models.
The solver models are partially evaluated; the frontend might ask for values for terms not explicitly present in them.
type t = {eval : Sidekick_core.Term.t -> Sigs.value option;map : Sigs.value Sidekick_smt_solver__.Sigs.Term.Map.t;}val is_empty : t -> boolval eval : t -> Sidekick_core.Term.t -> Sigs.value optionval pp : Sidekick_smt_solver__.Sigs.Fmt.t -> t -> unitSidekick_smt_solver.ModelSMT models.
The solver models are partially evaluated; the frontend might ask for values for terms not explicitly present in them.
type t = {eval : Sidekick_core.Term.t -> Sigs.value option;map : Sigs.value Sidekick_smt_solver__.Sigs.Term.Map.t;}val is_empty : t -> boolval eval : t -> Sidekick_core.Term.t -> Sigs.value optionval pp : Sidekick_smt_solver__.Sigs.Fmt.t -> t -> unitSidekick_smt_solver.Model_builderModel Builder.
This contains a partial model, in construction. It is accessible to every theory, so they can contribute partial values.
TODO: seen values?
include Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval create : Sidekick_core.Term.store -> tval mem : t -> Sidekick_core.Term.t -> boolval require_eval : t -> Sidekick_core.Term.t -> unitRequire that this term gets a value, and assign it to all terms in the given class.
val add :
+Model_builder (sidekick.Sidekick_smt_solver.Model_builder) Module Sidekick_smt_solver.Model_builder
Model Builder.
This contains a partial model, in construction. It is accessible to every theory, so they can contribute partial values.
TODO: seen values?
include Sidekick_sigs.PRINT with type t := t
val pp : t Sidekick_sigs.printerval create : Sidekick_core.Term.store -> tval mem : t -> Sidekick_core.Term.t -> boolval require_eval : t -> Sidekick_core.Term.t -> unitRequire that this term gets a value, and assign it to all terms in the given class.
val add :
t ->
- ?subs:Sidekick_core.Term.t list ->
+ ?subs:Sidekick_core.Term.t list ->
Sidekick_core.Term.t ->
Sigs.value ->
- unitAdd a value to the model.
val gensym : t -> pre:string -> ty:Sidekick_core.Term.t -> Sidekick_core.Term.tNew fresh constant
val create_cache : int -> eval_cacheval eval : ?cache:eval_cache -> t -> Sidekick_core.Term.t -> Sigs.valueval eval_opt :
- ?cache:eval_cache ->
+ unitAdd a value to the model.
val gensym : t -> pre:string -> ty:Sidekick_core.Term.t -> Sidekick_core.Term.tNew fresh constant
val create_cache : int -> eval_cacheval eval : ?cache:eval_cache -> t -> Sidekick_core.Term.t -> Sigs.valueval eval_opt :
+ ?cache:eval_cache ->
t ->
Sidekick_core.Term.t ->
Sigs.value optionval pop_required : t -> Sidekick_core.Term.t optiongives the next subterm that is required but has no value yet
val to_map :
- ?cache:eval_cache ->
+ ?cache:eval_cache ->
t ->
- Sigs.value Sidekick_smt_solver__.Sigs.Term.Map.t
\ No newline at end of file
+ Sigs.value Sidekick_smt_solver__.Sigs.Term.Map.tSidekick_smt_solver.PreprocessPreprocessor
The preprocessor turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Every literal undergoes preprocessing. Typically some clauses are also added to the solver on the side, and some subterms are found to be foreign variables.
val create :
- ?stat:Sidekick_util.Stat.t ->
- proof:Sidekick_proof.Tracer.t ->
- cc:Sidekick_cc.CC.t ->
- simplify:Sidekick_simplify.t ->
+Preprocess (sidekick.Sidekick_smt_solver.Preprocess) Module Sidekick_smt_solver.Preprocess
Preprocessor
The preprocessor turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Every literal undergoes preprocessing. Typically some clauses are also added to the solver on the side, and some subterms are found to be foreign variables.
val create :
+ ?stat:Sidekick_util.Stat.t ->
+ proof:Sidekick_proof.Tracer.t ->
+ cc:Sidekick_cc.CC.t ->
+ simplify:Sidekick_simplify.t ->
Sidekick_core.Term.store ->
tmodule type PREPROCESS_ACTS = sig ... endActions given to preprocessor hooks
type preprocess_actions = (module PREPROCESS_ACTS)Actions available to the preprocessor
type preprocess_hook =
t ->
- is_sub:bool ->
- recurse:(Sigs.term -> Sigs.term) ->
+ is_sub:bool ->
+ recurse:(Sigs.term -> Sigs.term) ->
preprocess_actions ->
Sigs.term ->
Sigs.term optionGiven a term, preprocess it.
The idea is to add literals and clauses to help define the meaning of the term, if needed. For example for boolean formulas, clauses for their Tseitin encoding can be added, with the formula acting as its own proxy symbol; or a new symbol might be added.
val on_preprocess : t -> preprocess_hook -> unitAdd a hook that will be called when terms are preprocessed
val simplify_and_preproc_lit :
@@ -25,4 +25,4 @@
preprocess_actions ->
Sigs.lit array ->
Sigs.step_id ->
- Sigs.lit array * Sigs.step_idval cc : t -> Sidekick_cc.CC.t
\ No newline at end of file
+ Sigs.lit array * Sigs.step_idval cc : t -> Sidekick_cc.CC.tPreprocess.PREPROCESS_ACTSActions given to preprocessor hooks
val proof_tracer : Sidekick_proof.Tracer.tmk_lit t creates a new literal for a boolean term t.
val add_clause : Sigs.lit list -> Sigs.step_id -> unitpushes a new clause into the SAT solver.
val add_lit : ?default_pol:bool -> Sigs.lit -> unitEnsure the literal will be decided/handled by the SAT solver.
Preprocess.PREPROCESS_ACTSActions given to preprocessor hooks
val proof_tracer : Sidekick_proof.Tracer.tmk_lit t creates a new literal for a boolean term t.
val add_clause : Sigs.lit list -> Sigs.step_id -> unitpushes a new clause into the SAT solver.
val add_lit : ?default_pol:bool -> Sigs.lit -> unitEnsure the literal will be decided/handled by the SAT solver.
Sidekick_smt_solver.RegistryRegistry to extract values
val create_key : unit -> 'a keyCall this statically, typically at program initialization, for each distinct key.
val create : unit -> tSidekick_smt_solver.RegistryRegistry to extract values
val create_key : unit -> 'a keyCall this statically, typically at program initialization, for each distinct key.
val create : unit -> tSidekick_smt_solver.SigsSignature for the main SMT solver types.
Theories and concrete solvers rely on an environment that defines several important types:
In this module we collect signatures defined elsewhere and define the module types for the main SMT solver.
include module type of struct include Sidekick_core endmodule Fmt = Sidekick_core.Fmtmodule Const = Sidekick_core.Constmodule Str_const = Sidekick_core.Str_constmodule Term = Sidekick_core.Termmodule Bool_view = Sidekick_core.Bool_viewmodule CC_view = Sidekick_core.CC_viewmodule Default_cc_view = Sidekick_core.Default_cc_viewmodule Bvar = Sidekick_core.Bvarmodule Lit = Sidekick_core.Litmodule Subst = Sidekick_core.Substmodule Var = Sidekick_core.Varmodule Box = Sidekick_core.Boxmodule Gensym = Sidekick_core.Gensymval const_decoders :
+Sigs (sidekick.Sidekick_smt_solver.Sigs) Module Sidekick_smt_solver.Sigs
Signature for the main SMT solver types.
Theories and concrete solvers rely on an environment that defines several important types:
- sorts
- terms (to represent logic expressions and formulas)
- a congruence closure instance
- a bridge to some SAT solver
In this module we collect signatures defined elsewhere and define the module types for the main SMT solver.
include module type of struct include Sidekick_core end
module Fmt = Sidekick_core.FmtRe-exports from core-logic
module Const = Sidekick_core.Constmodule Str_const = Sidekick_core.Str_constmodule Term = Sidekick_core.Termview
module Bool_view = Sidekick_core.Bool_viewmodule CC_view = Sidekick_core.CC_viewmodule Default_cc_view = Sidekick_core.Default_cc_viewMain modules
module Bvar = Sidekick_core.Bvarmodule Lit = Sidekick_core.Litmodule Subst = Sidekick_core.Substmodule Var = Sidekick_core.Varmodule Box = Sidekick_core.Boxmodule Gensym = Sidekick_core.GensymConst decoders for traces
val const_decoders :
(string
* Sidekick_core_logic.Const.Ops.t
* (Sidekick_core_logic__.Types_.term Sidekick_util.Ser_decode.t ->
Sidekick_core_logic.Const.view Sidekick_util.Ser_decode.t))
- listmodule Simplify = Sidekick_simplifymodule CC = Sidekick_cc.CCmodule E_node = Sidekick_cc.E_nodemodule CC_expl = Sidekick_cc.Explmodule Proof = Sidekick_prooftype term = Term.ttype ty = termtype value = Term.ttype lit = Lit.ttype term_store = Term.storetype step_id = Sidekick_proof.Step.idtype sat_acts = Sidekick_sat.actsConflict obtained during theory combination. It involves equalities merged because of the current model so it's not a "true" conflict and doesn't need to kill the current trail.
module type ARG = sig ... endArgument to pass to the functor Make in order to create a new Msat-based SMT solver.
\ No newline at end of file
+ listmodule Simplify = Sidekick_simplifymodule CC = Sidekick_cc.CCmodule E_node = Sidekick_cc.E_nodemodule CC_expl = Sidekick_cc.Explmodule Proof = Sidekick_prooftype term = Term.ttype ty = termtype value = Term.ttype lit = Lit.ttype term_store = Term.storetype step_id = Sidekick_proof.Step.idtype sat_acts = Sidekick_sat.actsConflict obtained during theory combination. It involves equalities merged because of the current model so it's not a "true" conflict and doesn't need to kill the current trail.
module type ARG = sig ... endArgument to pass to the functor Make in order to create a new Msat-based SMT solver.
Sigs.ARGArgument to pass to the functor Make in order to create a new Msat-based SMT solver.
val view_as_cc : Sidekick_cc.view_as_ccSigs.ARGArgument to pass to the functor Make in order to create a new Msat-based SMT solver.
val view_as_cc : Sidekick_cc.view_as_ccSidekick_smt_solver.SolverMain solver type, user facing.
This is the solver a user of sidekick can see, after instantiating everything. The user can add some theories, clauses, etc. and asks the solver to check satisfiability.
Theory implementors will mostly interact with SOLVER_INTERNAL.
module Check_res = Sidekick_abstract_solver.Check_resmodule Unknown = Sidekick_abstract_solver.Unknownval registry : t -> Registry.tA solver contains a registry so that theories can share data
type theory = Theory.tval mk_theory :
- name:string ->
- create_and_setup:(id:Theory_id.t -> Solver_internal.t -> 'th) ->
- ?push_level:('th -> unit) ->
- ?pop_levels:('th -> int -> unit) ->
+Solver (sidekick.Sidekick_smt_solver.Solver) Module Sidekick_smt_solver.Solver
Main solver type, user facing.
This is the solver a user of sidekick can see, after instantiating everything. The user can add some theories, clauses, etc. and asks the solver to check satisfiability.
Theory implementors will mostly interact with SOLVER_INTERNAL.
module Check_res = Sidekick_abstract_solver.Check_resmodule Unknown = Sidekick_abstract_solver.Unknownval registry : t -> Registry.tA solver contains a registry so that theories can share data
type theory = Theory.tval mk_theory :
+ name:string ->
+ create_and_setup:(id:Theory_id.t -> Solver_internal.t -> 'th) ->
+ ?push_level:('th -> unit) ->
+ ?pop_levels:('th -> int -> unit) ->
unit ->
Theory.tHelper to create a theory.
Main API
val stats : t -> Sidekick_util.Stat.tval tst : t -> Sidekick_core.Term.storeval create :
(module Sigs.ARG) ->
- ?stat:Sidekick_util.Stat.t ->
- ?size:[ `Big | `Tiny | `Small ] ->
- tracer:Tracer.t ->
- theories:Theory.t list ->
+ ?stat:Sidekick_util.Stat.t ->
+ ?size:[ `Big | `Tiny | `Small ] ->
+ tracer:Tracer.t ->
+ theories:Theory.t list ->
Sidekick_core.Term.store ->
unit ->
tCreate a new solver.
It needs a term state and a type state to manipulate terms and types. All terms and types interacting with this solver will need to come from these exact states.
val create_default :
- ?stat:Sidekick_util.Stat.t ->
- ?size:[ `Big | `Tiny | `Small ] ->
- tracer:Tracer.t ->
- theories:Theory.t list ->
+ ?stat:Sidekick_util.Stat.t ->
+ ?size:[ `Big | `Tiny | `Small ] ->
+ tracer:Tracer.t ->
+ theories:Theory.t list ->
Sidekick_core.Term.store ->
unit ->
- tCreate a new solver with the default CC view, and where all boolean subterms are mapped to boolean atoms.
Add a theory to the solver. This should be called before any call to solve or to add_clause and the likes (otherwise the theory will have a partial view of the problem).
mk_lit_t _ ~sign t returns lit', where lit' is preprocess(lit) and lit is an internal representation of ± t.
The proof of |- lit = lit' is directly added to the solver's proof.
val add_clause : t -> Sigs.lit array -> Sidekick_proof.Pterm.delayed -> unitadd_clause solver cs adds a boolean clause to the solver. Subsequent calls to solve will need to satisfy this clause.
val add_clause_l : t -> Sigs.lit list -> Sidekick_proof.Pterm.delayed -> unitAdd a clause to the solver, given as a list.
Helper that turns each term into an atom, before adding disjunction of the resulting atoms to the solver as a clause assertion
Helper that turns the term into an atom, before adding the result to the solver as a unit clause assertion
type value = Sidekick_core.Term.ttype sat_result = Check_res.sat_result = {get_value : Sidekick_core.Term.t -> value option;(*Value for this term
*)iter_classes : (Sidekick_core.Term.t Iter.t * value) Iter.t;(*All equivalence classes in the congruence closure
*)eval_lit : Sidekick_core.Lit.t -> bool option;(*Evaluate literal
*)iter_true_lits : Sidekick_core.Lit.t Iter.t;(*Iterate on literals that are true in the trail
*)
}Satisfiable
type unsat_result = Check_res.unsat_result = {unsat_core : unit -> Sidekick_core.Lit.t Iter.t;(*Unsat core (subset of assumptions), or empty
*)unsat_proof : unit -> Sidekick_proof.Step.id option;(*Proof step for the empty clause
*)
}Unsatisfiable
type res = Check_res.t = | Sat of sat_result| Unsat of unsat_result| Unknown of Unknown.t(*Unknown, obtained after a timeout, memory limit, etc.
*)
Result of solving for the current set of clauses
val solve :
- ?on_exit:(unit -> unit) list ->
- ?on_progress:(unit -> unit) ->
- ?should_stop:(int -> bool) ->
- assumptions:Sigs.lit list ->
+ tCreate a new solver with the default CC view, and where all boolean subterms are mapped to boolean atoms.
Add a theory to the solver. This should be called before any call to solve or to add_clause and the likes (otherwise the theory will have a partial view of the problem).
mk_lit_t _ ~sign t returns lit', where lit' is preprocess(lit) and lit is an internal representation of ± t.
The proof of |- lit = lit' is directly added to the solver's proof.
val add_clause : t -> Sigs.lit array -> Sidekick_proof.Pterm.delayed -> unitadd_clause solver cs adds a boolean clause to the solver. Subsequent calls to solve will need to satisfy this clause.
val add_clause_l : t -> Sigs.lit list -> Sidekick_proof.Pterm.delayed -> unitAdd a clause to the solver, given as a list.
Helper that turns each term into an atom, before adding disjunction of the resulting atoms to the solver as a clause assertion
Helper that turns the term into an atom, before adding the result to the solver as a unit clause assertion
type value = Sidekick_core.Term.ttype sat_result = Check_res.sat_result = {get_value : Sidekick_core.Term.t -> value option;(*Value for this term
*)iter_classes : (Sidekick_core.Term.t Iter.t * value) Iter.t;(*All equivalence classes in the congruence closure
*)eval_lit : Sidekick_core.Lit.t -> bool option;(*Evaluate literal
*)iter_true_lits : Sidekick_core.Lit.t Iter.t;(*Iterate on literals that are true in the trail
*)
}Satisfiable
type unsat_result = Check_res.unsat_result = {unsat_core : unit -> Sidekick_core.Lit.t Iter.t;(*Unsat core (subset of assumptions), or empty
*)unsat_proof : unit -> Sidekick_proof.Step.id option;(*Proof step for the empty clause
*)
}Unsatisfiable
type res = Check_res.t = | Sat of sat_result| Unsat of unsat_result| Unknown of Unknown.t(*Unknown, obtained after a timeout, memory limit, etc.
*)
Result of solving for the current set of clauses
val solve :
+ ?on_exit:(unit -> unit) list ->
+ ?on_progress:(unit -> unit) ->
+ ?should_stop:(int -> bool) ->
+ assumptions:Sigs.lit list ->
t ->
ressolve s checks the satisfiability of the clauses added so far to s.
val as_asolver : t -> Sidekick_abstract_solver.Asolver.tComply to the abstract solver interface
Last result, if any. Some operations will erase this (e.g. assert_term).
Pushes an assumption onto the assumption stack. It will remain there until it's pop'd by pop_assumptions.
val pop_assumptions : t -> int -> unitpop_assumptions solver n removes n assumptions from the stack. It removes the assumptions that were the most recently added via push_assumptions. Note that check_sat_propagations_only can call this if it meets a conflict.
type propagation_result = | PR_sat| PR_conflict of {}| PR_unsat of {unsat_core : unit -> Sigs.lit Iter.t;
}
val check_sat_propagations_only :
- assumptions:Sigs.lit list ->
+ assumptions:Sigs.lit list ->
t ->
- propagation_resultcheck_sat_propagations_only solver uses assumptions (including the assumptions parameter, and atoms previously added via push_assumptions) and boolean+theory propagation to quickly assess satisfiability. It is not complete; calling solve is required to get an accurate result.
val pp_stats : t CCFormat.printerPrint some statistics. What it prints exactly is unspecified.
\ No newline at end of file
+ propagation_resultcheck_sat_propagations_only solver uses assumptions (including the assumptions parameter, and atoms previously added via push_assumptions) and boolean+theory propagation to quickly assess satisfiability. It is not complete; calling solve is required to get an accurate result.
val pp_stats : t CCFormat.printerPrint some statistics. What it prints exactly is unspecified.
Perform_delayed.ASolver_internal.Perform_delayedSolver_internal.Perform_delayedSidekick_smt_solver.Solver_internalA view of the solver from a theory's point of view.
Theories should interact with the solver via this module, to assert new lemmas, propagate literals, access the congruence closure, etc.
type solver = tval tst : t -> Sigs.term_storeval stats : t -> Sidekick_util.Stat.tval registry : t -> Registry.tA solver contains a registry so that theories can share data
val cc : t -> Sidekick_cc.CC.tCongruence closure for this solver
val to_sat_plugin : t -> (module Sidekick_sat.PLUGIN)type simplify_hook = Sidekick_simplify.hookval simplifier : t -> Sidekick_simplify.tval add_simplifier : t -> Sidekick_simplify.hook -> unitAdd a simplifier hook for preprocessing.
val simplify_t : t -> Sigs.term -> (Sigs.term * Sigs.step_id) optionSimplify input term, returns Some u if some simplification occurred.
val simp_t : t -> Sigs.term -> Sigs.term * Sigs.step_id optionsimp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)
These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.
module type PREPROCESS_ACTS = Preprocess.PREPROCESS_ACTStype preprocess_actions = (module PREPROCESS_ACTS)Actions available to the preprocessor
type preprocess_hook =
+Solver_internal (sidekick.Sidekick_smt_solver.Solver_internal) Module Sidekick_smt_solver.Solver_internal
A view of the solver from a theory's point of view.
Theories should interact with the solver via this module, to assert new lemmas, propagate literals, access the congruence closure, etc.
type solver = tval tst : t -> Sigs.term_storeval stats : t -> Sidekick_util.Stat.tval registry : t -> Registry.tA solver contains a registry so that theories can share data
Actions for the theories
Congruence Closure
val cc : t -> Sidekick_cc.CC.tCongruence closure for this solver
Backtracking
Interface to SAT
val to_sat_plugin : t -> (module Sidekick_sat.PLUGIN)Simplifiers
type simplify_hook = Sidekick_simplify.hookval simplifier : t -> Sidekick_simplify.tval add_simplifier : t -> Sidekick_simplify.hook -> unitAdd a simplifier hook for preprocessing.
val simplify_t : t -> Sigs.term -> (Sigs.term * Sigs.step_id) optionSimplify input term, returns Some u if some simplification occurred.
val simp_t : t -> Sigs.term -> Sigs.term * Sigs.step_id optionsimp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)
Preprocessors
These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.
module type PREPROCESS_ACTS = Preprocess.PREPROCESS_ACTStype preprocess_actions = (module PREPROCESS_ACTS)Actions available to the preprocessor
type preprocess_hook =
Preprocess.t ->
- is_sub:bool ->
- recurse:(Sigs.term -> Sigs.term) ->
+ is_sub:bool ->
+ recurse:(Sigs.term -> Sigs.term) ->
preprocess_actions ->
Sigs.term ->
Sigs.term optionGiven a term, preprocess it.
The idea is to add literals and clauses to help define the meaning of the term, if needed. For example for boolean formulas, clauses for their Tseitin encoding can be added, with the formula acting as its own proxy symbol.
val preprocess : t -> Preprocess.tval on_preprocess : t -> preprocess_hook -> unitAdd a hook that will be called when terms are preprocessed
val preprocess_clause :
@@ -22,7 +22,7 @@
t ->
theory_actions ->
Sigs.lit ->
- reason:(unit -> Sigs.lit list * Sidekick_proof.Pterm.delayed) ->
+ reason:(unit -> Sigs.lit list * Sidekick_proof.Pterm.delayed) ->
unitPropagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology
val propagate_l :
t ->
theory_actions ->
@@ -39,7 +39,7 @@
theory_actions ->
Sigs.lit list ->
Sidekick_proof.Pterm.delayed ->
- unitAdd toplevel clause to the SAT solver. This clause will not be backtracked.
Create a literal. This automatically preprocesses the term.
val add_lit : t -> theory_actions -> ?default_pol:bool -> Sigs.lit -> unitAdd the given literal to the SAT solver, so it gets assigned a boolean value.
val add_lit_t : t -> theory_actions -> ?sign:bool -> Sigs.term -> unitAdd the given (signed) bool term to the SAT solver, so it gets assigned a boolean value
val cc_find : t -> Sidekick_cc.E_node.t -> Sidekick_cc.E_node.tFind representative of the node
Are these two terms equal in the congruence closure?
Add toplevel clause to the SAT solver. This clause will not be backtracked.
Create a literal. This automatically preprocesses the term.
val add_lit : t -> theory_actions -> ?default_pol:bool -> Sigs.lit -> unitAdd the given literal to the SAT solver, so it gets assigned a boolean value.
val add_lit_t : t -> theory_actions -> ?sign:bool -> Sigs.term -> unitAdd the given (signed) bool term to the SAT solver, so it gets assigned a boolean value
val cc_find : t -> Sidekick_cc.E_node.t -> Sidekick_cc.E_node.tFind representative of the node
Are these two terms equal in the congruence closure?
val cc_resolve_expl :
t ->
Sidekick_cc.Expl.t ->
Sigs.lit list * Sidekick_proof.Pterm.delayedval cc_add_term : t -> Sigs.term -> Sidekick_cc.E_node.tAdd/retrieve congruence closure node for this term. To be used in theories
Return true if the term is explicitly in the congruence closure. To be used in theories
val on_cc_pre_merge :
@@ -78,19 +78,19 @@
t ->
Model_builder.t ->
Sidekick_core.Term.t ->
- (Sigs.value * Sidekick_core.Term.t list) optionA model-production hook to query values from a theory.
It takes the solver, a class, and returns an optional value for this class (potentially with sub-terms to find values for, if the value is actually a skeleton).
For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value. The theory of arrays might return array.const $v for an array Array A B, where $v will be picked by the theory of the sort B.
If no hook assigns a value to a class, a fake value is created for it.
type model_completion_hook = t -> add:(Sigs.term -> Sigs.value -> unit) -> unitA model production hook, for the theory to add values. The hook is given a add function to add bindings to the model.
val on_model :
- ?ask:model_ask_hook ->
- ?complete:model_completion_hook ->
+ (Sigs.value * Sidekick_core.Term.t list) optionA model-production hook to query values from a theory.
It takes the solver, a class, and returns an optional value for this class (potentially with sub-terms to find values for, if the value is actually a skeleton).
For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value. The theory of arrays might return array.const $v for an array Array A B, where $v will be picked by the theory of the sort B.
If no hook assigns a value to a class, a fake value is created for it.
type model_completion_hook = t -> add:(Sigs.term -> Sigs.value -> unit) -> unitA model production hook, for the theory to add values. The hook is given a add function to add bindings to the model.
val on_model :
+ ?ask:model_ask_hook ->
+ ?complete:model_completion_hook ->
t ->
unitAdd model production/completion hooks.
val on_progress : t -> (unit, unit) Sidekick_util.Event.tval is_complete : t -> boolAre we still in a complete logic fragment?
Delayed actions
module type PERFORM_ACTS = sig ... endmodule Perform_delayed (A : PERFORM_ACTS) : sig ... endval add_theory_state :
- st:'a ->
- push_level:('a -> unit) ->
- pop_levels:('a -> int -> unit) ->
+ st:'a ->
+ push_level:('a -> unit) ->
+ pop_levels:('a -> int -> unit) ->
t ->
unitval create :
(module Sigs.ARG) ->
- stat:Sidekick_util.Stat.t ->
- tracer:Tracer.t ->
+ stat:Sidekick_util.Stat.t ->
+ tracer:Tracer.t ->
Sidekick_core.Term.store ->
unit ->
- t
\ No newline at end of file
+ tSolver_internal.PERFORM_ACTSSidekick_smt_solver.TheorySignatures for theory plugins
module type S = sig ... endA theory
type t = (module S)A theory that can be used for this particular solver.
A theory that can be used for this particular solver, with state of type 'a.
val name : t -> stringName of the theory
val make :
- name:string ->
- create_and_setup:(id:Theory_id.t -> Solver_internal.t -> 'st) ->
- ?push_level:('st0 -> unit) ->
- ?pop_levels:('st1 -> int -> unit) ->
+Theory (sidekick.Sidekick_smt_solver.Theory) Module Sidekick_smt_solver.Theory
Signatures for theory plugins
module type S = sig ... endA theory
type t = (module S)A theory that can be used for this particular solver.
A theory that can be used for this particular solver, with state of type 'a.
val name : t -> stringName of the theory
val make :
+ name:string ->
+ create_and_setup:(id:Theory_id.t -> Solver_internal.t -> 'st) ->
+ ?push_level:('st0 -> unit) ->
+ ?pop_levels:('st1 -> int -> unit) ->
unit ->
- t
\ No newline at end of file
+ tTheory.SA theory
Theories are abstracted over the concrete implementation of the solver, so they can work with any implementation.
Typically a theory should be a functor taking an argument containing a SOLVER_INTERNAL or even a full SOLVER, and some additional views on terms, literals, etc. that are specific to the theory (e.g. to map terms to linear expressions). The theory can then be instantiated on any kind of solver for any term representation that also satisfies the additional theory-specific requirements. Instantiated theories (ie values of type SOLVER.theory) can be added to the solver.
val create_and_setup : id:Theory_id.t -> Solver_internal.t -> tval push_level : t -> unitval pop_levels : t -> int -> unitTheory.SA theory
Theories are abstracted over the concrete implementation of the solver, so they can work with any implementation.
Typically a theory should be a functor taking an argument containing a SOLVER_INTERNAL or even a full SOLVER, and some additional views on terms, literals, etc. that are specific to the theory (e.g. to map terms to linear expressions). The theory can then be instantiated on any kind of solver for any term representation that also satisfies the additional theory-specific requirements. Instantiated theories (ie values of type SOLVER.theory) can be added to the solver.
val create_and_setup : id:Theory_id.t -> Solver_internal.t -> tval push_level : t -> unitval pop_levels : t -> int -> unitSidekick_smt_solver.Theory_idinclude Sidekick_sigs.EQ_ORD_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval create : unit -> stateSidekick_smt_solver.Theory_idinclude Sidekick_sigs.EQ_ORD_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval create : unit -> stateSidekick_smt_solver.Trace_readerRead trace
module Proof = Sidekick_proofmodule Tr = Sidekick_tracetype entry = | Assert of Sidekick_core.Term.t| Assert_clause of {id : int;c : Sidekick_core.Lit.t list;p : Proof.Pterm.t option;}val pp_entry : entry Sidekick_core.Fmt.printerval create :
- ?const_decoders:Sidekick_core.Const.decoders list ->
+Trace_reader (sidekick.Sidekick_smt_solver.Trace_reader) Module Sidekick_smt_solver.Trace_reader
Read trace
module Proof = Sidekick_proofmodule Tr = Sidekick_tracetype entry = | Assert of Sidekick_core.Term.t| Assert_clause of {id : int;c : Sidekick_core.Lit.t list;p : Proof.Pterm.t option;
}
val pp_entry : entry Sidekick_core.Fmt.printerval create :
+ ?const_decoders:Sidekick_core.Const.decoders list ->
Sidekick_core.Term.store ->
Tr.Source.t ->
- tval add_const_decoders : t -> Sidekick_core.Const.decoders -> unitval term_trace_reader : t -> Sidekick_core.Term.Trace_reader.tval decode : t -> tag:string -> Sidekick_util.Ser_value.t -> entry optionval decode_entry : t -> Tr.Entry_id.t -> entry option
\ No newline at end of file
+ tval add_const_decoders : t -> Sidekick_core.Const.decoders -> unitval term_trace_reader : t -> Sidekick_core.Term.Trace_reader.tval decode : t -> tag:string -> Sidekick_util.Ser_value.t -> entry optionval decode_entry : t -> Tr.Entry_id.t -> entry optionTracer.concreteTracer emitting to a sink
inherit Sidekick_core.Term.Tracer.tinherit Sidekick_sat.Tracer.tinherit Sidekick_proof.Tracer.tmethod emit_assert_term : Sidekick_core.Term.t -> Tr.Entry_id.tEmit an assertion
Tracer.concreteTracer emitting to a sink
inherit Sidekick_core.Term.Tracer.tinherit Sidekick_sat.Tracer.tinherit Sidekick_proof.Tracer.tmethod emit_assert_term : Sidekick_core.Term.t -> Tr.Entry_id.tEmit an assertion
Tracer.dummyDummy tracer
inherit Sidekick_core.Term.Tracer.tinherit Sidekick_sat.Tracer.tinherit Sidekick_proof.Tracer.tmethod emit_assert_term : Sidekick_core.Term.t -> Tr.Entry_id.tEmit an assertion
Tracer.dummyDummy tracer
inherit Sidekick_core.Term.Tracer.tinherit Sidekick_sat.Tracer.tinherit Sidekick_proof.Tracer.tmethod emit_assert_term : Sidekick_core.Term.t -> Tr.Entry_id.tEmit an assertion
Tracer.tinherit Sidekick_core.Term.Tracer.tinherit Sidekick_sat.Tracer.tinherit Sidekick_proof.Tracer.tmethod emit_assert_term : Sidekick_core.Term.t -> Tr.Entry_id.tEmit an assertion
Tracer.tinherit Sidekick_core.Term.Tracer.tinherit Sidekick_sat.Tracer.tinherit Sidekick_proof.Tracer.tmethod emit_assert_term : Sidekick_core.Term.t -> Tr.Entry_id.tEmit an assertion
Sidekick_smt_solver.TracerTracer for SMT solvers.
The tracer is used to track clauses and terms used or deduced during proof search.
module Tr = Sidekick_tracemodule Proof = Sidekick_proofclass type t = object ... endval dummy : tval assert_term : t -> Sidekick_core.Term.t -> Tr.Entry_id.tval assert_term' : t -> Sidekick_core.Term.t -> unitval assert_clause :
+Tracer (sidekick.Sidekick_smt_solver.Tracer) Module Sidekick_smt_solver.Tracer
Tracer for SMT solvers.
The tracer is used to track clauses and terms used or deduced during proof search.
module Tr = Sidekick_tracemodule Proof = Sidekick_proofclass type t = object ... endval dummy : tval assert_term : t -> Sidekick_core.Term.t -> Tr.Entry_id.tval assert_term' : t -> Sidekick_core.Term.t -> unitval assert_clause :
t ->
- id:int ->
+ id:int ->
Sidekick_core.Lit.t Iter.t ->
Proof.Step.id ->
Tr.Entry_id.tval assert_clause' :
t ->
- id:int ->
+ id:int ->
Sidekick_core.Lit.t Iter.t ->
Proof.Step.id ->
- unitval delete_clause : t -> id:int -> Sidekick_core.Lit.t Iter.t -> unitval unsat_clause : t -> id:int -> Tr.Entry_id.tval unsat_clause' : t -> id:int -> unitval encode_lit : t -> Sidekick_core.Lit.t -> Sidekick_util.Ser_value.t
\ No newline at end of file
+ unitval delete_clause : t -> id:int -> Sidekick_core.Lit.t Iter.t -> unitval unsat_clause : t -> id:int -> Tr.Entry_id.tval unsat_clause' : t -> id:int -> unitval encode_lit : t -> Sidekick_core.Lit.t -> Sidekick_util.Ser_value.tSidekick_smt_solverCore of the SMT solver using Sidekick_sat
Sidekick_sat (in src/sat/) is a modular SAT solver in pure OCaml.
This builds a SMT solver on top of it.
module Sigs : sig ... endSignature for the main SMT solver types.
module Model_builder : sig ... endModel Builder.
module Registry : sig ... endRegistry to extract values
module Solver_internal : sig ... endA view of the solver from a theory's point of view.
module Solver : sig ... endMain solver type, user facing.
module Model : sig ... endSMT models.
module Theory : sig ... endSignatures for theory plugins
module Theory_id : sig ... endmodule Preprocess : sig ... endPreprocessor
module Find_foreign : sig ... endFind foreign variables.
module Tracer : sig ... endTracer for SMT solvers.
module Trace_reader : sig ... endRead trace
type theory = Theory.ttype solver = Solver.tSidekick_smt_solverCore of the SMT solver using Sidekick_sat
Sidekick_sat (in src/sat/) is a modular SAT solver in pure OCaml.
This builds a SMT solver on top of it.
module Sigs : sig ... endSignature for the main SMT solver types.
module Model_builder : sig ... endModel Builder.
module Registry : sig ... endRegistry to extract values
module Solver_internal : sig ... endA view of the solver from a theory's point of view.
module Solver : sig ... endMain solver type, user facing.
module Model : sig ... endSMT models.
module Theory : sig ... endSignatures for theory plugins
module Theory_id : sig ... endmodule Preprocess : sig ... endPreprocessor
module Find_foreign : sig ... endFind foreign variables.
module Tracer : sig ... endTracer for SMT solvers.
module Trace_reader : sig ... endRead trace
type theory = Theory.ttype solver = Solver.tSidekick_tefA nice profiling format based on json, useful for visualizing what goes on. It provides a backend for Sidekick_util.Profile so that profiling probes will emit TEF events.
Profiling is enabled if setup is called, and if the environment variable "TRACE" is set to "1" or "true". The trace is emitted in the file "trace.json.gz" in the directory where the solver is launched; you can open it in chrome/chromium at "chrome://tracing".
Tracy can import (uncompressed) trace files with a nice native trace explorer.
Sidekick_th_bool_dyn.Intfmodule Proof = Sidekick_proofmodule SMT = Sidekick_smt_solvermodule Simplify = Sidekick_simplifytype term = Sidekick_core.Term.ttype ty = Sidekick_core.Term.ttype 'a bool_view = 'a Sidekick_core.Bool_view.t = Boolean-oriented view of terms
module type ARG = sig ... endArgument to the theory
Sidekick_th_bool_dyn.Intfmodule Proof = Sidekick_proofmodule SMT = Sidekick_smt_solvermodule Simplify = Sidekick_simplifytype term = Sidekick_core.Term.ttype ty = Sidekick_core.Term.ttype 'a bool_view = 'a Sidekick_core.Bool_view.t = Boolean-oriented view of terms
module type ARG = sig ... endArgument to the theory
Intf.ARGArgument to the theory
val mk_bool : Sidekick_core.Term.store -> term bool_view -> termMake a term from the given boolean view.
Intf.ARGArgument to the theory
val mk_bool : Sidekick_core.Term.store -> term bool_view -> termMake a term from the given boolean view.
Sidekick_th_bool_dyn.Proof_rulesmodule Proof = Sidekick_prooftype term = Sidekick_core.Term.ttype lit = Sidekick_core.Lit.tval lemma_bool_tauto : lit list -> Proof.Pterm.tBoolean tautology lemma (clause)
val lemma_bool_c : string -> term list -> Proof.Pterm.tBasic boolean logic lemma for a clause |- c. proof_bool_c b name cs is the Proof.Pterm.t designated by name.
val lemma_bool_equiv : term -> term -> Proof.Pterm.tBoolean tautology lemma (equivalence)
val lemma_ite_true : ite:term -> Proof.Pterm.tlemma a ==> ite a b c = b
val lemma_ite_false : ite:term -> Proof.Pterm.tlemma ¬a ==> ite a b c = c
Sidekick_th_bool_dyn.Proof_rulesmodule Proof = Sidekick_prooftype term = Sidekick_core.Term.ttype lit = Sidekick_core.Lit.tval lemma_bool_tauto : lit list -> Proof.Pterm.tBoolean tautology lemma (clause)
val lemma_bool_c : string -> term list -> Proof.Pterm.tBasic boolean logic lemma for a clause |- c. proof_bool_c b name cs is the Proof.Pterm.t designated by name.
val lemma_bool_equiv : term -> term -> Proof.Pterm.tBoolean tautology lemma (equivalence)
val lemma_ite_true : ite:term -> Proof.Pterm.tlemma a ==> ite a b c = b
val lemma_ite_false : ite:term -> Proof.Pterm.tlemma ¬a ==> ite a b c = c
Sidekick_th_bool_dynTheory of boolean formulas.
This handles formulas containing "and", "or", "=>", "if-then-else", etc.
The difference with Sidekick_th_bool_static is that here, clausification of a formula F is done only when F is on the trail.
module Intf : sig ... endmodule Proof_rules : sig ... endmodule type ARG = Intf.ARGval theory : (module ARG) -> Intf.SMT.Theory.tSidekick_th_bool_dynTheory of boolean formulas.
This handles formulas containing "and", "or", "=>", "if-then-else", etc.
The difference with Sidekick_th_bool_static is that here, clausification of a formula F is done only when F is on the trail.
module Intf : sig ... endmodule Proof_rules : sig ... endmodule type ARG = Intf.ARGval theory : (module ARG) -> Intf.SMT.Theory.tSidekick_th_bool_static.Intfmodule Proof = Sidekick_proofmodule SMT = Sidekick_smt_solvermodule Simplify = Sidekick_simplifytype term = Sidekick_core.Term.ttype ty = Sidekick_core.Term.ttype 'a bool_view = 'a Sidekick_core.Bool_view.t = Boolean-oriented view of terms
module type ARG = sig ... endArgument to the theory
Sidekick_th_bool_static.Intfmodule Proof = Sidekick_proofmodule SMT = Sidekick_smt_solvermodule Simplify = Sidekick_simplifytype term = Sidekick_core.Term.ttype ty = Sidekick_core.Term.ttype 'a bool_view = 'a Sidekick_core.Bool_view.t = Boolean-oriented view of terms
module type ARG = sig ... endArgument to the theory
Intf.ARGArgument to the theory
val mk_bool : Sidekick_core.Term.store -> term bool_view -> termMake a term from the given boolean view.
Intf.ARGArgument to the theory
val mk_bool : Sidekick_core.Term.store -> term bool_view -> termMake a term from the given boolean view.
Sidekick_th_bool_static.Proof_rulesmodule Proof = Sidekick_prooftype term = Sidekick_core.Term.ttype lit = Sidekick_core.Lit.tval lemma_bool_tauto : lit list -> Proof.Pterm.tBoolean tautology lemma (clause)
val lemma_bool_c : string -> term list -> Proof.Pterm.tBasic boolean logic lemma for a clause |- c. proof_bool_c b name cs is the Proof_term.t designated by name.
val lemma_bool_equiv : term -> term -> Proof.Pterm.tBoolean tautology lemma (equivalence)
val lemma_ite_true : ite:term -> Proof.Pterm.tlemma a ==> ite a b c = b
val lemma_ite_false : ite:term -> Proof.Pterm.tlemma ¬a ==> ite a b c = c
Sidekick_th_bool_static.Proof_rulesmodule Proof = Sidekick_prooftype term = Sidekick_core.Term.ttype lit = Sidekick_core.Lit.tval lemma_bool_tauto : lit list -> Proof.Pterm.tBoolean tautology lemma (clause)
val lemma_bool_c : string -> term list -> Proof.Pterm.tBasic boolean logic lemma for a clause |- c. proof_bool_c b name cs is the Proof_term.t designated by name.
val lemma_bool_equiv : term -> term -> Proof.Pterm.tBoolean tautology lemma (equivalence)
val lemma_ite_true : ite:term -> Proof.Pterm.tlemma a ==> ite a b c = b
val lemma_ite_false : ite:term -> Proof.Pterm.tlemma ¬a ==> ite a b c = c
Sidekick_th_bool_staticTheory of boolean formulas.
This handles formulas containing "and", "or", "=>", "if-then-else", etc.
module Intf : sig ... endmodule Proof_rules : sig ... endmodule type ARG = Intf.ARGval theory : (module ARG) -> Intf.SMT.Theory.tSidekick_th_bool_staticTheory of boolean formulas.
This handles formulas containing "and", "or", "=>", "if-then-else", etc.
module Intf : sig ... endmodule Proof_rules : sig ... endmodule type ARG = Intf.ARGval theory : (module ARG) -> Intf.SMT.Theory.tSidekick_th_cstorTheory for constructors
Sidekick_th_cstorTheory for constructors
Sidekick_th_cstor.ARGval view_as_cstor :
+ARG (sidekick.Sidekick_th_cstor.ARG) Module type Sidekick_th_cstor.ARG
val view_as_cstor :
Sidekick_core.Term.t ->
- (Sidekick_core.Const.t, Sidekick_core.Term.t) cstor_viewval lemma_cstor : Sidekick_core.Lit.t list -> Sidekick_proof.Pterm.t
\ No newline at end of file
+ (Sidekick_core.Const.t, Sidekick_core.Term.t) cstor_viewval lemma_cstor : Sidekick_core.Lit.t list -> Sidekick_proof.Pterm.tSidekick_th_dataTheory for datatypes.
module SMT = Sidekick_smt_solvertype ty = Sidekick_core.Term.tDatatype-oriented view of terms.
'c is the representation of constructors't is the representation of termsView of types in a way that is directly useful for the theory of datatypes
module type DATA_TY = sig ... endAn abtract representation of a datatype
module type ARG = sig ... endval make : (module ARG) -> SMT.theorySidekick_th_dataTheory for datatypes.
module SMT = Sidekick_smt_solvertype ty = Sidekick_core.Term.tDatatype-oriented view of terms.
'c is the representation of constructors't is the representation of termsView of types in a way that is directly useful for the theory of datatypes
module type DATA_TY = sig ... endAn abtract representation of a datatype
module type ARG = sig ... endval make : (module ARG) -> SMT.theoryARG.CstorConstructor symbols.
A constructor is an injective symbol, part of a datatype (or "sum type"). For example, in type option a = Some a | None, the constructors are Some and None.
include Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerARG.CstorConstructor symbols.
A constructor is an injective symbol, part of a datatype (or "sum type"). For example, in type option a = Some a | None, the constructors are Some and None.
include Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerSidekick_th_data.ARGmodule Cstor : sig ... endConstructor symbols.
val as_datatype : ty -> (Cstor.t list, ty) data_ty_viewTry to view type as a datatype (with its constructors)
val view_as_data :
+ARG (sidekick.Sidekick_th_data.ARG) Module type Sidekick_th_data.ARG
module Cstor : sig ... endConstructor symbols.
val as_datatype : ty -> (Cstor.t list, ty) data_ty_viewTry to view type as a datatype (with its constructors)
val view_as_data :
Sidekick_core.Term.t ->
(Cstor.t, Sidekick_core.Term.t) data_viewTry to view Term.t as a datatype Term.t
val mk_cstor :
Sidekick_core.Term.store ->
@@ -18,4 +18,4 @@
Sidekick_core.Term.store ->
Sidekick_core.Term.t ->
Sidekick_core.Term.t ->
- Sidekick_core.Term.tMake a Term.t equality
val ty_is_finite : ty -> boolIs the given type known to be finite? For example a finite datatype (an "enum" in C parlance), or Bool, or Array Bool Bool.
val ty_set_is_finite : ty -> bool -> unitModify the "finite" field (see ty_is_finite)
\ No newline at end of file
+ Sidekick_core.Term.tMake a Term.t equality
val ty_is_finite : ty -> boolIs the given type known to be finite? For example a finite datatype (an "enum" in C parlance), or Bool, or Array Bool Bool.
val ty_set_is_finite : ty -> bool -> unitModify the "finite" field (see ty_is_finite)
Sidekick_th_data.DATA_TYAn abtract representation of a datatype
Sidekick_th_data.DATA_TYAn abtract representation of a datatype
Sidekick_th_lra.Intfmodule SMT = Sidekick_smt_solvermodule Proof = Sidekick_proofmodule Predicate = Sidekick_simplex.Predicatemodule Linear_expr = Sidekick_simplex.Linear_exprmodule Linear_expr_intf = Sidekick_simplex.Linear_expr_intfmodule type INT = Sidekick_arith.INTmodule type RATIONAL = Sidekick_arith.RATIONALmodule S_op = Sidekick_simplex.Optype term = Sidekick_core.Term.ttype ty = Sidekick_core.Term.tmodule type ARG = sig ... endSidekick_th_lra.Intfmodule SMT = Sidekick_smt_solvermodule Proof = Sidekick_proofmodule Predicate = Sidekick_simplex.Predicatemodule Linear_expr = Sidekick_simplex.Linear_exprmodule Linear_expr_intf = Sidekick_simplex.Linear_expr_intfmodule type INT = Sidekick_arith.INTmodule type RATIONAL = Sidekick_arith.RATIONALmodule S_op = Sidekick_simplex.Optype term = Sidekick_core.Term.ttype ty = Sidekick_core.Term.tmodule type ARG = sig ... endARG.Qinclude Sidekick_arith.NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printertype bigint = Z.tval infinity : t+infinity
val minus_infinity : tval is_real : t -> boolA proper real, not nan/infinity
val is_int : t -> boolIs this a proper integer?
val pp_approx : int -> Stdlib.Format.formatter -> t -> unitPretty print rational with given amount of precision (for example as a floating point number)
ARG.Qinclude Sidekick_arith.NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printertype bigint = Z.tval infinity : t+infinity
val minus_infinity : tval is_real : t -> boolA proper real, not nan/infinity
val is_int : t -> boolIs this a proper integer?
val pp_approx : int -> Stdlib.Format.formatter -> t -> unitPretty print rational with given amount of precision (for example as a floating point number)
ARG.Zinclude Sidekick_arith.NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerARG.Zinclude Sidekick_arith.NUMval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerIntf.ARGval view_as_lra : Sidekick_core.Term.t -> (Q.t, Sidekick_core.Term.t) lra_viewProject the Term.t into the theory view
val mk_lra :
+ARG (sidekick.Sidekick_th_lra.Intf.ARG) Module type Intf.ARG
val view_as_lra : Sidekick_core.Term.t -> (Q.t, Sidekick_core.Term.t) lra_viewProject the Term.t into the theory view
val mk_lra :
Sidekick_core.Term.store ->
(Q.t, Sidekick_core.Term.t) lra_view ->
- Sidekick_core.Term.tMake a Term.t from the given theory view
val ty_real : Sidekick_core.Term.store -> tyBuild the type Q
val has_ty_real : Sidekick_core.Term.t -> boolDoes this term have the type Real
\ No newline at end of file
+ Sidekick_core.Term.tMake a Term.t from the given theory view
val ty_real : Sidekick_core.Term.store -> tyBuild the type Q
val has_ty_real : Sidekick_core.Term.t -> boolDoes this term have the type Real
Sidekick_th_lraLinear Rational Arithmetic
module Intf : sig ... endmodule Predicate = Intf.Predicatemodule SMT = Sidekick_smt_solvermodule type INT = Intf.INTmodule type RATIONAL = Intf.RATIONALmodule S_op = Sidekick_simplex.Optype term = Sidekick_core.Term.ttype ty = Sidekick_core.Term.ttype ('num, 'a) lra_view = ('num, 'a) Intf.lra_view = module type ARG = Intf.ARGval theory : (module ARG) -> SMT.Theory.tSidekick_th_lraLinear Rational Arithmetic
module Intf : sig ... endmodule Predicate = Intf.Predicatemodule SMT = Sidekick_smt_solvermodule type INT = Intf.INTmodule type RATIONAL = Intf.RATIONALmodule S_op = Sidekick_simplex.Optype term = Sidekick_core.Term.ttype ty = Sidekick_core.Term.ttype ('num, 'a) lra_view = ('num, 'a) Intf.lra_view = module type ARG = Intf.ARGval theory : (module ARG) -> SMT.Theory.tSidekick_th_ty_unintype ty = Sidekick_core.Term.tmodule type ARG = sig ... endval theory : (module ARG) -> Sidekick_smt_solver.Theory.tTheory of uninterpreted types
Sidekick_th_ty_unintype ty = Sidekick_core.Term.tmodule type ARG = sig ... endval theory : (module ARG) -> Sidekick_smt_solver.Theory.tTheory of uninterpreted types
Sidekick_th_ty_unin.ARGval ty_is_unin : ty -> boolSidekick_th_ty_unin.ARGval ty_is_unin : ty -> boolSidekick_trace.Entry_idEntry in the sink.
This integer tag represent a single entry in a trace, for example a line if we serialized using line-separate json values. In general each entry has its own unique ID that is monotonically increasing with time.
val dummy : tDummy id
Sidekick_trace.Entry_idEntry in the sink.
This integer tag represent a single entry in a trace, for example a line if we serialized using line-separate json values. In general each entry has its own unique ID that is monotonically increasing with time.
val dummy : tDummy id
Sidekick_trace.SinkAn IO sink for serialization/tracing
A trace is emitted on the fly into a sink. The sink collects or writes entries that are emitted into it.
module type S = sig ... endtype t = (module S)Trace sink
val emit : t -> tag:tag -> Sidekick_util.Ser_value.t -> Entry_id.tval emit' : t -> tag:tag -> Sidekick_util.Ser_value.t -> unitval null : tSink that writes nowhere, just eats bytes.
val of_out_channel_using_bencode : Stdlib.out_channel -> tA sink that emits entries using Bencode into the given channel
val of_buffer_using_bencode : Stdlib.Buffer.t -> tEmit entries into the given buffer, in Bencode.
Sidekick_trace.SinkAn IO sink for serialization/tracing
A trace is emitted on the fly into a sink. The sink collects or writes entries that are emitted into it.
module type S = sig ... endtype t = (module S)Trace sink
val emit : t -> tag:tag -> Sidekick_util.Ser_value.t -> Entry_id.tval emit' : t -> tag:tag -> Sidekick_util.Ser_value.t -> unitval null : tSink that writes nowhere, just eats bytes.
val of_out_channel_using_bencode : Stdlib.out_channel -> tA sink that emits entries using Bencode into the given channel
val of_buffer_using_bencode : Stdlib.Buffer.t -> tEmit entries into the given buffer, in Bencode.
Sink.Sval emit : tag:tag -> Sidekick_util.Ser_value.t -> Entry_id.tSink.Sval emit : tag:tag -> Sidekick_util.Ser_value.t -> Entry_id.tSidekick_trace.SourceSource to read a trace.
A source is an IO input source that allows the read of individual entries of the trace, by providing their entry ID. It also allows to iterate on entries in chronological order.
module type S = sig ... endtype t = (module S)val get_entry : t -> Entry_id.t -> (tag * Sidekick_util.Ser_value.t) optionval get_entry_exn : t -> Entry_id.t -> tag * Sidekick_util.Ser_value.tval iter_all :
+Source (sidekick.Sidekick_trace.Source) Module Sidekick_trace.Source
Source to read a trace.
A source is an IO input source that allows the read of individual entries of the trace, by providing their entry ID. It also allows to iterate on entries in chronological order.
module type S = sig ... endtype t = (module S)val get_entry : t -> Entry_id.t -> (tag * Sidekick_util.Ser_value.t) optionval get_entry_exn : t -> Entry_id.t -> tag * Sidekick_util.Ser_value.tval iter_all :
t ->
- (Entry_id.t -> tag:tag -> Sidekick_util.Ser_value.t -> unit) ->
- unitval of_string_using_bencode : string -> tDecode string, where entries are offsets
\ No newline at end of file
+ (Entry_id.t -> tag:tag -> Sidekick_util.Ser_value.t -> unit) ->
+ unitval of_string_using_bencode : string -> tDecode string, where entries are offsets
Source.Sval get_entry : Entry_id.t -> tag * Sidekick_util.Ser_value.tval iter_all :
- (Entry_id.t -> tag:tag -> Sidekick_util.Ser_value.t -> unit) ->
- unitIterate on all entries
Source.Sval get_entry : Entry_id.t -> tag * Sidekick_util.Ser_value.tval iter_all :
+ (Entry_id.t -> tag:tag -> Sidekick_util.Ser_value.t -> unit) ->
+ unitIterate on all entries
Sidekick_traceTracing.
Sidekick should be able to emit traces of some or all of the events happening inside its components (SAT solver, SMT solver, theories, etc.).
Traces can be written to disk and read back later from another process.
The two initial intended use cases are:
false)module Sink : sig ... endAn IO sink for serialization/tracing
module Source : sig ... endSource to read a trace.
module Entry_id : sig ... endEntry in the sink.
type entry_id = Entry_id.tSidekick_traceTracing.
Sidekick should be able to emit traces of some or all of the events happening inside its components (SAT solver, SMT solver, theories, etc.).
Traces can be written to disk and read back later from another process.
The two initial intended use cases are:
false)module Sink : sig ... endAn IO sink for serialization/tracing
module Source : sig ... endSource to read a trace.
module Entry_id : sig ... endEntry in the sink.
type entry_id = Entry_id.tSidekick_util.Backtrack_stackval create : unit -> 'a tval push : 'a t -> 'a -> unitPush an element onto the stack
val push_if_nonzero_level : 'a t -> 'a -> unitPush an element onto the stack if level > 0
include Sidekick_sigs.BACKTRACKABLE1_CB with type 'a t := 'a tinclude Sidekick_sigs.BACKTRACKABLE1 with type 'a t := 'a tval n_levels : _ t -> intNumber of levels
val push_level : _ t -> unitPush a backtracking point
val pop_levels : 'a t -> int -> f:('a -> unit) -> unitpop_levels st n ~f removes n levels, calling f on every removed item
val iter : f:('a -> unit) -> 'a t -> unitSidekick_util.Backtrack_stackval create : unit -> 'a tval push : 'a t -> 'a -> unitPush an element onto the stack
val push_if_nonzero_level : 'a t -> 'a -> unitPush an element onto the stack if level > 0
include Sidekick_sigs.BACKTRACKABLE1_CB with type 'a t := 'a tinclude Sidekick_sigs.BACKTRACKABLE1 with type 'a t := 'a tval n_levels : _ t -> intNumber of levels
val push_level : _ t -> unitPush a backtracking point
val pop_levels : 'a t -> int -> f:('a -> unit) -> unitpop_levels st n ~f removes n levels, calling f on every removed item
val iter : f:('a -> unit) -> 'a t -> unitSidekick_util.Backtrackable_refval create : ?copy:('a -> 'a) -> 'a -> 'a tCreate a backtrackable reference holding the given value initially.
val set : 'a t -> 'a -> unitSet the reference's current content
val get : 'a t -> 'aGet the reference's current content
val update : 'a t -> ('a -> 'a) -> unitUpdate the reference's current content
Sidekick_util.Backtrackable_refval create : ?copy:('a -> 'a) -> 'a -> 'a tCreate a backtrackable reference holding the given value initially.
val set : 'a t -> 'a -> unitSet the reference's current content
val get : 'a t -> 'aGet the reference's current content
val update : 'a t -> ('a -> 'a) -> unitUpdate the reference's current content
Make.AMake.ABacktrackable_tbl.MakeBacktrackable_tbl.MakeSidekick_util.Backtrackable_tblSidekick_util.Backtrackable_tblBacktrackable_tbl.ARGBacktrackable_tbl.ARGBacktrackable_tbl.SBacktrackable_tbl.SSidekick_util.BagA data structure where we can have duplicate elements, optimized for fast concatenation and size.
val empty : 'a tval is_empty : _ t -> boolval return : 'a -> 'a tval of_iter : 'a Iter.t -> 'a tval to_iter : 'a t -> 'a Iter.tval to_list : 'a t -> 'a listval fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'aval iter : ('a -> unit) -> 'a t -> unitSidekick_util.BagA data structure where we can have duplicate elements, optimized for fast concatenation and size.
val empty : 'a tval is_empty : _ t -> boolval return : 'a -> 'a tval of_iter : 'a Iter.t -> 'a tval to_iter : 'a t -> 'a Iter.tval to_list : 'a t -> 'a listval fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'aval iter : ('a -> unit) -> 'a t -> unitSidekick_util.BitvecBitvector.
This provides compact storage with O(1) access to a range of bits, like bool Vec.t but packed better.
val create : unit -> tval ensure_size : t -> int -> unitensure_size bv i ensures that i is a valid index in bv
val get : t -> int -> boolval set : t -> int -> bool -> unitval clear_all : t -> unitSidekick_util.BitvecBitvector.
This provides compact storage with O(1) access to a range of bits, like bool Vec.t but packed better.
val create : unit -> tval ensure_size : t -> int -> unitensure_size bv i ensures that i is a valid index in bv
val get : t -> int -> boolval set : t -> int -> bool -> unitval clear_all : t -> unitChunk_stack.BufA hand made buffer
Chunk_stack.BufA hand made buffer
Chunk_stack.Readerval next : t -> yield:(bytes -> int -> int -> 'a) -> finish:(unit -> 'a) -> 'aRead next chunk, call yield with a slice of bytes, otherwise call finish().
val next_string : t -> string optionRead next chunk as a string
val empty : tval from_channel_backward : ?close_at_end:bool -> Stdlib.in_channel -> tRead channel from the end, assuming that is possible.
val with_file_backward : string -> (t -> 'a) -> 'aread_file_backward filename f calls f with an iterator over chunks of the file, read from the end.
Each chunk is assumed to be followed by its length as an int32 LE.
Chunk_stack.Readerval next : t -> yield:(bytes -> int -> int -> 'a) -> finish:(unit -> 'a) -> 'aRead next chunk, call yield with a slice of bytes, otherwise call finish().
val next_string : t -> string optionRead next chunk as a string
val empty : tval from_channel_backward : ?close_at_end:bool -> Stdlib.in_channel -> tRead channel from the end, assuming that is possible.
val with_file_backward : string -> (t -> 'a) -> 'aread_file_backward filename f calls f with an iterator over chunks of the file, read from the end.
Each chunk is assumed to be followed by its length as an int32 LE.
Chunk_stack.WriterCreate a stack of chunks.
val dummy : tval into_channel : Stdlib.out_channel -> tval add_bytes : t -> bytes -> int -> int -> unitval add_string : t -> string -> unitval add_buffer : t -> Stdlib.Buffer.t -> unitChunk_stack.WriterCreate a stack of chunks.
val dummy : tval into_channel : Stdlib.out_channel -> tval add_bytes : t -> bytes -> int -> int -> unitval add_string : t -> string -> unitval add_buffer : t -> Stdlib.Buffer.t -> unitSidekick_util.Chunk_stackManage a list of chunks.
A chunk is used for serializing proof traces, possibly on disk. This way we do not have to keep the whole proof in memory. Each chunk is typically one step of the proof search.
We produce chunks in forward order (chronological order of their discovery), but once we find a proof of "false", we work our way backward to find chunks transitively needed by this proof of false. Once we obtain this subset of the chunks (as a graph in memory) we can emit a proper proof with no redundant information.
module Buf : sig ... endA hand made buffer
module Writer : sig ... endCreate a stack of chunks.
module Reader : sig ... endSidekick_util.Chunk_stackManage a list of chunks.
A chunk is used for serializing proof traces, possibly on disk. This way we do not have to keep the whole proof in memory. Each chunk is typically one step of the proof search.
We produce chunks in forward order (chronological order of their discovery), but once we find a proof of "false", we work our way backward to find chunks transitively needed by this proof of false. Once we obtain this subset of the chunks (as a graph in memory) we can emit a proper proof with no redundant information.
module Buf : sig ... endA hand made buffer
module Writer : sig ... endCreate a stack of chunks.
module Reader : sig ... endSidekick_util.Errorval try_ : (unit -> 'a) -> 'a resultSidekick_util.Errorval try_ : (unit -> 'a) -> 'a resultEvent.Emitterval create : unit -> ('a, 'b) tval emit : ('a, unit) t -> 'a -> unitval emit_collect : ('a, 'b) t -> 'a -> 'b listval emit_iter : ('a, 'b) t -> 'a -> f:('b -> unit) -> unitEvent.Emitterval create : unit -> ('a, 'b) tval emit : ('a, unit) t -> 'a -> unitval emit_collect : ('a, 'b) t -> 'a -> 'b listval emit_iter : ('a, 'b) t -> 'a -> f:('b -> unit) -> unitSidekick_util.EventEvent pattern.
This provides a basic observer pattern, where events are emitted from some source (with an attached value), and callbacks that were registered will receive this value.
module Emitter : sig ... endval on : ('a, 'b) t -> f:('a -> 'b) -> unitval emit : ('a, unit) Emitter.t -> 'a -> unitval emit_collect : ('a, 'b) Emitter.t -> 'a -> 'b listval emit_iter : ('a, 'b) Emitter.t -> 'a -> f:('b -> unit) -> unitSidekick_util.EventEvent pattern.
This provides a basic observer pattern, where events are emitted from some source (with an attached value), and callbacks that were registered will receive this value.
module Emitter : sig ... endval on : ('a, 'b) t -> f:('a -> 'b) -> unitval emit : ('a, unit) Emitter.t -> 'a -> unitval emit_collect : ('a, 'b) Emitter.t -> 'a -> 'b listval emit_iter : ('a, 'b) Emitter.t -> 'a -> f:('b -> unit) -> unitSidekick_util.Hashval bool : bool tval int : int tval string : string tval combine : 'a t -> int -> 'a -> intval poly : 'a tthe regular polymorphic hash function
Sidekick_util.Hashval bool : bool tval int : int tval string : string tval combine : 'a t -> int -> 'a -> intval poly : 'a tthe regular polymorphic hash function
Int_id.MakeGenerate a new type for integer identifiers
Int_id.MakeGenerate a new type for integer identifiers
Sidekick_util.Int_idInteger-based identifiers.
Sidekick_util.Int_idInteger-based identifiers.
Int_id.Sinclude Sidekick_sigs.EQ_ORD_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval to_int : t -> intval of_int_unsafe : int -> tInt_id.Sinclude Sidekick_sigs.EQ_ORD_HASH_PRINT with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval to_int : t -> intval of_int_unsafe : int -> tSidekick_util.LogLogging function, for debugging
val debugf :
+Log (sidekick.Sidekick_util.Log) Module Sidekick_util.Log
Logging function, for debugging
val debugf :
int ->
((('a, Stdlib.Format.formatter, unit, unit) Stdlib.format4 -> 'a) -> unit) ->
- unitEmit a debug message at the given level. If the level is lower than get_debug (), the message will indeed be emitted
Simpler version of debug, without formatting
\ No newline at end of file
+ unitEmit a debug message at the given level. If the level is lower than get_debug (), the message will indeed be emitted
Simpler version of debug, without formatting
Profile.Controlval setup : backend option -> unitSidekick_util.ProfileProfiling probes.
This basic library can produce Catapult traces (a json file) that can be read at http://ui.perfetto.dev.
val null_probe : probeval begin_ : string -> probeval exit : ?args:(string * string) list -> probe -> unitval with2 :
- ?args:(string * string) list ->
+Profile (sidekick.Sidekick_util.Profile) Module Sidekick_util.Profile
include module type of struct include Trace_core end
type explicit_span = Trace_core__Types.explicit_span = {span : span;mutable meta : Trace_core__.Meta_map.t;
}val with_span :
+ ?__FUNCTION__:string ->
+ __FILE__:string ->
+ __LINE__:int ->
+ ?data:(unit -> (string * user_data) list) ->
string ->
- ('a -> 'b -> 'c) ->
- 'a ->
- 'b ->
- 'cmodule type BACKEND = sig ... endtype backend = (module BACKEND)module Control : sig ... end
\ No newline at end of file
+ (span -> 'a) ->
+ 'aval enter_manual_sub_span :
+ parent:explicit_span ->
+ ?flavor:[ `Async | `Sync ] ->
+ ?__FUNCTION__:string ->
+ __FILE__:string ->
+ __LINE__:int ->
+ ?data:(unit -> (string * user_data) list) ->
+ string ->
+ explicit_spanval enter_manual_toplevel_span :
+ ?flavor:[ `Async | `Sync ] ->
+ ?__FUNCTION__:string ->
+ __FILE__:string ->
+ __LINE__:int ->
+ ?data:(unit -> (string * user_data) list) ->
+ string ->
+ explicit_spanval exit_manual_span : explicit_span -> unitval add_data_to_manual_span :
+ explicit_span ->
+ (string * user_data) list ->
+ unitval counter_int :
+ ?data:(unit -> (string * user_data) list) ->
+ string ->
+ int ->
+ unitval counter_float :
+ ?data:(unit -> (string * user_data) list) ->
+ string ->
+ float ->
+ unitval setup_collector : collector -> unitProfile.BACKENDSer_decode.ErrorErrors
include Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval to_string : t -> stringval of_string : string -> Ser_value.t -> tSer_decode.ErrorErrors
include Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval to_string : t -> stringval of_string : string -> Ser_value.t -> tSer_decode.InfixSer_decode.InfixSidekick_util.Ser_decodeDecoders for Ser_value.
Combinators to decode values.
module Error : sig ... endErrors
val int : int tval bool : bool tval string : string tval return : 'a -> 'a tval return_result : ('a, string) Stdlib.result -> 'a tval fail : string -> 'a tval failf : ('a, Stdlib.Format.formatter, unit, 'b t) Stdlib.format4 -> 'aval unwrap_opt : string -> 'a option -> 'a tUnwrap option, or fail
val any : Ser_value.t tval reflect : 'a t -> Ser_value.t -> ('a, Error.t) Stdlib.result treflect dec v returns the result of decoding v with dec
val reflect_or_fail : 'a t -> Ser_value.t -> 'a tmodule Infix : sig ... endval run : 'a t -> Ser_value.t -> ('a, Error.t) Stdlib.resultval run_exn : 'a t -> Ser_value.t -> 'aSidekick_util.Ser_decodeDecoders for Ser_value.
Combinators to decode values.
module Error : sig ... endErrors
val int : int tval bool : bool tval string : string tval return : 'a -> 'a tval return_result : ('a, string) Stdlib.result -> 'a tval fail : string -> 'a tval failf : ('a, Stdlib.Format.formatter, unit, 'b t) Stdlib.format4 -> 'aval unwrap_opt : string -> 'a option -> 'a tUnwrap option, or fail
val any : Ser_value.t tval reflect : 'a t -> Ser_value.t -> ('a, Error.t) Stdlib.result treflect dec v returns the result of decoding v with dec
val reflect_or_fail : 'a t -> Ser_value.t -> 'a tmodule Infix : sig ... endval run : 'a t -> Ser_value.t -> ('a, Error.t) Stdlib.resultval run_exn : 'a t -> Ser_value.t -> 'aSidekick_util.Ser_valueSerialization representation.
A Ser_value.t describes how to serialized some structured data into bytes. It reflects the shape of the structured data but does not commit to a particular serialization format.
val null : tval bool : bool -> tval int : int -> tval string : string -> tval bytes : string -> tval is_null : t -> boolinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerSidekick_util.Ser_valueSerialization representation.
A Ser_value.t describes how to serialized some structured data into bytes. It reflects the shape of the structured data but does not commit to a particular serialization format.
val null : tval bool : bool -> tval int : int -> tval string : string -> tval bytes : string -> tval is_null : t -> boolinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerSidekick_util.Statval create : unit -> tval incr : int counter -> unitval incr_f : float counter -> float -> unitval set : 'a counter -> 'a -> unitval all : t -> ex_counter Iter.tval pp_counters : ex_counter Iter.t Fmt.printerval pp : t Fmt.printerval global : tGlobal statistics, by default
Sidekick_util.Statval create : unit -> tval incr : int counter -> unitval incr_f : float counter -> float -> unitval set : 'a counter -> 'a -> unitval all : t -> ex_counter Iter.tval pp_counters : ex_counter Iter.t Fmt.printerval pp : t Fmt.printerval global : tGlobal statistics, by default
Sidekick_util.UtilSidekick_util.UtilSidekick_util.VecVectors
A resizable array, workhorse of imperative programming :-). This implementation originated in alt-ergo-zero but has been basically rewritten from scratch several times since.
val make : int -> 'a -> 'a tmake cap dummy creates a new vector filled with dummy. The vector is initially empty but its underlying array has capacity cap. dummy will stay alive as long as the vector
val create : unit -> 'a tval to_list : 'a t -> 'a listReturns the list of elements of the vector
val to_array : 'a t -> 'a arrayval of_list : 'a list -> 'a tval clear : 'a t -> unitSet size to 0, doesn't free elements
val ensure_size : 'a t -> elt:'a -> int -> unitensure size is at least n
val ensure_size_with : 'a t -> (unit -> 'a) -> int -> unitensure size is at least n
val shrink : 'a t -> int -> unitshrink vec sz resets size of vec to sz. Assumes sz >=0 && sz <= size vec
val pop_exn : 'a t -> 'aPop last element and return it.
val pop : 'a t -> 'a optionval size : 'a t -> intval is_empty : 'a t -> boolval is_full : 'a t -> boolIs the capacity of the vector equal to the number of its elements?
val push : 'a t -> 'a -> unitPush element into the vector
val get : 'a t -> int -> 'aget the element at the given index, or
val set : 'a t -> int -> 'a -> unitset the element at the given index, either already set or the first free slot if not (is_full vec), or
val fast_remove : 'a t -> int -> unitRemove element at index i without preserving order (swap with last element)
prepend v ~into pushes all elements of v into into, at the beginning. consumes v.
val filter_in_place : ('a -> bool) -> 'a t -> unitfilter_in_place f v removes from v the elements that do not satisfy f
val sort : 'a t -> ('a -> 'a -> int) -> unitSort in place the array
val iter : f:('a -> unit) -> 'a t -> unitIterate on elements
val rev_iter : f:('a -> unit) -> 'a t -> unitval to_iter : 'a t -> 'a Iter.tval iteri : f:(int -> 'a -> unit) -> 'a t -> unitIterate on elements with their index
val fold : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'bFold over elements
val exists : ('a -> bool) -> 'a t -> boolDoes there exist an element that satisfies the predicate?
val for_all : ('a -> bool) -> 'a t -> boolDo all elements satisfy the predicate?
val pp :
- ?sep:string ->
+Vec (sidekick.Sidekick_util.Vec) Module Sidekick_util.Vec
Vectors
A resizable array, workhorse of imperative programming :-). This implementation originated in alt-ergo-zero but has been basically rewritten from scratch several times since.
val make : int -> 'a -> 'a tmake cap dummy creates a new vector filled with dummy. The vector is initially empty but its underlying array has capacity cap. dummy will stay alive as long as the vector
val create : unit -> 'a tval to_list : 'a t -> 'a listReturns the list of elements of the vector
val to_array : 'a t -> 'a arrayval of_list : 'a list -> 'a tval clear : 'a t -> unitSet size to 0, doesn't free elements
val ensure_size : 'a t -> elt:'a -> int -> unitensure size is at least n
val ensure_size_with : 'a t -> (unit -> 'a) -> int -> unitensure size is at least n
val shrink : 'a t -> int -> unitshrink vec sz resets size of vec to sz. Assumes sz >=0 && sz <= size vec
val pop_exn : 'a t -> 'aPop last element and return it.
val pop : 'a t -> 'a optionval size : 'a t -> intval is_empty : 'a t -> boolval is_full : 'a t -> boolIs the capacity of the vector equal to the number of its elements?
val push : 'a t -> 'a -> unitPush element into the vector
val get : 'a t -> int -> 'aget the element at the given index, or
val set : 'a t -> int -> 'a -> unitset the element at the given index, either already set or the first free slot if not (is_full vec), or
val fast_remove : 'a t -> int -> unitRemove element at index i without preserving order (swap with last element)
prepend v ~into pushes all elements of v into into, at the beginning. consumes v.
val filter_in_place : ('a -> bool) -> 'a t -> unitfilter_in_place f v removes from v the elements that do not satisfy f
val sort : 'a t -> ('a -> 'a -> int) -> unitSort in place the array
val iter : f:('a -> unit) -> 'a t -> unitIterate on elements
val rev_iter : f:('a -> unit) -> 'a t -> unitval to_iter : 'a t -> 'a Iter.tval iteri : f:(int -> 'a -> unit) -> 'a t -> unitIterate on elements with their index
val fold : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'bFold over elements
val exists : ('a -> bool) -> 'a t -> boolDoes there exist an element that satisfies the predicate?
val for_all : ('a -> bool) -> 'a t -> boolDo all elements satisfy the predicate?
val pp :
+ ?sep:string ->
(Stdlib.Format.formatter -> 'a -> unit) ->
Stdlib.Format.formatter ->
'a t ->
- unit
\ No newline at end of file
+ unitSidekick_util.Vec_floatVectors of floats
These vectors are more optimized than Vec.
include Vec_sig.S with type elt := floatinclude Vec_sig.BASE with type elt := floatval create : ?cap:int -> unit -> tval clear : t -> unitval is_empty : t -> boolval push : t -> float -> unitval fast_remove : t -> int -> unitRemove element at index i without preserving order (swap with last element)
val filter_in_place : (float -> bool) -> t -> unitval ensure_size : t -> int -> unitval pop : t -> floatval set : t -> int -> float -> unitval shrink : t -> int -> unitSidekick_util.Vec_floatVectors of floats
These vectors are more optimized than Vec.
include Vec_sig.S with type elt := floatinclude Vec_sig.BASE with type elt := floatval create : ?cap:int -> unit -> tval clear : t -> unitval is_empty : t -> boolval push : t -> float -> unitval fast_remove : t -> int -> unitRemove element at index i without preserving order (swap with last element)
val filter_in_place : (float -> bool) -> t -> unitval ensure_size : t -> int -> unitval pop : t -> floatval set : t -> int -> float -> unitval shrink : t -> int -> unitMake_extensions.Bval size : t -> intMake_extensions.Bval size : t -> intVec_sig.Make_extensionsVec_sig.Make_extensionsSidekick_util.Vec_sigmodule type BASE_RO = sig ... endBasics
module type BASE = sig ... endmodule type EXTENSIONS = sig ... endmodule type S = sig ... endmodule Make_extensions
+Vec_sig (sidekick.Sidekick_util.Vec_sig) Module Sidekick_util.Vec_sig
module type BASE_RO = sig ... endBasics
module type BASE = sig ... endmodule type EXTENSIONS = sig ... endmodule type S = sig ... endmodule Make_extensions
(B : BASE_RO) :
- EXTENSIONS with type t := B.t and type elt := B.elt
\ No newline at end of file
+ EXTENSIONS with type t := B.t and type elt := B.eltVec_sig.BASEval create : ?cap:int -> unit -> tval clear : t -> unitval is_empty : t -> boolval fast_remove : t -> int -> unitRemove element at index i without preserving order (swap with last element)
val ensure_size : t -> int -> unitval shrink : t -> int -> unitVec_sig.BASEval create : ?cap:int -> unit -> tval clear : t -> unitval is_empty : t -> boolval fast_remove : t -> int -> unitRemove element at index i without preserving order (swap with last element)
val ensure_size : t -> int -> unitval shrink : t -> int -> unitVec_sig.BASE_ROBasics
val size : t -> intVec_sig.BASE_ROBasics
val size : t -> intVec_sig.EXTENSIONSVec_sig.EXTENSIONSVec_sig.SVec_sig.SSidekick_util.VeciVectors of int32 integers
These vectors are more optimized than Vec.
include Vec_sig.S with type elt := intinclude Vec_sig.BASE with type elt := intval create : ?cap:int -> unit -> tval clear : t -> unitval is_empty : t -> boolval push : t -> int -> unitval fast_remove : t -> int -> unitRemove element at index i without preserving order (swap with last element)
val filter_in_place : (int -> bool) -> t -> unitval ensure_size : t -> int -> unitval pop : t -> intval set : t -> int -> int -> unitval shrink : t -> int -> unitval push_i32 : t -> int32 -> unitval get_i32 : t -> int -> int32val set_i32 : t -> int -> int32 -> unitSidekick_util.VeciVectors of int32 integers
These vectors are more optimized than Vec.
include Vec_sig.S with type elt := intinclude Vec_sig.BASE with type elt := intval create : ?cap:int -> unit -> tval clear : t -> unitval is_empty : t -> boolval push : t -> int -> unitval fast_remove : t -> int -> unitRemove element at index i without preserving order (swap with last element)
val filter_in_place : (int -> bool) -> t -> unitval ensure_size : t -> int -> unitval pop : t -> intval set : t -> int -> int -> unitval shrink : t -> int -> unitval push_i32 : t -> int32 -> unitval get_i32 : t -> int -> int32val set_i32 : t -> int -> int32 -> unitSidekick_utilmodule Util : sig ... endmodule Vec : sig ... endVectors
module Veci : sig ... endVectors of int32 integers
module Vec_float : sig ... endVectors of floats
module Vec_sig : sig ... endmodule Bitvec : sig ... endBitvector.
module Int_id : sig ... endInteger-based identifiers.
module Int_tbl = Util.Int_tblmodule Int_set = Util.Int_setmodule Int_map = Util.Int_mapmodule Event : sig ... endEvent pattern.
module Backtrack_stack : sig ... endmodule Backtrackable_tbl : sig ... endmodule Backtrackable_ref : sig ... endmodule Log : sig ... endLogging function, for debugging
module Error : sig ... endmodule Bag : sig ... endmodule Stat : sig ... endmodule Hash : sig ... endmodule Profile : sig ... endProfiling probes.
module Chunk_stack : sig ... endManage a list of chunks.
module Ser_value : sig ... endSerialization representation.
module Ser_decode : sig ... endDecoders for Ser_value.
Sidekick_utilmodule Util : sig ... endmodule Vec : sig ... endVectors
module Veci : sig ... endVectors of int32 integers
module Vec_float : sig ... endVectors of floats
module Vec_sig : sig ... endmodule Bitvec : sig ... endBitvector.
module Int_id : sig ... endInteger-based identifiers.
module Int_tbl = Util.Int_tblmodule Int_set = Util.Int_setmodule Int_map = Util.Int_mapmodule Event : sig ... endEvent pattern.
module Backtrack_stack : sig ... endmodule Backtrackable_tbl : sig ... endmodule Backtrackable_ref : sig ... endmodule Log : sig ... endLogging function, for debugging
module Error : sig ... endmodule Bag : sig ... endmodule Stat : sig ... endmodule Hash : sig ... endmodule Profile : sig ... endmodule Chunk_stack : sig ... endManage a list of chunks.
module Ser_value : sig ... endSerialization representation.
module Ser_decode : sig ... endDecoders for Ser_value.
Sidekick_zarith.Intinclude Sidekick_arith.INT with type t = Z.tinclude Sidekick_arith.NUM with type t = Z.tval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval probab_prime : t -> boolSidekick_zarith.Intinclude Sidekick_arith.INT with type t = Z.tinclude Sidekick_arith.NUM with type t = Z.tval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval probab_prime : t -> boolSidekick_zarith.Rationalinclude Sidekick_arith.NUM with type t = Q.tval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval infinity : t+infinity
val minus_infinity : tval is_real : t -> boolA proper real, not nan/infinity
val is_int : t -> boolIs this a proper integer?
val pp_approx : int -> Stdlib.Format.formatter -> t -> unitPretty print rational with given amount of precision (for example as a floating point number)
Sidekick_zarith.Rationalinclude Sidekick_arith.NUM with type t = Q.tval zero : tval one : tval minus_one : tval sign : t -> intval of_int : int -> tval to_string : t -> stringval of_string : string -> t optioninclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intinclude Sidekick_sigs.PRINT with type t := tval pp : t Sidekick_sigs.printerval infinity : t+infinity
val minus_infinity : tval is_real : t -> boolA proper real, not nan/infinity
val is_int : t -> boolIs this a proper integer?
val pp_approx : int -> Stdlib.Format.formatter -> t -> unitPretty print rational with given amount of precision (for example as a floating point number)
Sidekick_zarithmodule Int : Sidekick_arith.INT_FULL with type t = Z.tmodule Rational :
- Sidekick_arith.RATIONAL with type t = Q.t and type bigint = Z.tSidekick_zarithmodule Int : Sidekick_arith.INT_FULL with type t = Z.tmodule Rational :
+ Sidekick_arith.RATIONAL with type t = Q.t and type bigint = Z.tThe entry point of this library is the module: Sidekick_abstract_solver.
The entry point of this library is the module: Sidekick_arith.
The entry point of this library is the module: Sidekick_bencode.
The entry point of this library is the module: Sidekick_cc.
The entry point of this library is the module: Sidekick_cc_plugin.
The entry point of this library is the module: Sidekick_core.
The entry point of this library is the module: Sidekick_core_logic.
The entry point of this library is the module: Sidekick_drup.
The entry point of this library is the module: Sidekick_memtrace.
The entry point of this library is the module: Sidekick_mini_cc.
The entry point of this library is the module: Sidekick_proof.
The entry point of this library is the module: Sidekick_quip.
The entry point of this library is the module: Sidekick_sat.
The entry point of this library is the module: Sidekick_sigs.
The entry point of this library is the module: Sidekick_simplex.
The entry point of this library is the module: Sidekick_simplify.
The entry point of this library is the module: Sidekick_smt_solver.
The entry point of this library is the module: Sidekick_tef.
The entry point of this library is the module: Sidekick_th_bool_dyn.
The entry point of this library is the module: Sidekick_th_bool_static.
The entry point of this library is the module: Sidekick_th_cstor.
The entry point of this library is the module: Sidekick_th_data.
The entry point of this library is the module: Sidekick_th_lra.
The entry point of this library is the module: Sidekick_th_ty_unin.
The entry point of this library is the module: Sidekick_trace.
The entry point of this library is the module: Sidekick_util.
The entry point of this library is the module: Sidekick_zarith.
The entry point of this library is the module: Sidekick_abstract_solver.
The entry point of this library is the module: Sidekick_arith.
The entry point of this library is the module: Sidekick_bencode.
The entry point of this library is the module: Sidekick_cc.
The entry point of this library is the module: Sidekick_cc_plugin.
The entry point of this library is the module: Sidekick_core.
The entry point of this library is the module: Sidekick_core_logic.
The entry point of this library is the module: Sidekick_drup.
The entry point of this library is the module: Sidekick_memtrace.
The entry point of this library is the module: Sidekick_mini_cc.
The entry point of this library is the module: Sidekick_proof.
The entry point of this library is the module: Sidekick_quip.
The entry point of this library is the module: Sidekick_sat.
The entry point of this library is the module: Sidekick_sigs.
The entry point of this library is the module: Sidekick_simplex.
The entry point of this library is the module: Sidekick_simplify.
The entry point of this library is the module: Sidekick_smt_solver.
The entry point of this library is the module: Sidekick_th_bool_dyn.
The entry point of this library is the module: Sidekick_th_bool_static.
The entry point of this library is the module: Sidekick_th_cstor.
The entry point of this library is the module: Sidekick_th_data.
The entry point of this library is the module: Sidekick_th_lra.
The entry point of this library is the module: Sidekick_th_ty_unin.
The entry point of this library is the module: Sidekick_trace.
The entry point of this library is the module: Sidekick_util.
The entry point of this library is the module: Sidekick_zarith.