Skip to content

Commit

Permalink
Deploying to gh-pages from @ 00cb2ca 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
shilangyu committed Jan 28, 2024
1 parent ba4c214 commit c27c327
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions assets/index-zLjdv_Y0.js → assets/index-avC0KPoN.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
(t', x') := highest(t[..], x[..])
for j in 1..N
RReg[j, i].write((t', x'))
return x
return x'
func Write(v)
t := t + 1
Expand All @@ -85,7 +85,7 @@
(t[j], x[j]) := Reg[j].read()
(t', x') := highest(t[..], x[..])
Reg[i].write((t' + 1, v))
`}],m=(()=>{const e=[];for(const t of g){const c=[];for(const o of B)for(const r of o.maps)if(y(r.from,t))for(const s of g)y(s,r.to)&&c.push({target:s,code:o.code});e.push([t,c])}return e})();console.assert(m.length===Object.keys(i).length*Object.keys(n).length*Object.keys(a).length);const x=(e,t)=>{if(d(e,t))return"same register";if(y(t,e))return"weakening";const c=[],o=s=>c.find(l=>d(l,s))!==void 0,r=[{node:e,path:[]}];for(;r.length>0;){const{node:s,path:l}=r.shift();if(d(s,t))return l;const M=m.find(([u])=>d(u,s))[1];for(const u of M)o(u.target)||(c.push(u.target),r.push({node:u.target,path:[...l,{from:s,to:u.target,code:u.code}]}))}return[]},S=e=>({get cardinality(){return document.querySelector(`input[name="${e}-cardinality"]:checked`).value},get interface(){return document.querySelector(`input[name="${e}-interface"]:checked`).value},get type(){return document.querySelector(`input[name="${e}-type"]:checked`).value}}),b=S("base"),A=S("target"),R=e=>{const t=["return","func","if","«init»","for","in"],c=["RReg","WReg","Reg"];let o=e.code;for(const r of t)o=o.split(r).join(`<span class="keyword">${r}</span>`);for(const r of c)o=o.split(r).join(`<span class="register">${r}</span>`);return`<pre><code>${o}</code></pre>`},h=()=>{const e=document.querySelector("#transformation"),t=x(b,A);switch(t){case"same register":e.innerHTML="Base and target register are the same kind of register.";break;case"weakening":e.innerHTML="The base register is strictly stronger than the target register.";break;default:if(t.length==0){e.innerHTML='<span class="error">No transformation found. This is most likely an error, please report it in the repository.</span>';break}else if(t.length==1){e.innerHTML=R(t[0]);break}e.innerHTML=e.innerHTML=t.map((c,o)=>`
`}],m=(()=>{const e=[];for(const t of g){const c=[];for(const o of B)for(const r of o.maps)if(y(r.from,t))for(const s of g)y(s,r.to)&&c.push({target:s,code:o.code});e.push([t,c])}return e})();console.assert(m.length===Object.keys(i).length*Object.keys(n).length*Object.keys(a).length);const x=(e,t)=>{if(d(e,t))return"same register";if(y(t,e))return"weakening";const c=[],o=s=>c.find(l=>d(l,s))!==void 0,r=[{node:e,path:[]}];for(;r.length>0;){const{node:s,path:l}=r.shift();if(d(s,t))return l;const M=m.find(([u])=>d(u,s))[1];for(const u of M)o(u.target)||(c.push(u.target),r.push({node:u.target,path:[...l,{from:s,to:u.target,code:u.code}]}))}return[]},S=e=>({get cardinality(){return document.querySelector(`input[name="${e}-cardinality"]:checked`).value},get interface(){return document.querySelector(`input[name="${e}-interface"]:checked`).value},get type(){return document.querySelector(`input[name="${e}-type"]:checked`).value}}),b=S("base"),A=S("target"),R=e=>{const t=["return","func","if","«init»","for","in"],c=["RReg","WReg","Reg"];let o=e.code;for(const r of t)o=o.split(r).join(`<span class="keyword">${r}</span>`);for(const r of c)o=o.split(r).join(`<span class="register">${r}</span>`);return`<pre><code>${o}</code></pre>`},h=()=>{const e=document.querySelector("#transformation"),t=x(b,A);switch(t){case"same register":e.innerHTML="Base and target register are the same kind of register.";break;case"weakening":e.innerHTML="The base register is strictly stronger than the target register.";break;default:if(t.length==0){e.innerHTML='<span class="error">No transformation found. This is most likely an error, please report it in the repository.</span>';break}else if(t.length==1){e.innerHTML=R(t[0]);break}e.innerHTML=t.map((c,o)=>`
<div>
<h3>Step #${o+1}: ${p(c.from)}${p(c.to)}</h3>
${R(c)}
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="icon" type="image/svg+xml" href="/register-transformations/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Registers transformations</title>
<script type="module" crossorigin src="/register-transformations/assets/index-zLjdv_Y0.js"></script>
<script type="module" crossorigin src="/register-transformations/assets/index-avC0KPoN.js"></script>
<link rel="stylesheet" crossorigin href="/register-transformations/assets/index-Z6VEQm-o.css">
</head>
<body>
Expand Down

0 comments on commit c27c327

Please sign in to comment.