@@ -92,6 +92,13 @@ <h1>Arjun Functional Synthesis in Your Browser</h1>
9292 description is available < a
9393 href ="https://jix.github.io/varisat/manual/0.2.0/formats/dimacs.html "> here</ a > </ div >
9494 You need to have "c p show ... 0" for all the variables that are inputs
95+ < div >
96+ < label for ="extra-args "> Extra command line arguments:</ label >
97+ < input type ="text " id ="extra-args "
98+ value ='--mstrategy "const(max_repairs=400),const(max_repairs=400,inv_learnt=1),bve" '
99+ style ="width:100%;padding:8px;box-sizing:border-box;font-family:monospace;border:1px solid #ddd;border-radius:4px; ">
100+ </ div >
101+
95102 < div >
96103 < label for ="input-content "> CNF:</ label >
97104 < textarea id ="input-content "> p cnf 3 3
@@ -167,7 +174,8 @@ <h1>Arjun Functional Synthesis in Your Browser</h1>
167174 try {
168175 console.log('Running with args:', e.data.args);
169176 Module.FS.writeFile('/input.cnf', e.data.input);
170- Module.callMain(['--verb', '1', '--synth', '/input.cnf']);
177+ var args = ['--verb', '3', '--synth'].concat(e.data.extraArgs || []).concat(['/input.cnf']);
178+ Module.callMain(args);
171179 postMessage({ type: 'done' });
172180 } catch (e) {
173181 postMessage({ type: 'error', content: e.toString() });
@@ -181,9 +189,32 @@ <h1>Arjun Functional Synthesis in Your Browser</h1>
181189 }
182190
183191 // Main execution logic
192+ function parseExtraArgs ( str ) {
193+ // Shell-like tokenizer: handles "quoted strings" and unquoted tokens
194+ const args = [ ] ;
195+ let i = 0 ;
196+ while ( i < str . length ) {
197+ while ( i < str . length && str [ i ] === ' ' ) i ++ ;
198+ if ( i >= str . length ) break ;
199+ if ( str [ i ] === '"' ) {
200+ i ++ ;
201+ let start = i ;
202+ while ( i < str . length && str [ i ] !== '"' ) i ++ ;
203+ args . push ( str . slice ( start , i ) ) ;
204+ if ( i < str . length ) i ++ ; // skip closing quote
205+ } else {
206+ let start = i ;
207+ while ( i < str . length && str [ i ] !== ' ' ) i ++ ;
208+ args . push ( str . slice ( start , i ) ) ;
209+ }
210+ }
211+ return args ;
212+ }
213+
184214 document . getElementById ( 'run-button' ) . addEventListener ( 'click' , async function ( ) {
185215 const inputContent = document . getElementById ( 'input-content' ) . value ;
186216 const outputDiv = document . getElementById ( 'output' ) ;
217+ const extraArgs = parseExtraArgs ( document . getElementById ( 'extra-args' ) . value ) ;
187218
188219 if ( ! inputContent . trim ( ) ) {
189220 outputDiv . textContent = 'Error: Please enter input content' ;
@@ -211,7 +242,8 @@ <h1>Arjun Functional Synthesis in Your Browser</h1>
211242 //console.log('ready. Sending input:', inputContent);
212243 worker . postMessage ( {
213244 type : 'run' ,
214- input : inputContent
245+ input : inputContent ,
246+ extraArgs : extraArgs
215247 } ) ;
216248 break ;
217249 case 'done' :
0 commit comments