Repository navigation
Expand file tree
/
Copy pathLanguage-Copilot-Analyser.html
More file actions
40 lines (40 loc) · 11.9 KB
/
Copy pathLanguage-Copilot-Analyser.html
File metadata and controls
40 lines (40 loc) · 11.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Language.Copilot.Analyser</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Language-Copilot-Analyser.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="http://github.com/leepike/Copilot/Language.Copilot.Analyser.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">copilot-0.28: A stream DSL for writing embedded C monitors.</p></div><div id="content"><div id="module-header"><p class="caption">Language.Copilot.Analyser</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#1">Main error checking functions
</a></li><li><a href="#2">Varied other things
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>This module provides a way to check that a <em>Copilot</em> specification is
compilable
</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:check">check</a> :: <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> -> <a href="/Library/Frameworks/GHC.framework/Versions/612/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Language-Copilot-Analyser.html#t:Error">Error</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:Error">Error</a> <ul class="subs"><li>= <a href="#v:BadSyntax">BadSyntax</a> <a href="/Library/Frameworks/GHC.framework/Versions/612/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t:String">String</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> </li><li>| <a href="#v:BadDrop">BadDrop</a> <a href="/Library/Frameworks/GHC.framework/Versions/612/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t:Int">Int</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> </li><li>| <a href="#v:BadSamplingPhase">BadSamplingPhase</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> <a href="Language-Copilot-Core.html#t:Phase">Phase</a> </li><li>| <a href="#v:BadSamplingArrPhase">BadSamplingArrPhase</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> <a href="Language-Copilot-Core.html#t:Phase">Phase</a> </li><li>| <a href="#v:BadPArrSpec">BadPArrSpec</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> <a href="/Library/Frameworks/GHC.framework/Versions/612/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t:String">String</a> </li><li>| <a href="#v:BadType">BadType</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> </li><li>| <a href="#v:NonNegativeWeightedClosedPath">NonNegativeWeightedClosedPath</a> [<a href="Language-Copilot-Core.html#t:Var">Var</a>] Weight </li><li>| <a href="#v:DependsOnClosePast">DependsOnClosePast</a> [<a href="Language-Copilot-Core.html#t:Var">Var</a>] <a href="Language-Copilot-Core.html#t:Var">Var</a> Weight Weight </li><li>| <a href="#v:DependsOnFuture">DependsOnFuture</a> [<a href="Language-Copilot-Core.html#t:Var">Var</a>] <a href="Language-Copilot-Core.html#t:Var">Var</a> Weight </li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:SpecSet">SpecSet</a> <ul class="subs"><li>= <a href="#v:AllSpecSet">AllSpecSet</a> </li><li>| <a href="#v:FunSpecSet">FunSpecSet</a> </li><li>| <a href="#v:DropSpecSet">DropSpecSet</a> </li><li>| <a href="#v:PArrSet">PArrSet</a> </li></ul></li><li class="src short"><a href="#v:getExternalVars">getExternalVars</a> :: <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> -> [Exs]</li><li class="src short"><span class="keyword">data</span> <a href="#t:ExtVars">ExtVars</a> <ul class="subs"><li>= <a href="#v:ExtV">ExtV</a> <a href="Language-Copilot-Core.html#t:Phase">Phase</a> </li><li>| <a href="#v:ExtA">ExtA</a> <a href="Language-Copilot-Core.html#t:Phase">Phase</a> <a href="/Library/Frameworks/GHC.framework/Versions/612/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t:String">String</a> </li></ul></li></ul></div><div id="interface"><h1 id="1">Main error checking functions
</h1><div class="top"><p class="src"><a name="v:check" class="def">check</a> :: <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> -> <a href="/Library/Frameworks/GHC.framework/Versions/612/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Language-Copilot-Analyser.html#t:Error">Error</a></p><div class="doc"><p>Check a <em>Copilot</em> specification.
If it is not compilable, then returns an error describing the issue.
Else, returns <code>Nothing</code>
</p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Error" class="def">Error</a> </p><div class="doc"><p>Used for representing an error in the specification, detected by <code><code><a href="Language-Copilot-Analyser.html#v:check">check</a></code></code>
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:BadSyntax" class="def">BadSyntax</a> <a href="/Library/Frameworks/GHC.framework/Versions/612/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t:String">String</a> <a href="Language-Copilot-Core.html#t:Var">Var</a></td><td class="doc"><p>the BNF is not respected
</p></td></tr><tr><td class="src"><a name="v:BadDrop" class="def">BadDrop</a> <a href="/Library/Frameworks/GHC.framework/Versions/612/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t:Int">Int</a> <a href="Language-Copilot-Core.html#t:Var">Var</a></td><td class="doc"><p>A drop expression of less than 0 is used
</p></td></tr><tr><td class="src"><a name="v:BadSamplingPhase" class="def">BadSamplingPhase</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> <a href="Language-Copilot-Core.html#t:Phase">Phase</a></td><td class="doc"><p>if an external variable is sampled at
phase 0 then there is no time for the
stream to be updated
</p></td></tr><tr><td class="src"><a name="v:BadSamplingArrPhase" class="def">BadSamplingArrPhase</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> <a href="Language-Copilot-Core.html#t:Phase">Phase</a></td><td class="doc"><p>if an external variable is sampled at
phase 0 then there is no time for the
stream to be updated
</p></td></tr><tr><td class="src"><a name="v:BadPArrSpec" class="def">BadPArrSpec</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> <a href="/Library/Frameworks/GHC.framework/Versions/612/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t:String">String</a></td><td class="doc"><p>External array indexes can only take
variables or constants as indexes.
</p></td></tr><tr><td class="src"><a name="v:BadType" class="def">BadType</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> <a href="Language-Copilot-Core.html#t:Var">Var</a></td><td class="doc"><p>either a variable is not defined, or not with the
good type ; there is no implicit conversion of types in
<em>Copilot</em>
</p></td></tr><tr><td class="src"><a name="v:NonNegativeWeightedClosedPath" class="def">NonNegativeWeightedClosedPath</a> [<a href="Language-Copilot-Core.html#t:Var">Var</a>] Weight</td><td class="doc"><p>The algorithm to compile
<em>Copilot</em> specification can
only work if there is no
negative weighted closed
path in the specification,
as described in the original
research paper
</p></td></tr><tr><td class="src"><a name="v:DependsOnClosePast" class="def">DependsOnClosePast</a> [<a href="Language-Copilot-Core.html#t:Var">Var</a>] <a href="Language-Copilot-Core.html#t:Var">Var</a> Weight Weight</td><td class="doc"><p>Could be compiled, but
would need bigger
prophecyArrays
</p></td></tr><tr><td class="src"><a name="v:DependsOnFuture" class="def">DependsOnFuture</a> [<a href="Language-Copilot-Core.html#t:Var">Var</a>] <a href="Language-Copilot-Core.html#t:Var">Var</a> Weight</td><td class="doc"><p>If an output depends of a future of
an input it will be hard to compile to
say the least
</p></td></tr></table></div><div class="subs instances"><p id="control.i:Error" class="caption collapser" onclick="toggleSection('i:Error')">Instances</p><div id="section.i:Error" class="show"><table><tr><td class="src"><a href="/Library/Frameworks/GHC.framework/Versions/612/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Text-Show.html#t:Show">Show</a> <a href="Language-Copilot-Analyser.html#t:Error">Error</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:SpecSet" class="def">SpecSet</a> </p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:AllSpecSet" class="def">AllSpecSet</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:FunSpecSet" class="def">FunSpecSet</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:DropSpecSet" class="def">DropSpecSet</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:PArrSet" class="def">PArrSet</a></td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:SpecSet" class="caption collapser" onclick="toggleSection('i:SpecSet')">Instances</p><div id="section.i:SpecSet" class="show"><table><tr><td class="src"><a href="/Library/Frameworks/GHC.framework/Versions/612/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Eq.html#t:Eq">Eq</a> <a href="Language-Copilot-Analyser.html#t:SpecSet">SpecSet</a></td><td class="doc empty"> </td></tr></table></div></div></div><h1 id="2">Varied other things
</h1><div class="top"><p class="src"><a name="v:getExternalVars" class="def">getExternalVars</a> :: <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> -> [Exs]</p></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:ExtVars" class="def">ExtVars</a> </p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:ExtV" class="def">ExtV</a> <a href="Language-Copilot-Core.html#t:Phase">Phase</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:ExtA" class="def">ExtA</a> <a href="Language-Copilot-Core.html#t:Phase">Phase</a> <a href="/Library/Frameworks/GHC.framework/Versions/612/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t:String">String</a></td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:ExtVars" class="caption collapser" onclick="toggleSection('i:ExtVars')">Instances</p><div id="section.i:ExtVars" class="show"><table><tr><td class="src"><a href="/Library/Frameworks/GHC.framework/Versions/612/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Eq.html#t:Eq">Eq</a> <a href="Language-Copilot-Analyser.html#t:ExtVars">ExtVars</a></td><td class="doc empty"> </td></tr></table></div></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.8.1</p></div></body></html>