Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://rawgithub.com/freethenation/unify.js/master/lib/unify.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  
</body>
</html>
 
//var unify = require('unify');
var variable = unify.variable;
var expr1 = unify.box([[3,4],2,3,4]);
var expr2 = unify.box([variable("a"),2,variable("$a")]);
if (expr1.unify(expr2)) {
  console.log("Unification successful! a=[" + expr2.get("a").join() + "]");
}
else {
  console.log("Unification unsuccessful!");
}
//The following should be written to the console
//Unification successful! a=[3,4]
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers