This repository has been archived by the owner on Jul 31, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from mcmtroffaes/feature/pcre-light-utf8-fix
Fix processing of utf8 input when compiling with pcre-light.
- Loading branch information
Showing
4 changed files
with
126 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
module Reals where | ||
|
||
-- (a set with properties of) the reals | ||
data ℝ : Set where | ||
r0 : ℝ | ||
r1 : ℝ | ||
_+_ : ℝ → ℝ → ℝ | ||
|
||
-- equality | ||
data _==_ : ℝ → ℝ → Set where | ||
AXrefl== : ∀ {r} → r == r | ||
AXsymm== : ∀ {r s} → r == s → s == r | ||
AXtrans== : ∀ {r s t} → r == s → s == t → r == t | ||
AX+0 : ∀ {r} → (r + r0) == r | ||
AXsymm+ : ∀ {r s} → (r + s) == (s + r) | ||
AX+== : ∀ {r s t} → r == s → (r + t) == (s + t) | ||
|
||
THM0+ : {r : ℝ} → r == (r0 + r) | ||
THM0+ = AXsymm== (AXtrans== AXsymm+ AX+0) | ||
-- AXsymm+ AX+0 r0 + r == r + r0 and r + r0 == r | ||
-- AXtrans== so r0 + r == r | ||
-- AXsymm== so r == r0 + r | ||
|
||
THM0+alt : {r : ℝ} → r == (r0 + r) | ||
THM0+alt {r} = AXsymm== {r0 + r} {r} ((AXtrans== {r0 + r} {r + r0} {r}) (AXsymm+ {r0} {r}) (AX+0 {r})) | ||
|
||
-- strict partial ordering | ||
data _<_ : ℝ → ℝ → Set where | ||
AXtrans<<< : ∀ {r s t} → r < s → s < t → r < t | ||
AX<=< : ∀ {r s t} → r < s → s == t → r < t | ||
AX=<< : ∀ {r s t} → r == s → s < t → r < t | ||
AX0<1 : r0 < r1 | ||
AX+<< : ∀ {r s t} → r < s → (r + t) < (s + t) | ||
|
||
THM<+1 : {r : ℝ} → r < (r + r1) | ||
THM<+1 = AX<=< (AX=<< THM0+ (AX+<< AX0<1)) AXsymm+ | ||
-- AX0<1 0 < 1 | ||
-- AX<+ % so 0 + r < 1 + r | ||
-- AX=<< lem0+ % so r < 1 + r | ||
-- AX<=< % AXsymm+ so r < r + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; } | ||
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { | ||
margin: 0; padding: 0; vertical-align: baseline; border: none; } | ||
table.sourceCode { width: 100%; line-height: 100%; } | ||
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; } | ||
td.sourceCode { padding-left: 5px; } | ||
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */ | ||
code > span.dt { color: #902000; } /* DataType */ | ||
code > span.dv { color: #40a070; } /* DecVal */ | ||
code > span.bn { color: #40a070; } /* BaseN */ | ||
code > span.fl { color: #40a070; } /* Float */ | ||
code > span.ch { color: #4070a0; } /* Char */ | ||
code > span.st { color: #4070a0; } /* String */ | ||
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */ | ||
code > span.ot { color: #007020; } /* Other */ | ||
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */ | ||
code > span.fu { color: #06287e; } /* Function */ | ||
code > span.er { color: #ff0000; font-weight: bold; } /* Error */ | ||
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */ | ||
code > span.cn { color: #880000; } /* Constant */ | ||
code > span.sc { color: #4070a0; } /* SpecialChar */ | ||
code > span.vs { color: #4070a0; } /* VerbatimString */ | ||
code > span.ss { color: #bb6688; } /* SpecialString */ | ||
code > span.im { } /* Import */ | ||
code > span.va { color: #19177c; } /* Variable */ | ||
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */ | ||
code > span.op { color: #666666; } /* Operator */ | ||
code > span.bu { } /* BuiltIn */ | ||
code > span.ex { } /* Extension */ | ||
code > span.pp { color: #bc7a00; } /* Preprocessor */ | ||
code > span.at { color: #7d9029; } /* Attribute */ | ||
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */ | ||
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */ | ||
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */ | ||
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */ | ||
</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">module</span> Reals <span class="kw" title="KeywordTok">where</span> | ||
|
||
<span class="co" title="CommentTok">-- (a set with properties of) the reals</span> | ||
<span class="kw" title="KeywordTok">data</span> ℝ <span class="ot" title="OtherTok">:</span> <span class="dt" title="DataTypeTok">Set</span> <span class="kw" title="KeywordTok">where</span> | ||
r0 <span class="ot" title="OtherTok">:</span> ℝ | ||
r1 <span class="ot" title="OtherTok">:</span> ℝ | ||
<span class="ot" title="OtherTok">_</span>+<span class="ot" title="OtherTok">_</span> <span class="ot" title="OtherTok">:</span> ℝ <span class="ot" title="OtherTok">→</span> ℝ <span class="ot" title="OtherTok">→</span> ℝ | ||
|
||
<span class="co" title="CommentTok">-- equality</span> | ||
<span class="kw" title="KeywordTok">data</span> <span class="ot" title="OtherTok">_</span>==<span class="ot" title="OtherTok">_</span> <span class="ot" title="OtherTok">:</span> ℝ <span class="ot" title="OtherTok">→</span> ℝ <span class="ot" title="OtherTok">→</span> <span class="dt" title="DataTypeTok">Set</span> <span class="kw" title="KeywordTok">where</span> | ||
AXrefl== <span class="ot" title="OtherTok">:</span> <span class="ot" title="OtherTok">∀</span> <span class="ot" title="OtherTok">{</span>r<span class="ot" title="OtherTok">}</span> <span class="ot" title="OtherTok">→</span> r == r | ||
AXsymm== <span class="ot" title="OtherTok">:</span> <span class="ot" title="OtherTok">∀</span> <span class="ot" title="OtherTok">{</span>r s<span class="ot" title="OtherTok">}</span> <span class="ot" title="OtherTok">→</span> r == s <span class="ot" title="OtherTok">→</span> s == r | ||
AXtrans== <span class="ot" title="OtherTok">:</span> <span class="ot" title="OtherTok">∀</span> <span class="ot" title="OtherTok">{</span>r s t<span class="ot" title="OtherTok">}</span> <span class="ot" title="OtherTok">→</span> r == s <span class="ot" title="OtherTok">→</span> s == t <span class="ot" title="OtherTok">→</span> r == t | ||
AX+0 <span class="ot" title="OtherTok">:</span> <span class="ot" title="OtherTok">∀</span> <span class="ot" title="OtherTok">{</span>r<span class="ot" title="OtherTok">}</span> <span class="ot" title="OtherTok">→</span> <span class="ot" title="OtherTok">(</span>r + r0<span class="ot" title="OtherTok">)</span> == r | ||
AXsymm+ <span class="ot" title="OtherTok">:</span> <span class="ot" title="OtherTok">∀</span> <span class="ot" title="OtherTok">{</span>r s<span class="ot" title="OtherTok">}</span> <span class="ot" title="OtherTok">→</span> <span class="ot" title="OtherTok">(</span>r + s<span class="ot" title="OtherTok">)</span> == <span class="ot" title="OtherTok">(</span>s + r<span class="ot" title="OtherTok">)</span> | ||
AX+== <span class="ot" title="OtherTok">:</span> <span class="ot" title="OtherTok">∀</span> <span class="ot" title="OtherTok">{</span>r s t<span class="ot" title="OtherTok">}</span> <span class="ot" title="OtherTok">→</span> r == s <span class="ot" title="OtherTok">→</span> <span class="ot" title="OtherTok">(</span>r + t<span class="ot" title="OtherTok">)</span> == <span class="ot" title="OtherTok">(</span>s + t<span class="ot" title="OtherTok">)</span> | ||
|
||
THM0+ <span class="ot" title="OtherTok">:</span> <span class="ot" title="OtherTok">{</span>r <span class="ot" title="OtherTok">:</span> ℝ<span class="ot" title="OtherTok">}</span> <span class="ot" title="OtherTok">→</span> r == <span class="ot" title="OtherTok">(</span>r0 + r<span class="ot" title="OtherTok">)</span> | ||
THM0+ <span class="ot" title="OtherTok">=</span> AXsymm== <span class="ot" title="OtherTok">(</span>AXtrans== AXsymm+ AX+0<span class="ot" title="OtherTok">)</span> | ||
<span class="co" title="CommentTok">-- AXsymm+ AX+0 r0 + r == r + r0 and r + r0 == r</span> | ||
<span class="co" title="CommentTok">-- AXtrans== so r0 + r == r</span> | ||
<span class="co" title="CommentTok">-- AXsymm== so r == r0 + r</span> | ||
|
||
THM0+alt <span class="ot" title="OtherTok">:</span> <span class="ot" title="OtherTok">{</span>r <span class="ot" title="OtherTok">:</span> ℝ<span class="ot" title="OtherTok">}</span> <span class="ot" title="OtherTok">→</span> r == <span class="ot" title="OtherTok">(</span>r0 + r<span class="ot" title="OtherTok">)</span> | ||
THM0+alt <span class="ot" title="OtherTok">{</span>r<span class="ot" title="OtherTok">}</span> <span class="ot" title="OtherTok">=</span> AXsymm== <span class="ot" title="OtherTok">{</span>r0 + r<span class="ot" title="OtherTok">}</span> <span class="ot" title="OtherTok">{</span>r<span class="ot" title="OtherTok">}</span> <span class="ot" title="OtherTok">((</span>AXtrans== <span class="ot" title="OtherTok">{</span>r0 + r<span class="ot" title="OtherTok">}</span> <span class="ot" title="OtherTok">{</span>r + r0<span class="ot" title="OtherTok">}</span> <span class="ot" title="OtherTok">{</span>r<span class="ot" title="OtherTok">})</span> <span class="ot" title="OtherTok">(</span>AXsymm+ <span class="ot" title="OtherTok">{</span>r0<span class="ot" title="OtherTok">}</span> <span class="ot" title="OtherTok">{</span>r<span class="ot" title="OtherTok">})</span> <span class="ot" title="OtherTok">(</span>AX+0 <span class="ot" title="OtherTok">{</span>r<span class="ot" title="OtherTok">}))</span> | ||
|
||
<span class="co" title="CommentTok">-- strict partial ordering</span> | ||
<span class="kw" title="KeywordTok">data</span> <span class="ot" title="OtherTok">_</span><<span class="ot" title="OtherTok">_</span> <span class="ot" title="OtherTok">:</span> ℝ <span class="ot" title="OtherTok">→</span> ℝ <span class="ot" title="OtherTok">→</span> <span class="dt" title="DataTypeTok">Set</span> <span class="kw" title="KeywordTok">where</span> | ||
AXtrans<<< <span class="ot" title="OtherTok">:</span> <span class="ot" title="OtherTok">∀</span> <span class="ot" title="OtherTok">{</span>r s t<span class="ot" title="OtherTok">}</span> <span class="ot" title="OtherTok">→</span> r < s <span class="ot" title="OtherTok">→</span> s < t <span class="ot" title="OtherTok">→</span> r < t | ||
AX<=< <span class="ot" title="OtherTok">:</span> <span class="ot" title="OtherTok">∀</span> <span class="ot" title="OtherTok">{</span>r s t<span class="ot" title="OtherTok">}</span> <span class="ot" title="OtherTok">→</span> r < s <span class="ot" title="OtherTok">→</span> s == t <span class="ot" title="OtherTok">→</span> r < t | ||
AX=<< <span class="ot" title="OtherTok">:</span> <span class="ot" title="OtherTok">∀</span> <span class="ot" title="OtherTok">{</span>r s t<span class="ot" title="OtherTok">}</span> <span class="ot" title="OtherTok">→</span> r == s <span class="ot" title="OtherTok">→</span> s < t <span class="ot" title="OtherTok">→</span> r < t | ||
AX0<1 <span class="ot" title="OtherTok">:</span> r0 < r1 | ||
AX+<< <span class="ot" title="OtherTok">:</span> <span class="ot" title="OtherTok">∀</span> <span class="ot" title="OtherTok">{</span>r s t<span class="ot" title="OtherTok">}</span> <span class="ot" title="OtherTok">→</span> r < s <span class="ot" title="OtherTok">→</span> <span class="ot" title="OtherTok">(</span>r + t<span class="ot" title="OtherTok">)</span> < <span class="ot" title="OtherTok">(</span>s + t<span class="ot" title="OtherTok">)</span> | ||
|
||
THM<+1 <span class="ot" title="OtherTok">:</span> <span class="ot" title="OtherTok">{</span>r <span class="ot" title="OtherTok">:</span> ℝ<span class="ot" title="OtherTok">}</span> <span class="ot" title="OtherTok">→</span> r < <span class="ot" title="OtherTok">(</span>r + r1<span class="ot" title="OtherTok">)</span> | ||
THM<+1 <span class="ot" title="OtherTok">=</span> AX<=< <span class="ot" title="OtherTok">(</span>AX=<< THM0+ <span class="ot" title="OtherTok">(</span>AX+<< AX0<1<span class="ot" title="OtherTok">))</span> AXsymm+ | ||
<span class="co" title="CommentTok">-- AX0<1 0 < 1</span> | ||
<span class="co" title="CommentTok">-- AX<+ % so 0 + r < 1 + r</span> | ||
<span class="co" title="CommentTok">-- AX=<< lem0+ % so r < 1 + r</span> | ||
<span class="co" title="CommentTok">-- AX<=< % AXsymm+ so r < r + 1</span></code></pre></div></body> |